Content-Type: text/event-stream). Connect
with any SSE / EventSource client and reconnect on drop.
Endpoints
There are two user streams. For market making, prefer the all-markets stream — one connection covers your whole book.- All markets (recommended)
- Single market
GET {API_BASE}/perps/stream/user — Auth: session cookie or API key.Your fills and position changes across every market on a single
connection. No order book is included, so it stays lightweight even with many
markets open.Restrict position data to open positions.
Server diff/emit cadence in ms (default ~250, range 100–5000).
Both streams are scoped to your authenticated account for the trades and positions
they carry. Use
/perps/stream/user to cover an N-market book with one
connection; use /perps/stream/events when you specifically need a market’s order
book alongside your fills.What it carries
The stream delivers a canonical envelope and, scoped to your authenticated account for the fills and positions parts, three things:Orderbook
The public CLOB book (single-market stream only; levels with
size:"0" mean
the level was removed).Your trades
Your fills:
side, price, quantity, liquidity (maker/taker),
createdAt.Your positions
Your positions:
side, quantity, entryPrice, realizedPnl, status
(upserts + removedIds).Event model
Every message is an envelope:| Event | eventType | Meaning |
|---|---|---|
snapshot | PerpStreamSnapshot | Full state on connect: book + recent trades + your positions. |
delta | PerpStreamDelta | Incremental changes: changed book levels, newly-seen trades, position upserts/removals. |
error | — | { code, message, retryable } on upstream failure. |
eventSeq increases monotonically (once per emitted event) so you can detect
gaps. Apply the initial snapshot, then fold in each delta. If you see a
sequence jump or the connection drops, reconnect — you will receive a fresh
snapshot to re-sync from.
Consume it
Reconcile with pull endpoints
The stream is push-first, but you can reconcile at any time:GET {API_BASE}/perps/positions— your open positions.GET {API_BASE}/perps/orders/open— your currently resting orders.GET {API_BASE}/perps/trades— your recent fills.GET {API_BASE}/perps/balances— your perp balance / margin view.