Skip to main content

Module handler

Module handler 

Source
Expand description

WebSocket message handler for OKX.

The handler is a thin I/O boundary between the network layer and the client. It owns the WebSocketClient, deserializes raw venue messages into OKXWsMessage events, and handles subscription management, authentication, and retry logic.

All domain parsing (venue types to Nautilus types) occurs outside the handler:

  • Data parsing in PyOKXWebSocketClient (uses an instruments cache)
  • Execution parsing in execution.rs (uses the system Cache)

Enums§

HandlerCommand
Commands sent from the outer client to the inner message handler.

Functions§

is_post_only_auto_cancel
Returns true when an OKX WebSocket order message represents a post-only auto-cancel.
is_post_only_rejection
Returns true when an OKX WebSocket error payload represents a post-only rejection.