Skip to main content
This endpoint is in closed beta. It is available only to accounts enrolled in the beta, and only on staging (https://api.tradearies.dev). Request and response shapes may change before general availability.

Request

Authenticate the same way as the other order endpoints. The stream carries only the authenticated user’s own orders: an account you have no orders on streams an empty snapshot and nothing after it.

Events

A : ping comment is sent every 15 seconds to keep idle connections open.

snapshot

orders holds every order on the account in an open state: pending_new, new, partially_filled, or unknown. Each order has the same shape as data.order in Get Prediction Order.

order

Each order is the whole order as it stands after the change, not a delta: replace what you hold for that orderId. Orders reaching a final state (filled, canceled, rejected, expired, done_for_day) arrive this way too, and so do orders placed after you connected.

resync

The stream ends right after a resync. Reconnect, and the new snapshot brings your view up to date. slow_client means you stopped reading events fast enough to keep up; shutdown means the server is restarting.

Ordering

  • Every order carries a version that rises with each change. Keep the highest version you have seen for each orderId, and ignore an order at or below it. The stream already drops older versions, but applying this rule makes your client correct across reconnects too.
  • snapshot comes first. Every order after it is newer than the snapshot’s copy of that order.
  • Changes to one order arrive in the order they happened. Changes to different orders may interleave.

Reconnecting

Events have no IDs and are not replayed. Every connection starts with a fresh snapshot, so after a disconnect or a resync, reconnect and replace your open orders with the new snapshot. A change that happened while you were disconnected is reflected in it. An order that reached a final state while you were away drops out of the snapshot; read it with List Prediction Orders if you need it.

Examples

cURL
A browser’s EventSource cannot send an Authorization header, so read the stream with fetch:
JavaScript

Working with the stream

  • Prices and quantities are decimal strings. "0.54", not 0.54. Parse them with a decimal type.
  • Optional fields are omitted when absent, never sent as zero.
  • Do not put the stream behind a buffering proxy. Events must reach you as they are sent.

Errors

Errors are returned before the stream opens, in the usual error envelope: