After connecting, users should send a subscription message containing a list of assets to subscribe to.
For better throughput and resource utilization, we recommended subscribing to all desired assets on a single connection.
Example subscribe message:
{
"type": "subscribe",
"trace_id": "123", // optional, will be echoed back in the response
"data": [
"BTCUSD",
"ETHUSD",
"BTCUSDMARK"
]
}
A subscription response will contain your connection's current list of subscribed assets.
An example subscription response:
{
"type": "subscribe",
"trace_id": "123",
"data": {
"subscriptions": [
// includes all current subscriptions, not just those in the request (e.g. ARBUSDMARK)
"BTCUSD",
"ETHUSD",
"ARBUSDMARK",
"BTCUSDMARK"
]
}
}
Unsubscribing
To unsubscribe from receiving price updates for certain assets, send an unsubscription message:
After subscribing to assets (and possibly before receiving the response) users should expect to receive messages with "type": "aggregated_signed_prices" with following format: