Appearance
Full order book incremental update
SEND Server to Client on wss://api.valr.com/ws/trade
Sent after the initial FULL_ORDERBOOK_SNAPSHOT with incremental changes to the order book. Uses the same PascalCase structure. A quantity of "0" for an order indicates it should be removed. Apply updates using the SequenceNumber to ensure correct ordering.
Updating rules:
- If an order ID exists in the local book, update its quantity (remove if "0")
- If an order ID is new, add it at the given price level
- If a price level becomes empty, remove it
- Verify the Checksum after applying each update
Subscription
This event requires an explicit subscription. Send a SUBSCRIBE message after connecting:
json
{
"type": "SUBSCRIBE",
"subscriptions": [
{
"event": "FULL_ORDERBOOK_UPDATE"
}
]
}Message
Event type: FULL_ORDERBOOK_UPDATE
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_UPDATE\",\n \"currencyPairSymbol\": \"BTCUSDT\",\n \"data\": {\n \"LastChange\": 1644242600000,\n \"Asks\": [\n {\n \"Price\": \"46150.00\",\n \"Orders\": [\n {\n \"orderId\": \"a38a0816-83a0-4340-b001-130ca2442417\",\n \"quantity\": \"0\"\n }\n ]\n }\n ],\n \"Bids\": [],\n \"SequenceNumber\": 456,\n \"Checksum\": 3456789012\n }\n}"Channel
Channel: trade Address: wss://api.valr.com/ws/trade