Skip to main content
The Top of Book channel provides real-time updates of the best bid and best ask prices for authorized Order Routing customers. This lightweight channel is ideal when you only need the best available prices without the full order book depth.

Subscribe to Top of Book

Request

{
  "type": "subscribe",
  "channels": [
    {
      "type": "market_data.top_of_book",
      "params": {
        "market": "BTCUSD"
      }
    }
  ]
}

Response

{
  "type": "subscribe",
  "channels": [
    {
      "type": "market_data.top_of_book",
      "success": true
    }
  ]
}

Error Response

{
  "type": "subscribe",
  "channels": [
    {
      "type": "market_data.top_of_book",
      "success": false,
      "error": "UNKNOWN_CHANNEL_PARAMS_CONFIGURATION"
    }
  ]
}

Top of Book Message Format

Real-time updates of the best bid and ask prices:
{
  "channel": "market_data.top_of_book",
  "payload": {
    "market": "BTCUSD",
    "type": "TOP_OF_BOOK",
    "timestamp": "2024-01-15T10:30:00.123456789Z",
    "bids": [
      {
        "price": "50000.00",
        "amount": "1.5"
      }
    ],
    "asks": [
      {
        "price": "50100.00",
        "amount": "2.0"
      }
    ]
  }
}

Message Fields

FieldTypeDescription
marketstringThe market pair (e.g., “BTCUSD”)
typestringAlways "TOP_OF_BOOK" for this channel
timestampstringServer timestamp in RFC3339Nano format
bidsarrayArray with best bid price and amount
asksarrayArray with best ask price and amount

Price Level Fields

FieldTypeDescription
pricestringPrice level as a decimal string
amountstringAvailable amount at this price level as a decimal string

Unsubscribe

To stop receiving top of book updates:
{
  "type": "unsubscribe",
  "channels": [
    {
      "type": "market_data.top_of_book",
      "params": {
        "market": "BTCUSD"
      }
    }
  ]
}

List Active Subscriptions

Get all active subscriptions including top of book:
{
  "type": "subscription_list"
}

Response

{
  "type": "subscription_list",
  "channels": [
    {
      "type": "market_data.top_of_book",
      "params": {
        "market": "BTCUSD"
      }
    },
    {
      "type": "market_data",
      "params": {
        "market": "ETHUSD"
      }
    }
  ]
}
Questions? Contact Support.