{s}omniamarkets

@somnia-chain/markets-sdk


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

Interface: MarketOnchain

Defined in: reads.ts:358

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

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


outcomeToken

outcomeToken: `0x${string}`

Defined in: reads.ts:362

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


yesId

yesId: bigint

Defined in: reads.ts:364

This market's YES position id on the singleton.


noId

noId: bigint

Defined in: reads.ts:366

This market's NO position id on the singleton.


pool

pool: `0x${string}`

Defined in: reads.ts:371

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

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


collateral

collateral: `0x${string}`

Defined in: reads.ts:374


status

status: number

Defined in: reads.ts:376

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


backing

backing: bigint

Defined in: reads.ts:381

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

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

Trading-close / settlement timestamp (seconds).


decimals

decimals: number

Defined in: reads.ts:388

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


winningOutcome

winningOutcome: number

Defined in: reads.ts:392

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

Oracle has resolved the market to a concrete winning outcome.


isVoided

isVoided: boolean

Defined in: reads.ts:396

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