Skip to main content

Connection model summary

The realtime family uses one WebSocket endpoint and one subscription-control protocol.
PartContract
Endpointwss://exchange.derivadex.com/realtime-api
Control messagesSUBSCRIBE and UNSUBSCRIBE, each acknowledged by ACKNOWLEDGE
Market-data feedsORDER_BOOK_L2, ORDER_BOOK_L3, MARK_PRICE
User-data feedsORDER_UPDATE, STRATEGY_UPDATE, TRADER_UPDATE
Initial-state ruleUse REST for initial user state, then use realtime for updates

Ordering fields

FieldMeaning
Top-level sequenceGlobal monotonically increasing server notification sequence; a connection can observe gaps because it does not subscribe to every feed update
Top-level ordinalPer-connection monotonically increasing order across all subscribed feeds for that connection
globalOrdinalStable identifier over updates of one update type, used for REST pagination and reconciliation within that same update type; do not compare across different update types
orderMatchOrdinalShared identifier for all order outcomes from the same match
ORDER_UPDATE.ordinalPer-outcome ordinal within one orderMatchOrdinal group

Feed families

Feed familyFirst message shapeOngoing message shapeFiltering rule
Market dataPARTIAL snapshotUPDATE deltaOmit filters only if you intentionally want all symbols or aggregations
User dataEmpty PARTIALUPDATE eventsFilter by trader, and narrow further by strategy, symbol, or reason when available

Lifecycle

  • Send SUBSCRIBE with one or more feeds and their parameter objects.
  • Expect ACKNOWLEDGE after each control message; the published subscribe and unsubscribe descriptions show a matching nonce, but the payload schema only requires result, so keep client request bookkeeping for fallback correlation.
  • Market feeds emit a populated PARTIAL first, then UPDATE messages.
  • User-data feeds emit an empty PARTIAL first; fetch the initial orders, strategies, or trader balances from REST before treating realtime as authoritative.
  • Apply messages in top-level ordinal order for one connection, use globalOrdinal to resume one update type after reconnects, do not compare it across different update types, and use orderMatchOrdinal plus ORDER_UPDATE.ordinal to reconstruct multi-outcome matches.
  • Use UNSUBSCRIBE with the same control-plane pattern when you want to stop one or more feeds.

Recovery checkpoints

SymptomWhat to do nextWhy
ACKNOWLEDGE.result.error on SUBSCRIBE or UNSUBSCRIBERepair the feed list or filter parameters, then resend the control messageThe control-plane request failed before feed continuity was established or changed
Socket close before user-data bootstrap is completeReconnect, resubscribe, and redo the REST bootstrap stepUser-data feeds begin with an empty PARTIAL, so the stream alone does not recreate prior account state
Suspected continuity loss for one update family after reconnectReconcile that update family with its own REST/history surface and globalOrdinal; do not compare ordinals across different update familiesglobalOrdinal is update-type scoped, not a universal cross-family clock
One match produces multiple order outcomesReconstruct from orderMatchOrdinal plus ORDER_UPDATE.ordinalThose two fields are the public grouping model for one match with multiple consequences

Adjacent routes

Last modified on April 13, 2026