Skip to main content

Access real-time platform data

  1. Bootstrap the initial state you need from REST.
  2. Open the realtime connection and subscribe only to the feeds your workflow needs.
  3. Track acknowledgements, ordinals, and reconnect state explicitly.
  4. Apply updates in connection order and reconcile by update family after reconnects.
  5. Keep market-data and user-data handling separate in your application pipeline.

Build the initial baseline first

  1. Use REST to load the current products, market snapshot, or user-scoped state your workflow needs.
  2. Keep that baseline in memory or persistent storage before subscribing.
  3. Record which update families you will resume later if the WebSocket reconnects.

Subscribe with the correct feed shape

NeedFeed family
public market depthORDER_BOOK_L2 or ORDER_BOOK_L3
live mark priceMARK_PRICE
order lifecycle outcomesORDER_UPDATE
strategy collateral and position updatesSTRATEGY_UPDATE
trader-level balance and profile updatesTRADER_UPDATE

Process updates safely

  1. Wait for ACKNOWLEDGE on your subscribe and unsubscribe messages.
  2. Apply messages in top-level ordinal order for the active connection.
  3. Treat globalOrdinal as per-update-family resume state, not as one number that can be compared across every message type.
  4. Use orderMatchOrdinal plus ORDER_UPDATE.ordinal when you need to reconstruct one multi-outcome match.

Reconnect without corrupting state

  • re-open the connection
  • resubscribe to the exact feed set you previously used
  • resume one update family with its own globalOrdinal
  • run a REST reconciliation pass when the workflow requires exact current state

Boundary rule

Realtime access is a streaming-update workflow, not a full replacement for REST. Use REST for initial state and durable reconciliation, and use realtime for ordered updates after that baseline exists.

Next routes

Last modified on April 13, 2026