Skip to main content

Ticker

Channel Name

spot:ticker:{symbol}

Authentication: not required (public channel).

Description

Provides a rolling 24-hour statistics snapshot on subscribe, then pushes an updated snapshot on every fill and again on the periodic 60-second recompute. Each push is a complete replacement — no incremental math is needed on the client side.

Subscribe

Send:

{ "type": "subscribe", "channel": "spot:ticker:DFUSDT" }

Response:

{ "type": "subscribed", "channel": "spot:ticker:DFUSDT" }

A spot_ticker snapshot is sent immediately after the ack (identical format to subsequent live pushes).

Push Format

spot_ticker

Used for both the initial snapshot on subscribe and all subsequent live updates. The format is identical in both cases — no separate spot_ticker_snapshot type exists.

{
"type": "spot_ticker",
"channel": "spot:ticker:DFUSDT",
"data": {
"symbol": "DFUSDT",
"last_price": "0.5000",
"open_price": "0.4800",
"high": "0.5100",
"low": "0.4700",
"volume": "10000",
"quote_volume": "5000",
"trade_count": 234,
"open_time": 1778313600,
"close_time": 1778400000,
"ts": 1778400000
}
}
FieldTypeDescription
symbolstringMarket identifier.
last_pricestring (decimal)Price of the most recent fill.
open_pricestring (decimal)Price of the first fill in the 24 h window (open_time).
highstring (decimal)Highest fill price in the 24 h window.
lowstring (decimal)Lowest fill price in the 24 h window.
volumestring (decimal)Total base volume (DF) in the 24 h window.
quote_volumestring (decimal)Total quote volume (USDT) in the 24 h window.
trade_countintegerNumber of fills in the 24 h window.
open_timeintegerStart of the 24 h window — unix seconds (≈ now − 86 400).
close_timeintegerEnd of the 24 h window — unix seconds (≈ now).
tsintegerWhen this snapshot was computed — unix seconds.

All timestamps are unix seconds. The 24 h window is [now − 86 400, now] (rolling, not calendar-aligned).

Update Cadence

A spot_ticker push is sent:

  • On every fill — immediately after the matching engine records the cross.
  • Every 60 seconds — a background recompute task refreshes the 24 h statistics even when no fills have occurred (ensures open_time / close_time age correctly).

Because each push is a complete snapshot, a missed push is harmlessly overwritten by the next one. No resync logic is needed.

Code Example

const ws = new WebSocket('wss://api-sepolia.p99.world/ws');

ws.onopen = () => {
ws.send(JSON.stringify({ type: 'subscribe', channel: 'spot:ticker:DFUSDT' }));
setInterval(() => ws.send(JSON.stringify({ type: 'ping' })), 30000);
};

ws.onmessage = (event) => {
const msg = JSON.parse(event.data);

if (msg.type === 'spot_ticker') {
const d = msg.data;
// Update your UI header stats
renderTicker({
lastPrice: d.last_price,
change24h: ((parseFloat(d.last_price) - parseFloat(d.open_price)) / parseFloat(d.open_price) * 100).toFixed(2) + '%',
high24h: d.high,
low24h: d.low,
volume24h: d.volume,
});
}
};

function renderTicker(stats) {
console.log(`Last: ${stats.lastPrice} Change: ${stats.change24h} High: ${stats.high24h} Low: ${stats.low24h} Vol: ${stats.volume24h}`);
}