Connection
ping every 30 seconds. The server closes idle connections after 60 seconds.
Subscribe / Unsubscribe
Public Channels
| Channel | Description |
|---|---|
orderbook:{market_id} | Full order book snapshot + incremental updates |
trades:{market_id} | Public trade feed for a market |
markets | All markets — best bid/ask, 24h volume, updated on change |
Order Book
Snapshot (sent immediately on subscribe, and on significant changes):0 means the price level was removed. Apply updates in seq order. If you detect a gap in sequence numbers, re-subscribe to get a fresh snapshot.
Trades
side is the aggressor (taker) side.
Markets
Private Channel
| Channel | Auth Required | Description |
|---|---|---|
account:{address} | Yes | All account events: fills, order updates, balance changes |
Authentication Flow
The auth signature message isvela:ws:{address}:{timestamp} (timestamp is Unix seconds, must be within 30 seconds of server time).
Step 1 — Send auth:
Account Channel Message Types
account_snapshot
Sent immediately after subscribing to the account channel. Provides current state.
fill
Sent when one of your orders receives a fill.
order_update
Sent when an order’s status changes.
status values: open, partially_filled, filled, cancelled, rejected.
cancelled with no user-initiated cancel means the credit system auto-cancelled the order.
balance_update
Sent when your balance changes.
reason values: fill, order_placed, order_cancelled, deposit, withdrawal.
Sequence Numbers and Gap Detection
All messages include aseq field that increments monotonically per channel. If you receive two messages with non-consecutive sequence numbers, you missed one or more updates.
On gap detection: unsubscribe and re-subscribe to the channel to receive a fresh snapshot, then resume applying incremental updates from the new baseline.