@somnia-chain/markets-sdk / index / MarketOnchain
Interface: MarketOnchain
Defined in: packages/sdk/src/markets.ts:1641
A BinaryMarket's wiring + live state, read straight from chain (works before the indexer has the market).
Properties
marketAddress
marketAddress:
`0x${string}`
Defined in: packages/sdk/src/markets.ts:1643
The BinaryMarket contract address (resolved from the module record).
outcomeToken
outcomeToken:
`0x${string}`
Defined in: packages/sdk/src/markets.ts:1645
Protocol-level ERC-6909 outcome-token singleton (shared across all markets).
yesId
yesId:
bigint
Defined in: packages/sdk/src/markets.ts:1647
This market's YES position id on the singleton.
noId
noId:
bigint
Defined in: packages/sdk/src/markets.ts:1649
This market's NO position id on the singleton.
pool
pool:
`0x${string}`
Defined in: packages/sdk/src/markets.ts:1656
The pool hosting (or that hosted) this market's CLOB. Settlement-extraction
v2: a pool address is a TIME-VARYING binding — the same pool serves
successive markets, so never key a market by pool address; (pool, nonce)
identifies this market's slice of the pool's history.
nonce
nonce:
bigint
Defined in: packages/sdk/src/markets.ts:1658
The pool's market nonce for THIS market (part of the outcome-id encoding).
collateral
collateral:
`0x${string}`
Defined in: packages/sdk/src/markets.ts:1660
ERC-20 collateral token the market settles in (its decimals scale backing).
status
status:
number
Defined in: packages/sdk/src/markets.ts:1662
MarketStatus enum: 0 Listed · 1 Trading · 2 Locked · 3 Settling · 4 Resolved · 5 Voided
backing
backing:
bigint
Defined in: packages/sdk/src/markets.ts:1669
Live collateral backing. While trading this is the pool's setBacking (via
market.backing()); once the market is FINALIZED onto the settlement
singleton the pool reads 0, so this falls back to the settlement record's
remaining NET backing (post fee-skim, decremented by each redemption).
finalized
finalized:
boolean
Defined in: packages/sdk/src/markets.ts:1674
True once the market's backing + resolution snapshot were swept to the BinarySettlement singleton (redemption is served there from then on).
expiry
expiry:
bigint
Defined in: packages/sdk/src/markets.ts:1676
Trading-close / settlement timestamp (seconds).
decimals
decimals:
number
Defined in: packages/sdk/src/markets.ts:1678
Collateral decimals (falls back to DECIMALS if the read reverts).
winningOutcome
winningOutcome:
number
Defined in: packages/sdk/src/markets.ts:1684
Winning outcome (0 = YES, 1 = NO). Only meaningful when isResolved — the
contract returns 0 by default which would otherwise read as a YES win on
a market that hasn't resolved yet.
isResolved
isResolved:
boolean
Defined in: packages/sdk/src/markets.ts:1686
Oracle has resolved the market to a concrete winning outcome.
isVoided
isVoided:
boolean
Defined in: packages/sdk/src/markets.ts:1688
Oracle has voided the market (payout per the frozen void policy; see voidPolicy).
voidPolicy
voidPolicy:
number|null
Defined in: packages/sdk/src/markets.ts:1694
Void payout policy frozen at creation: 0 UNIFORM, 2 CLOB_SNAPSHOT (a void
pays [p, D-p] at the closing YES price). null on pre-policy market
clones, which lack the selector and always void uniform.