Orders Channel
TL;DRThe
orders channel on /v1/stream streams order-lifecycle events for your account: each time one
of your orders is reserved, confirms a fill, fails settlement, cancels, or expires, the
engine pushes an event. The stream is per-account: you only ever see your own
orders. Use it instead of polling GET /orders/{id}.Connect
{"op":"subscribe","channels":["orders"]} on the
same session used for order operations and fills. The channel is
per-account: events are routed to you
by the order-id → account mapping the engine records at intake, so a subscriber
only ever receives events for orders it placed.
Use the verified WebSocket factory returned by the same Node transport that
handles REST. A stock WebSocket does not authenticate the engine’s self-signed,
boot-scoped certificate.
Event shape
Each message is a JSON object describing one state transition:Event kinds
A terminal event is the order’s last; after it, the order has left the book
and produces no further events.
Event flow
Gap recovery
Every event carries a per-connection monotonicseq (starting at 1). Track the
last seq you processed; if the next event’s seq is not exactly one greater,
you missed events in between, so reconcile the orders you care about with
GET /orders/{order_id}.
If a slow consumer falls behind the per-account buffer, the server also closes the
socket with code 1011. On a 1011 close, reconnect and reconcile. The channel
is a low-latency notifier, not a durable log.