WebSocket API

Trades Channel

Real-time trade prints per market

Channel name: trade

Subscription

{ "op": "sub", "channel": "trade", "params": { "market": "BTC-PERP" } }

params.market is optional. Omit to receive trades for all markets.

Message Types

This channel emits update messages only (no snapshot).

{
  "channel": "trade",
  "filter": "BTC-PERP",
  "type": "update",
  "data": {
    "id": "0x1234...",
    "mkr_sd": "ORDER_SIDE_BUY",
    "px": "50000.00",
    "sz": "0.5",
    "quote_sz": "25000.00"
  },
  "gsn": 12345,
  "ts": "1234567890000000000"
}

Fields

FieldTypeDescription
filterstringMarket ID (e.g. "BTC-PERP")
data.idstringUnique trade identifier
data.mkr_sdstringMaker side — "ORDER_SIDE_BUY" or "ORDER_SIDE_SELL"
data.pxstringExecution price
data.szstringExecuted size in base asset
data.quote_szstringExecuted size in quote asset
tsstringTrade timestamp in nanoseconds
gsnnumberGlobal sequence number

These fields match the v1MarketTrade schema in the REST API response for GET /markets/{mkt_id}/trades.

On this page