Skip to main content
Instead of polling for futures fills, subscribe to the real-time stream and react the instant an order executes. Each fill arrives as a trade plus a position change, which feeds directly into your next quoting cycle. The stream is Server-Sent Events (Content-Type: text/event-stream). Both futures streams require a session — the astra_session cookie or Authorization: Bearer <token>.

Futures endpoints

There are two futures user streams. For market making, prefer the account stream — one connection covers all your futures markets.

What it carries

Orderbook

Single-market stream only. Deltas carry changed levels; size: "0" means the level was removed.

Your trades

id, orderId, marketId, side, price, quantity, liquidity (maker/taker), createdAt.

Your positions

id, marketId, side, quantity, entryPrice, realizedPnl, status; deltas carry upserts and removedIds.

Event model

Every message is an envelope:
The Perp… names are legacy; these are the futures streams. On the account stream, eventSeq increases by exactly one per event — a jump means you missed data, so reconnect and re-snapshot. A : heartbeat comment arrives after 5 seconds without events. On the single-market stream eventSeq is not contiguous and there is no heartbeat, so rely on reconnect-on-drop.

Consume it

EventSource cannot send an Authorization header, so a bot reads the stream with fetch:
JavaScript
A fill shows up as a trade and a position delta. Use the position as the source of truth for inventory, then skew or shrink your next ladder. See inventory management.

Option fills

There is no public fill stream for options. Reconcile option fills and inventory by polling:
  • GET {API_BASE}/options/trades/me?since=<RFC 3339 timestamp> — your option fills since a point in time (up to 500).
  • GET {API_BASE}/positions/me — your option positions.
  • GET {API_BASE}/portfolio/balances/stream — pushes an update whenever your balances change, a useful trigger to re-read fills.

Reconcile futures with pull endpoints

The futures stream is push-first, but you can reconcile at any time:
  • GET {API_BASE}/fut/positions — your positions.
  • GET {API_BASE}/fut/orders/open — your resting orders.
  • GET {API_BASE}/fut/trades — your fills.
  • GET {API_BASE}/portfolio/balances — balances, NLV, and margin.