This WebSocket channel provides you real-time market data for a set of digital asset symbols. Please see our WebSocket guide for information on Authentication with WebSockets and common messages.
After you subscribe, the server streams market data snapshots for the subscribed symbols as they change.
Every message the server sends on this channel carries a channel field set to digital-assets-market-data, except heartbeats, which carry no channel. Use it to route messages when you are subscribed to more than one channel on the same socket.
Subscribe Digital Assets Market Data
You send the following message when you want to subscribe to market data for a particular account and set of symbols.
{
"authorization": "<access-token>",
"payload": {
"type": "subscribe-digital-assets-market-data",
"account_id": "<account-id>",
"symbols": ["CLST.SPOT.BTC-USD"]
}
}| Field | Type | Required | Description |
|---|---|---|---|
authorization | string | Yes | Your access token. |
payload.type | string | Yes | Always subscribe-digital-assets-market-data. |
payload.account_id | string | Yes | Account you want to subscribe to. |
payload.symbols | string[] | Yes | The digital asset symbols to subscribe to. |
Subscribe Digital Assets Market Data Ack
You receive this message to indicate success or failure of the subscription request you sent. Note, if your request is malformed or otherwise not parsable, you'll instead get an Error Notice.
{
"timestamp": 1711076847030,
"channel": "digital-assets-market-data",
"payload": {
"type": "subscribe-digital-assets-market-data-ack",
"account_id": "<account-id>",
"success": true,
"details": "Subscribed successfully"
}
}| Field | Type | Required | Description |
|---|---|---|---|
timestamp | number | Yes | Milliseconds since epoch timestamp of when the server sent the message. |
channel | string | Yes | Always digital-assets-market-data. |
payload.type | string | Yes | Always subscribe-digital-assets-market-data-ack. |
payload.account_id | string | Yes | The account you sent in your request echoed back. |
payload.success | boolean | Yes | True if successful, false otherwise. |
payload.details | string | Yes | Additional details. |
Digital Asset Market Data Update
You receive this message anytime the market data for a subscribed symbol changes. Each update is a snapshot for a single symbol.
{
"timestamp": 1711076847030,
"channel": "digital-assets-market-data",
"payload": {
"type": "digital-asset-market-data-update",
"data": {
"symbol": "CLST.SPOT.BTC-USD",
"account_id": "<account-id>",
"bid": [{ "price": 64999.5, "quantity": 0.5 }],
"ask": [{ "price": 65000.5, "quantity": 0.5 }],
"trade": [{ "price": 65000.0, "quantity": 0.1 }],
"closing": [{ "price": 64000.0, "quantity": 0.0 }]
}
}
}| Field | Type | Required | Description |
|---|---|---|---|
timestamp | number | Yes | Milliseconds since epoch timestamp of when the server sent the message. |
channel | string | Yes | Always digital-assets-market-data. |
payload.type | string | Yes | Always digital-asset-market-data-update. |
payload.data | object | Yes | Market data snapshot for a single symbol. |
payload.data.symbol | string | Yes | The digital asset symbol this snapshot is for. |
payload.data.account_id | string | Yes | The account this snapshot belongs to. |
payload.data.bid | array | No | Bid-side price levels. |
payload.data.ask | array | No | Ask-side price levels. |
payload.data.trade | array | No | Recent trade prints. |
payload.data.closing | array | No | Closing price levels. |
Each entry in the bid, ask, trade, and closing arrays is a price level object:
| Field | Type | Required | Description |
|---|---|---|---|
price | string | Yes | The price at this level. |
quantity | number | Yes | The quantity at this level. |