@somnia-chain/markets-sdk


@somnia-chain/markets-sdk / index / PortfolioAnalytics

Interface: PortfolioAnalytics

Defined in: packages/sdk/src/unified/portfolioAnalytics.ts:67

The computed metrics plane — mirrors what a portfolio page renders.

Properties

timeframe

timeframe: PortfolioTimeframe

Defined in: packages/sdk/src/unified/portfolioAnalytics.ts:68


asOf

asOf: number

Defined in: packages/sdk/src/unified/portfolioAnalytics.ts:70

Upper bound of the series (ms).


equity

equity: EquityPoint[]

Defined in: packages/sdk/src/unified/portfolioAnalytics.ts:72

Cumulative window PnL over time, oldest first; first point is 0.


pnl

pnl: object

Defined in: packages/sdk/src/unified/portfolioAnalytics.ts:73

totalUsd

totalUsd: number

Signed total PnL over the timeframe, USD (== last equity point).

buckets

buckets: PnlBucket[]


mwrr

mwrr: object

Defined in: packages/sdk/src/unified/portfolioAnalytics.ts:78

return

return: number | null

Period money-weighted return as a fraction; null when the capital base is ~0 or negative (a net seller has no base to weight a return by).

gainUsd

gainUsd: number

Signed money gained over the period, USD.

depositedUsd

depositedUsd: number

Net capital deployed into trades over the window: carried-in position value + buys − sell proceeds. Signed.


volume

volume: object

Defined in: packages/sdk/src/unified/portfolioAnalytics.ts:92

periodUsd

periodUsd: number

Trading volume over the timeframe, USD.

lifetimeUsd

lifetimeUsd: number

Volume across every supplied event, USD.

sessionUsd?

optional sessionUsd?: number

Volume since sessionSince, when supplied.


feesSaved

feesSaved: object

Defined in: packages/sdk/src/unified/portfolioAnalytics.ts:100

cexRateBps

cexRateBps: number

The comparison taker rate (bps) the savings are computed against.

periodUsd

periodUsd: number

Volume × rate over the timeframe, USD.

lifetimeUsd

lifetimeUsd: number

Volume × rate across every supplied event, USD.