{s}omniamarkets

@somnia-chain/markets-sdk


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

Function: binaryFillsFor()

binaryFillsFor(account, fills, decimals?): BinaryPnlFill[]

Defined in: units.ts:91

Derive per-account BinaryPnlFills from the raw FillRows the indexer returns (as from getUserFills), from account's perspective. Skips fills whose side/kind the indexer hasn't fully bridged (unknown side), and re-expresses the fill's price into the outcome the account traded (the book is YES-terms; a NO trade prices at 1 − yesPrice).

Parameters

account

string

fills

FillRow[]

decimals?

number = DECIMALS

Returns

BinaryPnlFill[]