Connection URL:Documentation Index
Fetch the complete documentation index at: https://docs.vela.monolithsystematic.com/llms.txt
Use this file to discover all available pages before exploring further.
wss://vela-engine.fly.dev/ws
The WebSocket API provides real-time market data and private account events. All messages are JSON-encoded. The connection supports both public channels (no auth required) and private channels (auth required).
Connection and Keepalive
Connect with a standard WebSocket client:ping every 30 seconds to keep the connection alive. The server closes idle connections after 60 seconds.
Client → Server Messages
subscribe — Subscribe to channels
fills:, orders:, balances:) require authentication first. See Authentication Flow below.
unsubscribe — Unsubscribe from channels
request_challenge — Begin WS auth
auth — Complete WS auth
ping — Keepalive ping
Server → Client Messages
book_snapshot — Full order book
Sent immediately on subscription to book:<market>, and whenever the book changes.
"0" quantity have been removed from the book. Re-apply the full snapshot on each message — do not attempt incremental updates from snapshots (use book_delta for incremental, if supported).
trade — Public trade ticker
Sent when a trade executes on a market you’re subscribed to.
side is the side of the aggressor (the taker order).
challenge — Auth challenge
Sent in response to request_challenge.
auth_success — Auth confirmation
fill — Private fill notification
Sent to authenticated subscribers of fills:<address> when one of your orders is matched.
order_update — Private order status change
Sent to authenticated subscribers of orders:<address> when an order’s status changes.
status values: open, partially_filled, filled, cancelled, rejected.
balance_update — Private balance change
Sent to authenticated subscribers of balances:<address> when a balance changes.
reason values: fill, order_placed, order_cancelled, deposit, withdrawal.
error — Error from server
pong — Keepalive response
Available Channels
| Channel | Auth Required | Description |
|---|---|---|
book:<market> | No | Order book snapshots for a market |
trades:<market> | No | Public trade feed for a market |
fills:<address> | Yes | Your fill notifications |
orders:<address> | Yes | Your order status updates |
balances:<address> | Yes | Your balance changes |
Authentication Flow
Sequence Numbers and Consistency
Book snapshots include asequence number that monotonically increases with every change to the book. If you receive two snapshots out of order (e.g., due to network jitter), discard the one with the lower sequence number.
If you detect a gap in sequence numbers, re-fetch the book via GET /markets/:market/book to get a fresh snapshot, then resume applying WebSocket updates from that point.