@somnia-chain/markets-sdk


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

Interface: BinaryOutcomePnl

Defined in: packages/sdk/src/units.ts:245

One outcome leg's slice of a BinaryPnl. HUMAN numbers (quote/collateral units) throughout — display-grade, like toHuman.

Properties

realized

realized: number

Defined in: packages/sdk/src/units.ts:247

Realized on this outcome's sells: proceeds − avg cost of the tokens sold.


unrealized

unrealized: number | null

Defined in: packages/sdk/src/units.ts:249

The remaining balance marked to mark, minus its avg cost. null when mark is unknown.


avgCost

avgCost: number

Defined in: packages/sdk/src/units.ts:251

Average cost per token of the fills-derived holding; 0 when none held.


mark

mark: number | null

Defined in: packages/sdk/src/units.ts:265

The price this leg is valued at: the book-clamped last while trading (see markYesPrice; the NO leg at its complement), or the settlement payout once resolved — 1 for the winning outcome, 0 for the loser, and on a void this leg's share of the market's stored payout vector (a half under the UNIFORM void policy, [p, D−p] on a captured CLOB_SNAPSHOT void).

null when the market has NO price to value against — it has never traded and no book top was supplied. Do not read that as 0: a zero YES mark is also a full-value NO mark, which reports a fabricated total loss on one leg and a fabricated total gain on the other. value and unrealized are null with it.


value

value: number | null

Defined in: packages/sdk/src/units.ts:267

Mark value of the current balance: balance × mark. null when mark is unknown.