Live market data
Live market data
Use sdk.live to keep a pair or instrument fresh. Nutrimatic bootstraps over HTTPS, streams updates over SSE, merges locally, and (in the browser) pauses when the tab is hidden.
You do not need to invent poll intervals for the default path.
watchPair
const sub = sdk.live.watchPair({
pair: '42-USDT',
chart: { interval: '1h', limit: 100 },
channels: ['spot', 'pool', 'trades', 'chart'],
onUpdate: (snap) => {
// snap.spot, snap.pool, snap.chart, snap.trades, …
},
onError: (err) => {
console.error(err.code, err.message)
},
})
// later
sub.unsubscribe()| Field | Meaning |
|---|---|
pair | Listed pairLabel |
chart | Optional — bootstrap candles (interval, limit) |
channels | Optional SSE channels (default includes spot, pool, trades, chart) |
onUpdate | Called after bootstrap and on each stream update |
onError | Typed failures (INFRASTRUCTURE_UNAVAILABLE, …) |
Returns { unsubscribe, getSnapshot() }.
watchInstrument
const sub = sdk.live.watchInstrument({
instrumentId: 'evm:421018:instrument:42',
onUpdate: (snap) => {
// snap.telemetry
},
})Advanced (optional)
One-shot reads (easy.read.getChart, feed windows, etc.) remain for paging history, diagnostics, and custom UIs. Composition of candle/feed windows (bootstrap / after / before) is documented under Chart windows and Activity feeds — those pages are not the default live path.