Skip to main content
Connection URL: 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:
Send a ping every 30 seconds to keep the connection alive. The server closes idle connections after 60 seconds.

Client → Server Messages

subscribe — Subscribe to channels

Private 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.
Price levels with "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.
Possible 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

Authentication Flow

Sequence Numbers and Consistency

Book snapshots include a sequence 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.