Skip to main content

Module dispatch

Module dispatch 

Source
Expand description

WebSocket execution dispatch for the Kraken Spot and Futures clients.

Implements the two-tier execution dispatch contract from docs/developer_guide/adapters.md (lines 1232-1296):

  1. The execution client registers an OrderIdentity in WsDispatchState when it submits an order.
  2. WebSocket execution messages are routed through the per-product dispatch functions in futures and spot. For tracked orders the dispatch builds typed [OrderEventAny] events and emits them directly via [ExecutionEventEmitter::send_order_event]. For untracked / external orders the dispatch falls back to OrderStatusReport / FillReport so the engine can reconcile.

The dispatch state lives in an Arc<WsDispatchState> shared between the main client thread (which registers identities at submission time) and the spawned WebSocket consumer task. DashMap/DashSet provide lock-free concurrent access.

Modules§

futures
WebSocket execution dispatch for the Kraken Futures API.
spot
WebSocket execution dispatch for the Kraken Spot v2 API.
spot_orders
WebSocket order-request dispatch state for Kraken Spot v2.

Structs§

DeltaSnapshot
Snapshot of the mutable fields seen on a tracked OpenOrdersDelta.
OrderIdentity
Identity metadata captured when an order is submitted through this client.
WsDispatchState
Per-client dispatch state shared between order submission and the WebSocket consumer task.