Documentation Index
Fetch the complete documentation index at: https://cryptorobot.ai/docs/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Cryptorobot.ai uses WebSockets for real-time bidirectional communication. This enables:- Live price ticker updates
- Trading bot event streams
- Order execution notifications
- System alerts and status changes
Connecting
Event Types
Events follow the naming pattern:<service> <method>
| Event Name | Trigger | Payload |
|---|---|---|
strategies created | New strategy created | Strategy object |
strategies patched | Strategy updated | Strategy object |
strategies removed | Strategy deleted | { _id } |
traders created | Bot created | Trader object |
traders patched | Bot status changed | Trader object |
traders pods events created | Pod lifecycle event | Event object |
exchanges ticker patched | Price update | Ticker data |
trades created | Trade executed | Trade object |
models signals created | New signal fired | Signal object |
messages created | New notification | Message object |
events created | System event | Event object |
Listening to Events
Trading Bot Events
Price Updates
Trade Notifications
Signal Alerts
Service Methods via WebSocket
You can also call API methods through the WebSocket connection (instead of REST):Channel Subscription
By default, you receive events for resources you own. The server automatically subscribes authenticated users to their personal channel.You don’t need to manually subscribe to channels. Authentication handles channel membership automatically based on your user ID and permissions.
Reconnection Handling
The client SDK handles reconnection automatically. You can listen for connection status changes:The client SDK automatically re-authenticates after reconnection using the stored JWT token.
Best Practices
Use WebSocket transport only
Use WebSocket transport only
Set
transports: ['websocket'] to skip the HTTP long-polling upgrade handshake and connect faster.Handle disconnections gracefully
Handle disconnections gracefully
Always implement reconnection logic. Network interruptions are normal in long-lived connections.
Don't poll — subscribe
Don't poll — subscribe
Instead of polling REST endpoints for updates, listen to WebSocket events. This reduces latency and API load.
Use REST for initial data, WebSocket for updates
Use REST for initial data, WebSocket for updates
Fetch the initial state via REST (
GET /traders), then subscribe to real-time updates via WebSocket (traders patched).Rate limit event handlers
Rate limit event handlers
High-frequency events (like ticker updates) can fire many times per second. Throttle or debounce your handlers if updating UI.

