Appearance
Full order book snapshot
SEND Server to Client on wss://api.valr.com/ws/trade
Sent once on subscription. Contains the complete order book with individual orders visible at each price level (not aggregated). Uses PascalCase keys. After this initial snapshot, incremental updates are sent via FULL_ORDERBOOK_UPDATE messages.
The order book checksum (CRC32) can be used to verify data integrity. The SequenceNumber is incremented on each update and can be used to detect missed messages.
Subscription
This event requires an explicit subscription. Send a SUBSCRIBE message after connecting:
json
{
"type": "SUBSCRIBE",
"subscriptions": [
{
"event": "FULL_ORDERBOOK_SNAPSHOT"
}
]
}Message
Event type: FULL_ORDERBOOK_SNAPSHOT
Payload Schema
| Property | Type | Required | Description |
|---|---|---|---|
| LastChange | integer (int64) | Yes | - |
| Asks | WsFullOrderBookPriceLevel[] | Yes | - |
| Bids | WsFullOrderBookPriceLevel[] | Yes | - |
| SequenceNumber | integer (int64) | Yes | - |
| Checksum | integer (int64) | Yes | - |
Asks (WsFullOrderBookPriceLevel)
| Property | Type | Required | Description |
|---|---|---|---|
| Price | string | Yes | - |
| Orders | WsFullOrderBookOrder[] | Yes | - |
Bids (WsFullOrderBookPriceLevel)
| Property | Type | Required | Description |
|---|---|---|---|
| Price | string | Yes | - |
| Orders | WsFullOrderBookOrder[] | Yes | - |
Example
json
"{\n \"type\": \"FULL_ORDERBOOK_SNAPSHOT\",\n \"currencyPairSymbol\": \"BTCUSDT\",\n \"data\": {\n \"LastChange\": 1644242571116,\n \"Asks\": [\n {\n \"Price\": \"46150.00\",\n \"Orders\": [\n {\n \"orderId\": \"a38a0816-83a0-4340-b001-130ca2442417\",\n \"quantity\": \"0.01\"\n }\n ]\n }\n ],\n \"Bids\": [\n {\n \"Price\": \"45850.00\",\n \"Orders\": [\n {\n \"orderId\": \"9e4b6b18-fd55-4e05-a355-1ffd5b6fbb63\",\n \"quantity\": \"0.001\"\n }\n ]\n }\n ],\n \"SequenceNumber\": 455,\n \"Checksum\": 2345678942\n }\n}"Channel
Channel: trade Address: wss://api.valr.com/ws/trade