wss://www.getavenir.co/ws as JSON text frames. Set action on client messages; the server replies and pushes with type.
Trading is WebSocket-only. Past sessions and leaderboards use separate REST routes under
/api.
Auth
UI simulators (userConnected)
- Identity comes from
token(sub). Do not rely on a client-supplieduserId. applicationTypemust be one of:tutorial,mirage,artefact,atlas,opera.- Access is checked server-side (
forbiddenif you lack simulator access). - Marks the socket as a UI client. Only one live UI socket per user per app; a new connect can close the old one (
superseded). - Wait for the first
orderBook(and any app bootstrap push) before sending trading or session-start actions —userConnectedauth is async.
unauthorized.
Opera API clients (operaConnect)
External bots authenticate with a short-lived token copied from /opera. See Opera. That path marks the socket as an API client and blocks UI-only actions.
Shared trading (UI clients)
Tutorial, Mirage, Artefact, and Atlas place and cancel with these actions (UI sockets only). There is no per-order ack; watchorderBook (and app-specific pushes). Invalid place/cancel (bad instrument, off-ladder price, not your order) and rate-limit hits are usually dropped without a client error frame.
Rate limits (per user per app): 120 places and 240 cancels per 60 seconds.