@somnia-chain/markets-sdk


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

Function: estPayoutFor()

estPayoutFor(input): bigint

Defined in: packages/sdk/src/derivedReads.ts:653

Compute the estimated payout for one settled position (raw collateral). Winner: amount × (10_000 − feeBps) / 10_000; voided: amount × payoutNumerators[outcomeIdx] / payoutDenominator; loser: 0.

A void pays its stored vector, which is a half per side under the UNIFORM policy and [p, D−p] on a CLOB_SNAPSHOT void that captured a two-sided close. When the vector is absent the estimate falls back to the half, which is what this returned for every void before the vector existed.

A void is never fee-charged, so no settlement fee applies on this branch — the raw vector and the fee-scaled one are identical for a void.

Errors

Throws InvalidInputError when a void has a present but invalid payout vector. A legacy row with both vector fields absent keeps the documented half-payout fallback.

Parameters

input

ClaimableInput

Returns

bigint