The /orders, /accounting, and /events streams use the same resume protocol.
- Data-frame
seqvalues are strictly increasing in delivery order but are not guaranteed to be contiguous. Filters and retention can produce valid gaps. A gap alone is not evidence of data loss and must not trigger a reconnect. - Drop a data frame when
seq <= last_applied; otherwise apply it atomically with persisting the newlast_applied. heartbeatandbacklog_enddo not advance the data sequence; they repeat the latest relevantseq.- Reconnect with
since=last_applied. The server may replay that sequence inclusively, then sendsbacklog_endand continues live delivery. The duplicate check makes this safe. - Replay is limited to messages from the preceding one hour. Reconnect promptly and do not rely on older history being available.
resume_too_oldfollowed by close code4009means the requested position is outside the supported replay window or is otherwise unavailable.- Close code
4008means the client is reading too slowly. Keep socket reads independent from slower business processing and enforce bounded local queues. - Use heartbeat
interval_secfor liveness detection; reconnect if no frame arrives within the client-defined timeout.
Available URL filters differ by stream:
/orders: repeatablemarket,event_id, andaccount_id./accounting: repeatablemarketandaccount_id./events: repeatableevent_id,market_id, andlang.
Changing filters changes which sequence numbers are delivered and invalidates assumptions tied to the previous subscription. Persist a resume position together with its filter set.