The price subscription streams real-time bid/ask price levels over the Private WebSocket API. You open one authenticated connection, subscribe to the symbols you care about, and receive a price-update message every time a symbol's prices change.
RFQ liquidity product only. Prices and available symbols on this feed are specific to the RFQ liquidity product. They do not reflect CLOB pricing or available instruments. For CLOB market data, use the dedicated CLOB endpoints.
How it works
The price subscription follows three steps:
- Discover symbols (optional) — Send an
infomessage on theavailable-symbolstopic to list the symbols available on the RFQ product. - Subscribe — Send a signed
subscribemessage on thepricestopic, one per symbol you want to follow. - Receive updates — For each subscribed symbol, the server sends
price-updatemessages (bid and ask levels, up to a depth of 10) whenever the price changes.
connect → (optional) info (available-symbols) → subscribe (topic: prices) per symbol
→ price-update → price-update → … (ongoing)
→ ping every 20s to keep the connection alive
Connection endpoints
| Environment | WebSocket URL |
|---|---|
| Production | wss://ws.zerohash.com |
| Certification (testing) | wss://ws.cert.zerohash.com |
Subscribing
Send a signed subscribe message on the prices topic. Every message must be authenticated — see Authentication. For the price feed, body is required and identifies the symbol.
| Field | Type | Required | Description |
|---|---|---|---|
messageType | string | ✅ | subscribe |
topic | string | ✅ | prices for the price feed |
body | object | ✅ | Object identifying which symbol to subscribe to (required for the price feed) |
key | string | ✅ | Your API public key |
passphrase | string | ✅ | Your API passphrase |
timestamp | string | ✅ | Unix epoch seconds (same value used to sign) |
signature | string | ✅ | Base64-encoded HMAC-SHA256 signature |
Example subscribe message:
{
"messageType": "subscribe",
"topic": "prices",
"key": "API_PUBLIC_KEY",
"passphrase": "API_PASSPHRASE",
"timestamp": "1720000000",
"signature": "base64_encoded_hmac",
"body": { "symbol": "BTC/USD" }
}To follow multiple symbols, send one signed subscribe message per symbol.
Message types on this feed
messageType | Direction | Meaning |
|---|---|---|
info | client → server | Request the list of available RFQ symbols (available-symbols) |
subscribe | client → server | Subscribe to a symbol's price feed (also used in the success ack) |
price-update | server → client | Updated bid/ask levels for a subscribed symbol |
ping | client → server | Heartbeat — required every 20 seconds |
Keeping the subscription alive
Send a signed ping every 20 seconds or the server will close the connection. Because long-lived connections can drop due to network or ISP issues, build in a reconnection / resubscription routine — on reconnect, resubscribe to each symbol. See Maintaining Subscription.
Next steps
- Listing Available Symbols — discover which RFQ symbols you can subscribe to
- Subscribing to a Symbol — the subscribe request and success response
- Price Updates — the
price-updatemessage fields - Authentication — signing every message