Skip to content
MyStocks Developers
API v1

API v1

Current stable contract

Versioning policyRelease changelog
Sandbox console
Trading API

Portfolio Performance

Retrieve cash-flow-adjusted daily P&L, time-weighted returns, and optional benchmark comparisons for master and customer portfolios.

Use GET /portfolio/performance for the partner master account and GET /users/{userId}/portfolio/performance for a customer sub-account. These endpoints are distinct from /portfolio/history, which intentionally returns raw equity snapshots without cash-flow adjustment.

Each point includes equity, marketValue, netCashFlow, dailyPnl, dailyReturn, cumulativeReturn, and—when requested—benchmarkReturn plus excessReturn.

GET

/portfolio/performance

Master-account cash-flow-adjusted performance

Full endpoint documentation
Sandbox availablegetPortfolioPerformance

Returns daily P&L, Modified Dietz interval returns, and geometrically linked cumulative time-weighted return. Completed master/sub-account transfers and completed external top-ups/payouts are cash-flow adjusted. Supply an optional exchange-qualified benchmark symbol for rebased price return and excess-return comparison. Benchmark return excludes dividends and FX. Use /portfolio/history when raw equity snapshots are required.

Parameters

period1M | 3M | 6M | 1Y | ALLquery

Example: 1Y

fromstringquery
tostringquery
benchmarkstringquery

Optional exchange-qualified benchmark symbol.

Example: SCOM.KE

Headers

AuthorizationstringRequired

Bearer sk_sandbox_<your_key> for sandbox requests.

Response fields

accountTypeMASTER | SUBACCOUNTRequired
scopeMASTER_ACCOUNT | SUBACCOUNTRequired
subAccountIdstring
externalIdstring | null
baseCurrencyUSDRequired
timeframe1DRequired
period1M | 3M | 6M | 1Y | ALLRequired
calculationDAILY_MODIFIED_DIETZ_LINKED_TWRRequired
cashFlowAdjustedbooleanRequired
methodologystringRequired
benchmarkunionRequired
summaryobjectRequired
summary.startEquitynumberRequired
summary.endEquitynumberRequired
summary.netCashFlownumberRequired
summary.totalPnlnumberRequired
summary.totalReturnnumberRequired
summary.benchmarkReturnnumber | nullRequired
summary.excessReturnnumber | nullRequired
pointsobject[]Required
points[].timestampstringRequired
points[].equitynumberRequired
points[].marketValuenumberRequired
points[].netCashFlownumberRequired

Signed completed external cash flow during the interval.

points[].dailyPnlnumberRequired

End equity minus start equity minus net cash flow.

points[].dailyReturnnumber | nullRequired

Modified Dietz return for the snapshot interval.

points[].cumulativeReturnnumberRequired

Geometrically linked time-weighted return from the first point.

points[].benchmarkReturnnumber | nullRequired

Rebased benchmark price return when requested.

points[].excessReturnnumber | nullRequired

cumulativeReturn minus benchmarkReturn.

countintegerRequired
asOfstring | null

Response codes

200Cash-flow-adjusted master-account performance.
400Invalid period
404Benchmark symbol not found.
GET

/users/{userId}/portfolio/performance

Sub-account cash-flow-adjusted performance

Full endpoint documentation
Sandbox availablegetUserPortfolioPerformance

Returns daily P&L, Modified Dietz interval returns, and geometrically linked cumulative time-weighted return for one partner-owned sub-account. Completed deposits and withdrawals are treated as external cash flows. Supply an optional exchange-qualified benchmark symbol for rebased price return and excess-return comparison.

Parameters

userIdstringpathRequired
period1M | 3M | 6M | 1Y | ALLquery

Example: 1Y

fromstringquery
tostringquery
benchmarkstringquery

Optional exchange-qualified benchmark symbol.

Example: SCOM.KE

Headers

AuthorizationstringRequired

Bearer sk_sandbox_<your_key> for sandbox requests.

Response fields

accountTypeMASTER | SUBACCOUNTRequired
scopeMASTER_ACCOUNT | SUBACCOUNTRequired
subAccountIdstring
externalIdstring | null
baseCurrencyUSDRequired
timeframe1DRequired
period1M | 3M | 6M | 1Y | ALLRequired
calculationDAILY_MODIFIED_DIETZ_LINKED_TWRRequired
cashFlowAdjustedbooleanRequired
methodologystringRequired
benchmarkunionRequired
summaryobjectRequired
summary.startEquitynumberRequired
summary.endEquitynumberRequired
summary.netCashFlownumberRequired
summary.totalPnlnumberRequired
summary.totalReturnnumberRequired
summary.benchmarkReturnnumber | nullRequired
summary.excessReturnnumber | nullRequired
pointsobject[]Required
points[].timestampstringRequired
points[].equitynumberRequired
points[].marketValuenumberRequired
points[].netCashFlownumberRequired

Signed completed external cash flow during the interval.

points[].dailyPnlnumberRequired

End equity minus start equity minus net cash flow.

points[].dailyReturnnumber | nullRequired

Modified Dietz return for the snapshot interval.

points[].cumulativeReturnnumberRequired

Geometrically linked time-weighted return from the first point.

points[].benchmarkReturnnumber | nullRequired

Rebased benchmark price return when requested.

points[].excessReturnnumber | nullRequired

cumulativeReturn minus benchmarkReturn.

countintegerRequired
asOfstring | null

Response codes

200Cash-flow-adjusted sub-account performance.
400Invalid period
404Sub-account or benchmark symbol not found.

Methodology

  • Daily P&L is end equity - start equity - net external cash flow.
  • Each interval uses Modified Dietz, weighting completed cash flows by the time remaining in the interval.
  • Daily returns are geometrically linked to produce cumulative time-weighted return.
  • Sub-account DEPOSIT and WITHDRAWAL entries are external cash flows.
  • Master-account internal transfers and completed top-ups/payouts are adjusted so funding movement is not reported as investment return.
  • Benchmark comparison is price return rebased to the first available close. It excludes dividends and FX and must be labelled accordingly.

Performance is only as complete as the available daily valuation snapshots. Do not fabricate intraday returns from delayed quotes, and do not present the benchmark comparison as total return.

Was this page useful?

Your signal helps us tighten partner onboarding docs.

Send note

Last updated on

On this page