@somnia-chain/markets-sdk / index / computePortfolioAnalytics
Function: computePortfolioAnalytics()
computePortfolioAnalytics(
events,opts):PortfolioAnalytics
Defined in: packages/sdk/src/unified/portfolioAnalytics.ts:174
Fold portfolio flow events into the metrics plane. PURE — every input is
explicit, so it runs identically in apps, bots, and tests. events may
arrive in any order; they are sorted oldest-first internally. Events
before the window establish the carried-in cost basis; events inside it
drive the equity curve.
Parameters
events
readonly PortfolioFlowEvent[]