Skip to content

Aggregated order book updated ​

SEND Server to Client on wss://api.valr.com/ws/trade

Sent when the order book has been updated. Contains the full order book with all orders aggregated by price level, showing the total quantity and order count at each level. Subscribe with specific currency pairs to filter updates.

Subscription ​

This event requires an explicit subscription. Send a SUBSCRIBE message after connecting:

json
{
    "type": "SUBSCRIBE",
    "subscriptions": [
        {
            "event": "AGGREGATED_ORDERBOOK_UPDATE"
        }
    ]
}

Message ​

Event type: AGGREGATED_ORDERBOOK_UPDATE

Payload Schema ​

PropertyTypeRequiredDescription
asksWsOrderbookLevel[]Yes-
bidsWsOrderbookLevel[]Yes-

asks (WsOrderbookLevel) ​

PropertyTypeRequiredDescription
sidestringYes-
quantitystringYes-
pricestringYes-
currencyPairstringYes-
orderCountinteger (int32)Yes-

bids (WsOrderbookLevel) ​

PropertyTypeRequiredDescription
sidestringYes-
quantitystringYes-
pricestringYes-
currencyPairstringYes-
orderCountinteger (int32)Yes-

Example ​

json
"{\n    \"type\": \"AGGREGATED_ORDERBOOK_UPDATE\",\n    \"currencyPairSymbol\": \"BTCZAR\",\n    \"data\": {\n        \"asks\": [\n            {\n                \"side\": \"sell\",\n                \"quantity\": \"1.50000000\",\n                \"price\": \"960000\",\n                \"currencyPair\": \"BTCZAR\",\n                \"orderCount\": 3\n            },\n            {\n                \"side\": \"sell\",\n                \"quantity\": \"0.75000000\",\n                \"price\": \"961000\",\n                \"currencyPair\": \"BTCZAR\",\n                \"orderCount\": 1\n            }\n        ],\n        \"bids\": [\n            {\n                \"side\": \"buy\",\n                \"quantity\": \"2.00000000\",\n                \"price\": \"950000\",\n                \"currencyPair\": \"BTCZAR\",\n                \"orderCount\": 5\n            },\n            {\n                \"side\": \"buy\",\n                \"quantity\": \"1.25000000\",\n                \"price\": \"949000\",\n                \"currencyPair\": \"BTCZAR\",\n                \"orderCount\": 2\n            }\n        ]\n    }\n}"

Channel ​

Channel: trade Address: wss://api.valr.com/ws/trade