@somnia-chain/markets-sdk


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

Function: marketIntervalLabel()

marketIntervalLabel(m): string | null

Defined in: packages/sdk/src/interval.ts:212

The served timeframe label for a binary market: resolve the cadence (resolveIntervalSec), snap it to its ladder rung (snapToCadence), then label it (formatIntervalLabel) — so a market reads as "1m" / "5m" / "15m" / "1h" / "4h" / "24h" whether or not its roll spilled. A window matching no rung (a series' bootstrap partial, a non-ladder cadence) keeps its own short window. Returns null when the market has no determinable cadence (SPOT/PERP). This is what the SDK stamps onto BinaryMarket.interval and trade-history rows.

Snapping to the LADDER rather than to the nearest minute/hour is what stops a row's own badge contradicting the group it was filed under: a 1m member that rolled 4s late is indexed at 56s, which the plain unit snap has no rung to reach for and labels "56s".

Parameters

m

IntervalSource

Returns

string | null