Skip to main content
This endpoint is in closed beta. It is available only to accounts enrolled in the beta. Request and response shapes may change before general availability.

Request

Authenticate the same way as the other order endpoints. The stream carries every order on the account, whoever placed it. Each order’s placedBy says which user placed 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. Every order, in the snapshot and in each order event, carries contract: the contract’s event, label, question and lifecycle, or null when the catalogue does not have it. An order event is sent when the order changes, not when its contract does: a contract closing or settling reaches you with the order’s next change, or the next snapshot.

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 orders with the new snapshot. A change that happened while you were disconnected is reflected in it. The snapshot is the same set List Prediction Orders returns: every order still open, however old, plus every order created or closed since the trading day rolled over at 17:00 America/Chicago. An order that closed before the rollover drops out of it; read it with List Prediction Order History.

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: