@somnia-chain/markets-sdk


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

Function: boundaryPrice()

boundaryPrice(m, openingPrices): { raw: string; posted: boolean; } | null

Defined in: packages/sdk/src/markets.ts:1365

The level a binary market's outcome is measured against, in the oracle's price scale — the one answer to that question, for every surface that asks.

Which source supplies it is exactly BinaryMarket.mode:

  • "reference" — the posted answer to the market's reference question, from the openingPrices map that client.getOpeningPrices returns. null until the oracle posts it, which is a real and temporary state.
  • "fixed" — the market's own strike, known from creation.

posted says WHICH, because it decides what a caller may CLAIM about the number: only a posted answer has an "answered at" instant, so only it may be labelled as one. Returning it here rather than letting callers re-test the map keeps the label and the value derived from one decision.

Lives here rather than in a UI because it is protocol knowledge, not presentation: which of two mechanisms a venue chose.

Scale is the caller's to apply, as with any raw oracle value.

Parameters

m

Pick<BinaryMarket, "id" | "strike" | "mode">

openingPrices

Record<string, string | null>

Returns

{ raw: string; posted: boolean; } | null