Skip to main content
The trades channel streams every public trade for a contract — regardless of which account was involved. Each push message contains an array of one or more trade objects, all of which executed in the same block. If you only care about fills from your own account, use the userFills channel instead.

Subscribing

Replace "1" with the numeric contract ID whose trade stream you want to receive.

Push message format

Multiple trade objects may appear in the data array when several trades execute within the same block. Process them in array order.

Trade object fields

string
Contract ID. Matches the asset in your subscription.
string
Trade execution price (raw string). Apply the contract’s decimal precision before displaying to users.
string
Trade size (raw string). This is the notional quantity that changed hands at px.
string
Indicates which side initiated the trade. "B" means the buyer was the aggressor (taker); "S" means the seller was the aggressor (taker).
number
Globally unique trade ID assigned on-chain. Use this to deduplicate trades if you receive the same block’s data from multiple sources.
number
Reserved field; currently 0. Use the outer ts field on the envelope for event timing.

Outer envelope fields

number
Server send timestamp in Unix milliseconds. Use this as the authoritative timestamp for all trades in the data array.

Backfill on subscribe

On a successful subscription the server first pushes a history snapshot frame, marked "isSnapshot": true, whose data array holds up to the last 100 trades for the contract in ascending time order. Live incremental frames follow and do not carry isSnapshot. When the contract has no trade history the snapshot frame carries "data": [].
In the backfill frame, time is the real trade time. In live incremental frames time is currently 0 — use the envelope ts as the authoritative timestamp there.

Building a trade history feed

1

Subscribe and take the backfill

Send the subscribe message. The first frame carries up to 100 recent trades — render it as your initial tape.
2

Merge the live stream

Subsequent frames arrive without isSnapshot. Ordering between the backfill and the live stream guarantees no gap; a small overlap is possible.
3

Deduplicate using tid

Use tid as the unique key when merging the backfill with the live stream, or when combining with any other source.
For longer history than the 100-trade backfill, or for aggregated OHLCV, use the REST candleSnapshot endpoint.
To build a volume-weighted average price (VWAP) over a rolling window, accumulate px × sz from incoming trade messages, divide by the rolling total sz, and reset the window at your chosen interval.