@somnia-chain/markets-sdk


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

Type Alias: BaseMarket

BaseMarket = object

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

Fields every market has, regardless of type.

Properties

id

id: string

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

Primary key (lowercased): bytes32 marketId for binary, pool address for spot.


chainId?

optional chainId?: number

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

Numeric chain id the market lives on.

Set on every row a SomniaMarketsClient or the SomniaMarkets facade returns, including rows the live tail materializes. Absent only on rows built by the internal data-first mappers, which know the indexer but not the chain; the owning client stamps it at its boundary. A market is unique to one chain, so (chainId, id) names it globally where id alone names it only on that chain.


marketType

marketType: MarketType

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

Discriminator — narrow on this (or the is*Market guards).


poolAddress

poolAddress: Address

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

The pool serving this market (lowercased; == id for SPOT/PERP). For binary, a TIME-VARYING binding — see the recycle caveat on BinaryMarket.nonce.


lastPrice

lastPrice: string | null

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

Last fill price (raw). For binary, ≈ YES probability × 10^decimals. Null until first fill.


lastTradeAt

lastTradeAt: string | null

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

Timestamp (unix seconds) of the last fill; null until first fill.


cumulativeBaseVolume

cumulativeBaseVolume: string

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

Cumulative base/outcome-token volume (raw, decimal string).


cumulativeQuoteVolume

cumulativeQuoteVolume: string

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

Cumulative quote/collateral volume (raw, decimal string).


tradeCount

tradeCount: string

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

Lifetime fill count (decimal string).


baseDecimals

baseDecimals: number

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

Base-token decimals (binary: outcome tokens mirror the collateral's decimals).


quoteDecimals

quoteDecimals: number

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

Quote-token decimals (binary: the collateral's — per-venue, e.g. 6dp TestUSDC vs 18dp USDso). Format prices/amounts with this.


createdAtTimestamp

createdAtTimestamp: string

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

Timestamp (unix seconds) the market was created/indexed.


createdAtBlock

createdAtBlock: string

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

Block the market was created in. Carried for the same reason as resolvedAtBlock: a market is bracketed by two reads of an off-chain feed and only a BLOCK identifies which print each one saw — a "fixed"-mode market's strike IS the feed's spot at THIS block (see BinaryMarket.mode), and that print lands before tradingStart far more often than on it, so createdAtTimestamp cannot find it.