Skip to main content
Stream public market data as prices, books, trades, candles, tickers, and market statistics change.
Private order, fill, and account-state reconciliation is covered in Reconcile Trade State.
Start with the stream that matches the view you are building. Subscribe to the updates you need, read events while the view is active, then stop the stream when the view no longer needs live data.
Subscribe from a PublicClient or SecureClient and iterate over the merged event stream.
The stream yields typed events for each subscription and can be closed when the live view no longer needs updates.

Best Bid and Offer

Use best bid and offer updates for top-of-book quotes.
Subscribe to best bid and offer updates for one instrument.
After subscribing, the stream yields PerpsBboEvent objects like this.

Interpret Update Timing

Use update timing to understand how recent the exchange’s reflected activity is. Keep sequence-based reconciliation separate from timing measurements.
timestamp is the server send time in Unix milliseconds. eventTimestamp is the newest event reflected in the update as EpochMilliseconds | null. Check for null before measuring the time spent inside the exchange after that event:
eventTimestamp: null means the event horizon is unknown. Local reconnect or sequence-gap "resync" events have no eventTimestamp. Do not substitute their timestamp for an exchange event horizon. Server-originated session updates and resyncs carry the server’s horizon through the same field.

Order Book

Use order book updates for depth across bid and ask price levels.
Subscribe to order book updates for one instrument.
After subscribing, the stream yields PerpsBookEvent objects like this.

Trades

Use trades to update recent-print lists, last-trade displays, or execution-based analytics.
Subscribe to public trade updates for one instrument.
After subscribing, the stream yields PerpsTradeEvent objects like this.
payload contains an array of trades. Each trade exposes settlement, which is false for ordinary executions and defaults to false on older responses.

Tickers

Use ticker updates for the current mark, index, last price, open interest, and funding state.
Subscribe to ticker updates for one instrument or all active instruments.
Omit instrumentId to subscribe to ticker updates for all active instruments.After subscribing, the stream yields PerpsTickerEvent objects like this.

Statistics

Use statistics for 24-hour volume, opening price, and the rolling kline window.
Subscribe to 24-hour statistics for one instrument or all active instruments.
Omit instrumentId to subscribe to statistics updates for all active instruments.After subscribing, the stream yields PerpsStatisticEvent objects like this.

Candles

Use candles to update charts with live OHLCV data.
Subscribe to candle updates for one instrument and interval.
The public stream supports 1m, 5m, 15m, 1h, 4h, 1d, and 1w candle intervals.After subscribing, the stream yields PerpsCandleEvent objects like this.