Use realtime when the job is ordered live updates
Realtime is the right entry point when you need:- market-data streams rather than one-off snapshots
- ordered account and order updates after bootstrap
- subscription control over trader-, strategy-, symbol-, or reason-filtered feeds
- reconnect and resume behavior that preserves client reconciliation
Quickstart map
| Concern | Start here | Why it matters |
|---|---|---|
| Identity and feed visibility | Authentication | Market feeds are public and user-data feeds use filter parameters rather than connection-level auth |
| Subscription lifecycle | Connection Model | You need to understand SUBSCRIBE, UNSUBSCRIBE, ACKNOWLEDGE, PARTIAL, and UPDATE behavior |
| Failure handling | Errors | Reconnect problems and business-domain rejections are different failure classes |
| Schema ownership | Source Artifacts | Keeps the published contract tied to the right AsyncAPI inputs |
| Generated channel discovery | Generated Reference Status | Shows how the generated reference layer is produced and where it is authoritative |
The two main realtime usage patterns
| Pattern | Main feeds | First thing to remember |
|---|---|---|
| Market-data streaming | ORDER_BOOK_L2, ORDER_BOOK_L3, MARK_PRICE | Market feeds start with a populated PARTIAL, then continue with UPDATE messages |
| User-data tracking | ORDER_UPDATE, STRATEGY_UPDATE, TRADER_UPDATE | User-data feeds begin with an empty PARTIAL; bootstrap state from REST first |
What a correct realtime client usually does
| Stage | What the client needs |
|---|---|
| Connect | Open one WebSocket to wss://exchange.derivadex.com/realtime-api |
| Subscribe | Send SUBSCRIBE messages and correlate ACKNOWLEDGE responses by nonce |
| Bootstrap | Use REST for initial user state before treating realtime as authoritative |
| Process updates | Apply events using the documented ordering model, not local arrival time alone |
| Recover | Reconnect, resubscribe, and resume one update type with its own globalOrdinal rules when needed |
Ordering and bootstrap rules to internalize early
- The per-connection
ordinalfield is the primary ordering surface for one live connection. globalOrdinalis an update-family resume tool, not a cross-family universal clock.orderMatchOrdinalandORDER_UPDATE.ordinalare what let you reconstruct one match that produced multiple outcomes.- User-data subscriptions without a REST bootstrap step produce an incomplete account picture.