Expand description
Provides the WebSocket client integration for the OKX WebSocket API.
The OKXWebSocketClient ties together several recurring patterns:
- Heartbeats use text
ping/pong, responding to both text and control-frame pings. - Authentication re-runs on reconnect before resubscribing and skips private channels when credentials are unavailable.
- Subscriptions cache instrument type/family/ID groupings so reconnects rebuild the same set of channels while respecting the authentication guard described above.
Structs§
- OKXWeb
Socket Client - Provides a WebSocket client for connecting to OKX.
Statics§
- OKX_
WS_ CONNECTION_ QUOTA - Default OKX WebSocket connection rate limit: 3 requests per second.
- OKX_
WS_ ORDER_ QUOTA - Rate limit for order-related WebSocket operations: 250 requests per second.
- OKX_
WS_ SUBSCRIPTION_ QUOTA - OKX WebSocket subscription rate limit: 480 requests per hour per connection.
Functions§
- is_
post_ only_ rejection - Returns
truewhen an OKX error payload represents a post-only rejection.