@somnia-chain/markets-sdk


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

Interface: PortfolioFundingEvent

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

External capital entering or leaving the wallet — a bridge delivery, a transfer from another wallet, a withdrawal.

Funding events refine the MWRR capital base ONLY. They never touch the equity curve, PnL, or volume: moving money into an account is not profit, and it is not a trade.

Venue fills are NOT funding. A trade's settlement transfer is an internal rearrangement the trade event already carries, so a caller sourcing funding from raw token transfers MUST exclude transfers whose counterparty is a venue contract (pool, router, settlement) or the same capital is counted twice.

These are caller-supplied because the SDK cannot derive them: the indexer has no wallet token-transfer entity, and the public Somnia RPC caps eth_getLogs at 1,000 blocks. Source them from app records, bridge history, or a private RPC scan, valued in USD at the event time.

Properties

kind

kind: "funding"

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

Event kind.


timestamp

timestamp: number

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

Event time (ms).


direction

direction: "in" | "out"

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

Whether capital entered or left the wallet.


valueUsd

valueUsd: number

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

Absolute value moved, human USD units (positive).