Skip to content
API reference /WebSocket feeds

Stream order book changes

Subscribe to ETH and BTC books, inspect an ETH update, then unsubscribe from the same topics.

Start receiving updates

Subscription message

{
  "op": "subscribe",
  "args": ["<topic 1>", "<topic 2>", "...", "<topic n>"]
}

Channel parameters

  • Topic format: "usdt/orderBook.{instrument_id}.[depth]"
Field Data type Required Meaning
instrument_id string YES Contract abbreviation, for example ETH-SWAP.
depth integer NO Order book depth: 5, 10, 50, 100, 200

Example input

{
  "op": "subscribe",
  "args": ["usdt/orderBook.ETH-SWAP.10", "usdt/orderBook.BTC-SWAP"]
}

Incoming message

The first message uses action: insert; subsequent updates use action: update. Bid levels run from highest to lowest price, and ask levels from lowest to highest. Each row is [price, quantity]. The strictly increasing version helps check update continuity.

{
  "topic": "usdt/orderBook.ETH-SWAP",
  "action": "update",
  "data": [
    {
      "bids": [
        ["2449.8", "236"],
        ["2449.7", "0"],
        ["2449.6", "190"],
        ["2449.5", "355"],
        ["2449.4", "0"],
        ["2449.3", "128"],
        ["2449.2", "460"]
      ],
      "asks": [
        ["2450.2", "184"],
        ["2450.3", "276"],
        ["2450.4", "0"],
        ["2450.5", "320"],
        ["2450.6", "145"],
        ["2450.7", "410"]
      ],
      "version": 72081001,
      "timestamp": 1795161600000
    }
  ]
}

Stop receiving updates

Unsubscription message

{
  "op": "unsubscribe",
  "args": ["<topic 1>", "<topic 2>", "...", "<topic n>"]
}

Channel parameters

  • Topic format: "usdt/orderBook.{instrument_id}.[depth]"
Field Data type Required Meaning
instrument_id string YES Contract abbreviation, for example ETH-SWAP.
depth integer NO Order book depth.

Stop this subscription

{
  "op": "unsubscribe",
  "args": ["usdt/orderBook.ETH-SWAP.10", "usdt/orderBook.BTC-SWAP"]
}