{s}omniamarkets

@somnia-chain/markets-sdk


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

Interface: MarketOnchain

Defined in: reads.ts:410

A BinaryMarket's wiring + live state, read straight from chain (works before the indexer has the market).

Properties

marketAddress

marketAddress: `0x${string}`

Defined in: reads.ts:412

The BinaryMarket contract address (resolved from the module record).


outcomeToken

outcomeToken: `0x${string}`

Defined in: reads.ts:414

Protocol-level ERC-6909 outcome-token singleton (shared across all markets).


yesId

yesId: bigint

Defined in: reads.ts:416

This market's YES position id on the singleton.


noId

noId: bigint

Defined in: reads.ts:418

This market's NO position id on the singleton.


pool

pool: `0x${string}`

Defined in: reads.ts:425

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: reads.ts:427

The pool's market nonce for THIS market (part of the outcome-id encoding).


collateral

collateral: `0x${string}`

Defined in: reads.ts:429

ERC-20 collateral token the market settles in (its decimals scale backing).


status

status: number

Defined in: reads.ts:431

MarketStatus enum: 0 Listed · 1 Trading · 2 Locked · 3 Settling · 4 Resolved · 5 Voided


backing

backing: bigint

Defined in: reads.ts:438

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: reads.ts:443

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: reads.ts:445

Trading-close / settlement timestamp (seconds).


decimals

decimals: number

Defined in: reads.ts:447

Collateral decimals (falls back to DECIMALS if the read reverts).


winningOutcome

winningOutcome: number

Defined in: reads.ts:453

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: reads.ts:455

Oracle has resolved the market to a concrete winning outcome.


isVoided

isVoided: boolean

Defined in: reads.ts:457

Oracle has voided the market (no winner; both sides redeem 0.5:1).