@@ -161,7 +161,14 @@ export class AccountsController {
161161 }
162162
163163 // Portfolio history endpoint - MUST come before :address route to avoid route conflict
164- @ApiOperation ( { operationId : 'getPortfolioHistory' } )
164+ @ApiOperation ( {
165+ operationId : 'getPortfolioHistory' ,
166+ summary : 'Portfolio value history snapshots' ,
167+ description :
168+ 'Returns portfolio value over time (AE balance, token values, total value). ' +
169+ 'Pass include=pnl or include=pnl-range to add aggregate total_pnl data. ' +
170+ 'Per-token PnL breakdown (tokens_pnl) is available via the dedicated :address/portfolio/tokens/history endpoint.' ,
171+ } )
165172 @ApiParam ( { name : 'address' , type : 'string' , description : 'Account address' } )
166173 @ApiOkResponse ( { type : [ PortfolioHistorySnapshotDto ] } )
167174 @CacheTTL ( 60 * 10 ) // 10 minutes
@@ -198,7 +205,13 @@ export class AccountsController {
198205 } ) ;
199206 }
200207
201- @ApiOperation ( { operationId : 'getTokensPnlHistory' } )
208+ @ApiOperation ( {
209+ operationId : 'getTokensPnlHistory' ,
210+ summary : 'Per-token PnL history snapshots' ,
211+ description :
212+ 'Returns portfolio history snapshots that include the per-token PnL breakdown (tokens_pnl). ' +
213+ 'PnL data is always included; pass include=pnl-range to use range-based (daily window) PnL instead of cumulative.' ,
214+ } )
202215 @ApiParam ( { name : 'address' , type : 'string' , description : 'Account address' } )
203216 @ApiOkResponse ( { type : [ PortfolioHistorySnapshotDto ] } )
204217 @CacheTTL ( 60 * 10 )
@@ -217,16 +230,14 @@ export class AccountsController {
217230 const requestedInterval = query . interval || 86400 ;
218231 const finalInterval = Math . max ( requestedInterval , minimumInterval ) ;
219232
220- const includePnl =
221- includeFields . includes ( 'pnl' ) || includeFields . includes ( 'pnl-range' ) ;
222233 const useRangeBasedPnl = includeFields . includes ( 'pnl-range' ) ;
223234
224235 return await this . portfolioService . getPortfolioHistory ( address , {
225236 startDate : start ,
226237 endDate : end ,
227238 interval : finalInterval ,
228239 convertTo : query . convertTo || 'ae' ,
229- includePnl,
240+ includePnl : true ,
230241 useRangeBasedPnl,
231242 includeTokensPnl : true ,
232243 } ) ;
0 commit comments