Overview
The Rust SDK provides a Socket.IO-basedWebSocketClient for:
- orderbook and trade streams
- market and price updates
- authenticated order, fill, position, and transaction streams
- automatic reconnect with subscription replay
Setup
Create a WebSocket client from the root SDK client:Connect and Disconnect
WebSocketConfig
Event Handlers
Useon() for raw JSON handlers, once() for one-shot handlers, and off() to unregister:
Typed handlers
The SDK also provides typed event handlers:Subscribing to Channels
After connecting, subscribe to specific channels:Public channels
Authenticated channels
SubscriptionOptions
Unsubscribing
Updating credentials
You can rotate credentials at runtime:Auto-reconnect
Whenauto_reconnect is enabled, the client reconnects and replays saved subscriptions automatically.
The Rust client preserves normalized subscription options internally, so reconnects restore previous subscriptions without extra application code.