Price Subscription

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:

  1. Discover symbols (optional) — Send an info message on the available-symbols topic to list the symbols available on the RFQ product.
  2. Subscribe — Send a signed subscribe message on the prices topic, one per symbol you want to follow.
  3. Receive updates — For each subscribed symbol, the server sends price-update messages (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

EnvironmentWebSocket URL
Productionwss://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.

FieldTypeRequiredDescription
messageTypestringsubscribe
topicstringprices for the price feed
bodyobjectObject identifying which symbol to subscribe to (required for the price feed)
keystringYour API public key
passphrasestringYour API passphrase
timestampstringUnix epoch seconds (same value used to sign)
signaturestringBase64-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

messageTypeDirectionMeaning
infoclient → serverRequest the list of available RFQ symbols (available-symbols)
subscribeclient → serverSubscribe to a symbol's price feed (also used in the success ack)
price-updateserver → clientUpdated bid/ask levels for a subscribed symbol
pingclient → serverHeartbeat — 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