For AI agents: the documentation index is at /llms.txt, and this page is available as Markdown at /api/websocket/market-data.md.

Market Data WebSocket

Overview

This API streams real-time market data over a single WebSocket connection. Clients subscribe to one or more topics and receive batched price candles, trending assets, surging assets, and weighted reference prices as they update.

Operations are described from the server's side: send is a message the server sends to you, and receive is a message you send to the server.

Topics

Subscribe to specific topics, or to the all wildcard alias to receive every stream:

  • price_candles — OHLC price candles
  • trending_assets — trending assets
  • surging_assets — surging assets
  • reference_prices — weighted reference prices
  • all — wildcard alias; receive all of the above

Per-instrument topics are delivered only to clients that subscribe to them by name, never to all, and the current value is sent as soon as the subscription lands:

  • price.{SYMBOL} — live price with 1h and 24h change (perps: price.{SYMBOL}-PERP)
  • candles.{SYMBOL}.{interval} — one candle series, interval one of 30s, 1h, 4h, 24h
  • reference.{SYMBOL} — weighted reference bid/mid/ask for the {SYMBOL}|USD pair
  • orderbook.{venue}.{pair} — full order-book depth

Symbols are case-insensitive and keyed upper-case. A connection may hold a limited number of topics; topics over the limit are rejected with topic_limit_exceeded.

all is a subscription convenience, not a stream of its own. Every pushed message carries the concrete topic it belongs to in topics (e.g. ["price_candles"]), even when delivered to an all subscriber. Because all is a wildcard, unsubscribing an individual topic while subscribed to all has no effect — to drop a single topic, subscribe to explicit topics and unsubscribe them individually.

Authentication

All channels are public — no API key, signature, or other credentials are required.

Numeric Precision

Prices, market caps, and other numeric values are returned as strings to preserve full decimal precision and avoid floating-point rounding.

/v1/defi/market

Subscribe

SEND Message sent to server indicating which topics the client wants to subscribe to or unsubscribe from. Message reference

Subscription Response

RECEIVE Acknowledgement sent from server in response to a subscribe or unsubscribe request. Message reference

Price Candles

RECEIVE Batch of OHLC price candles for tracked assets across the standard intervals. Message reference

Trending Assets

RECEIVE Batch of trending assets ranked by recent vs. historical trading volume. Message reference

Surging Assets

RECEIVE Batch of assets with significant price movement over 1h, 4h, and 24h windows. Message reference

Reference Prices

RECEIVE Batch of weighted reference prices computed from multiple exchange BBOs. Message reference

Orderbook

RECEIVE Full order-book depth snapshot for a subscribed orderbook.{venue}.{pair} topic. Message reference

Price

RECEIVE Live price for a subscribed price.{SYMBOL} topic. Message reference

Candles

RECEIVE One candle for a subscribed candles.{SYMBOL}.{interval} topic. Message reference

Reference

RECEIVE Weighted reference price for a subscribed reference.{SYMBOL} topic. Message reference

Error

RECEIVE Server-side error message describing why a request was rejected. Message reference

Was this page helpful?YesNo