Skip to main content

Module client

Module client 

Source
Expand description

Execution client implementations for various exchanges.

§Connector Comparison

ConnectorReconnectDedupFill RecoveryHeartbeat
binanceAuto (1s→30s backoff)10k LRUREST after reconnect30s
alpacaAuto (1s→30s backoff)2k LRUREST after reconnect35s
ibkrCaller responsibilityN/ACaller responsibilityN/A
hyperliquidSDK-managed10k LRU, fills onlyCaller responsibilitySDK-managed

§Resilience Philosophy

WebSocket-based connectors (Binance, Alpaca) implement auto-reconnection with fill recovery and deduplication. After reconnect, they query REST APIs for missed fills and deduplicate against the LRU cache to prevent duplicate processing.

IBKR uses TCP to local TWS/Gateway. Reconnection requires IB Gateway availability and client ID coordination — decisions that belong in the caller’s wrapper. See ibkr module docs for caller responsibilities.

Hyperliquid delegates reconnection to the official SDK’s with_reconnect() mechanism, but deduplicates fills itself: the SDK resubscribes on reconnect and the venue opens a userFills subscription with a snapshot, so every reconnect redelivers fills already seen. It does not recover fills missed while disconnected — callers needing that call ExecutionClient::fetch_trades, whose results are not deduplicated against the stream.

§Known Limitations

All connectors have a gap between reconnection and fill recovery: order lifecycle events (NEW, CANCELED, EXPIRED) during disconnect are NOT recovered. Callers must call ExecutionClient::fetch_open_orders after reconnect to reconcile state.

Modules§

alpaca
binance
Binance execution clients.
hyperliquid
Hyperliquid ExecutionClient implementations for perpetual futures and spot trading.
ibkr
Interactive Brokers ExecutionClient implementation.
mock

Traits§

BracketOrderClient
Extension trait for exchanges that support native bracket orders.
ExecutionClient