@somnia-chain/markets-sdk


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

Function: binaryFillsFromPortfolio()

binaryFillsFromPortfolio(trades, decimals?): BinaryPnlFill[]

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

Derive BinaryPnlFills from one market's slice of a portfolio's trades (as from getPortfolio). The portfolio view already resolves the account's own side per fill, so this only re-expresses the YES-terms fillPrice into the traded outcome (a NO trade prices at 1 − yesPrice) and skips fills whose side the indexer hasn't bridged yet.

Parameters

trades

PortfolioTrade[]

decimals?

number = Store.DECIMALS

Returns

BinaryPnlFill[]