@somnia-chain/markets-sdk / index / binaryFillsFor
Function: binaryFillsFor()
binaryFillsFor(
account,fills,decimals?):BinaryPnlFill[]
Defined in: packages/sdk/src/units.ts:321
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).
SCOPE IS THE CALLER'S JOB: no market filter is applied here, so pass ONE
market's fills when the result feeds cost basis, selected by
FillRow.market (never by pool — see there).
Parameters
account
string
fills
FillRow[]
decimals?
number = Store.DECIMALS