@somnia-chain/markets-sdk


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

Interface: MarketOnchain

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

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:1368

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


outcomeToken

outcomeToken: `0x${string}`

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

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


yesId

yesId: bigint

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

This market's YES position id on the singleton.


noId

noId: bigint

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

This market's NO position id on the singleton.


pool

pool: `0x${string}`

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

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:1383

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:1385

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


status

status: number

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

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


backing

backing: bigint

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

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:1399

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:1401

Trading-close / settlement timestamp (seconds).


decimals

decimals: number

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

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


winningOutcome

winningOutcome: number

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

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:1411

Oracle has resolved the market to a concrete winning outcome.


isVoided

isVoided: boolean

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

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