Market data and channels

Market data is public: every client sees the same data. Subscribe to the channels you need, and each update arrives as a data message naming its channel.

Channels

ChannelPatternDescription
Orderbookorderbook:{symbol}Real-time orderbook: a snapshot, then level updates
Tradestrades:{symbol}Trade executions
Tickerticker:{symbol}24-hour price statistics, updated periodically
Candlescandles:{symbol}:{granularity}OHLCV candle updates
Oracleoracle:{token}Oracle price feed
Oracle volumeoracle_volume:{token}Oracle volume feed
  • {symbol} is a trading pair, for example CC/USDCx.
  • {granularity} is the candle interval in seconds: 60, 300, 900, 3600, 14400 or 86400.
  • {token} is a token identifier, not a trading pair, for example cc or cbtc. It is case-insensitive: oracle:CC and oracle:cc are the same feed.

You can subscribe to at most 50 channels per connection.

Subscribing

{"type":"subscribe","channels":["orderbook:CC/USDCx","trades:CC/USDCx","ticker:CC/USDCx"]}

The server confirms with:

{"type":"subscribed","channels":["orderbook:CC/USDCx","trades:CC/USDCx","ticker:CC/USDCx"]}

The confirmation lists only the channels that were subscribed. A channel name that does not match one of the patterns above is ignored without an error, so compare the confirmation with what you asked for. Going over 50 channels gets an error with code MAX_SUBSCRIPTIONS.

To stop receiving a channel:

{"type":"unsubscribe","channels":["orderbook:CC/USDCx"]}

Subscriptions are not restored after a reconnect. Subscribe again each time you connect.

Do not subscribe to your own orders or trades. They are pushed to you automatically. See User events.

The orderbook channel

1. Snapshot (first message after subscribe)

A full orderbook snapshot is sent as soon as you subscribe. Replace your entire local book with it.

{
  "type": "data",
  "channel": "orderbook:CC/USDCx",
  "data": {
    "type": "snapshot",
    "bids": [
      {"price": 0.1439, "quantity": 75685, "order_count": 26},
      {"price": 0.1438, "quantity": 21129, "order_count": 30}
    ],
    "asks": [
      {"price": 0.1432, "quantity": 5438.34, "order_count": 120},
      {"price": 0.1433, "quantity": 5133.55, "order_count": 86}
    ]
  }
}

Bids are sorted highest price first. Asks are sorted lowest price first.

2. Level updates (ongoing)

After the snapshot, you receive updates for individual price levels:

{
  "type": "data",
  "channel": "orderbook:CC/USDCx",
  "data": {"type": "update", "side": "bid", "price": 0.1439, "quantity": 65685, "order_count": 25}
}

Each update carries the absolute quantity at that price level, not a change. Apply it as follows:

  • quantity > 0: set or insert the level at that price
  • quantity = 0: remove the level at that price

3. Keeping the book on your side

Store the book as a map keyed by price:

// On snapshot:
bids = new Map(snapshot.bids.map(l => [l.price, l]))
asks = new Map(snapshot.asks.map(l => [l.price, l]))

// On update:
const map = update.side === 'bid' ? bids : asks
if (update.quantity === 0) {
  map.delete(update.price)
} else {
  map.set(update.price, { quantity: update.quantity, order_count: update.order_count })
}

After a reconnect, replace your book with the new snapshot. Do not merge it with the book you had before.

4. Excluding your own orders

The orderbook includes your own orders. To work out the quantity available to you (for example to price a market order), subtract your active order quantities per price level, using your user_order events.

Payloads

Every market data message has this shape:

{"type":"data","channel":"<channel>","data":{ ... }}

The data fields for each channel:

Orderbook level (snapshot bids and asks, and each update)

FieldTypeDescription
pricenumberPrice level (4 decimal precision)
quantitynumberTotal quantity at this price level. 0 in an update means the level is removed.
order_countintegerNumber of orders at this price level
sidestringUpdates only: bid or ask

Trades

{"type":"data","channel":"trades:CC/USDCx","data":{"settlement_cid":"...","trade_id":"...","symbol":"CC/USDCx","quantity":"10","price":"0.1439","side":"sell","status":"pending","created_at":"2026-12-01T17:09:31Z"}}
FieldTypeDescription
trade_idstringTrade ID
settlement_cidstringSettlement contract ID
symbolstringTrading pair
quantitystringDecimal quantity
pricestringDecimal price
sidestringbuy or sell: the side of the resting (maker) order
statusstringpending (matched), settling, settled, or rolled_back. A trade can be sent again when its status changes.
created_atstringWhen the trade happened (RFC 3339, UTC)

Ticker

FieldTypeDescription
last_pricenumberLast traded price
open_24hnumber24-hour open price
high_24hnumber24-hour high
low_24hnumber24-hour low
volume_24hnumber24-hour volume in the base asset
quote_volume_24hnumber24-hour volume in the quote asset
volume_24h_usdnumber24-hour base volume in USD
quote_volume_24h_usdnumber24-hour quote volume in USD
price_change_pctnumber24-hour price change

Candles

FieldTypeDescription
open_timestringStart of the candle (RFC 3339, UTC)
opennumberOpen price
highnumberHigh price
lownumberLow price
closenumberClose price
volumenumberVolume in the base asset
quote_volumenumberVolume in the quote asset
trade_countintegerNumber of trades in the candle. Not present on every candle.

Oracle

{"type":"data","channel":"oracle:cc","data":{"price":"0.1441"}}
FieldTypeDescription
pricestringDecimal price, as a string for precision

Oracle volume

{"type":"data","channel":"oracle_volume:cc","data":{"volume":"1250000"}}
FieldTypeDescription
volumestringDecimal volume, as a string for precision

Did this page help you?