Skip to main content

Trade

Channel Name

spot:trade:{symbol}

Authentication: not required (public channel).

Description

Streams every public fill as it happens. No snapshot is sent on subscribe — subscribe to this channel for a live tape, and call GET /spot/trades first if you need historical fills.

Subscribe

Send:

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

Response:

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

No snapshot follows. The next push arrives on the next fill.

Push Format

spot_trade

One message per fill, emitted immediately when the matching engine records a cross.

{
"type": "spot_trade",
"channel": "spot:trade:DFUSDT",
"data": {
"trade_id": "9f2a1b3c-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
"symbol": "DFUSDT",
"side": "buy",
"price": "0.5000",
"quantity": "30",
"ts": 1778400000123
}
}
FieldTypeDescription
trade_idstring (UUID)Unique identifier for this fill.
symbolstringMarket identifier, e.g. DFUSDT.
sidestringTaker side of the cross: buy or sell.
pricestring (decimal)Execution price.
quantitystring (decimal)Filled base quantity (DF in the DFUSDT market).
tsintegerUnix timestamp in milliseconds (the only millisecond-precision field in the spot API).

side reflects the taker. A buy fill means a market-buy or aggressive limit-buy order initiated the cross against a resting sell. Use the private spot:user:orders channel if you need to distinguish your own maker vs. taker role.

Update Cadence

One push per fill, event-driven. There is no polling interval or throttling — every cross produces exactly one spot_trade message.

Code Example

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

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

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

if (msg.type === 'spot_trade') {
const { trade_id, symbol, side, price, quantity, ts } = msg.data;
const time = new Date(ts).toISOString(); // ts is milliseconds
console.log(`[${time}] ${symbol} ${side.toUpperCase()} ${quantity} @ ${price} (id=${trade_id})`);
// Add to your trade tape, update last-price display, etc.
}
};