Expand description
Core constants shared across the OKX adapter components.
Constants§
- OKX
- OKX_
ADVANCE_ ALGO_ ORDER_ TYPES - Advance algo order types that require
cancel-advance-algosfor cancellation. These cannot be cancelled via the standardcancel-algosendpoint. - OKX_
CONDITIONAL_ ORDER_ TYPES - Conditional order types that require the OKX algo order API.
- OKX_
FIELD_ CLORDID - JSON field key for client order ID in order operation responses.
- OKX_
FIELD_ SCODE - JSON field key for sub-error code in order operation responses.
- OKX_
FIELD_ SMSG - JSON field key for sub-error message in order operation responses.
- OKX_
HTTP_ URL - OKX_
NAUTILUS_ BROKER_ ID - See https://www.okx.com/docs-v5/en/#overview-broker-program for further details.
- OKX_
POST_ ONLY_ CANCEL_ REASON - Human-readable reason used when a post-only order is auto-cancelled for taking liquidity.
- OKX_
POST_ ONLY_ CANCEL_ SOURCE - OKX cancel source code used when a post-only order is auto-cancelled for taking liquidity.
- OKX_
POST_ ONLY_ ERROR_ CODE - OKX error code returned when a post-only order would immediately take liquidity.
- OKX_
SUCCESS_ CODE - OKX success response code for WebSocket operations.
- OKX_
SUPPORTED_ ORDER_ TYPES - OKX supported order types.
- OKX_
SUPPORTED_ TIME_ IN_ FORCE - OKX supported order time in force.
- OKX_
TARGET_ CCY_ BASE - Target currency literal for base currency.
- OKX_
TARGET_ CCY_ QUOTE - Target currency literal for quote currency.
- OKX_
WS_ BUSINESS_ URL - OKX_
WS_ DEMO_ BUSINESS_ URL - OKX_
WS_ DEMO_ PRIVATE_ URL - OKX_
WS_ DEMO_ PUBLIC_ URL - OKX_
WS_ HEARTBEAT_ SECS - WebSocket heartbeat (ping/pong) interval in seconds.
- OKX_
WS_ PRIVATE_ URL - OKX_
WS_ PUBLIC_ URL - OKX_
WS_ TOPIC_ DELIMITER
Statics§
- OKX_
RETRY_ ERROR_ CODES - OKX error codes that should trigger retries.
- OKX_
VENUE
Functions§
- resolve_
book_ depth - Clamps a requested book depth to the nearest OKX-supported value.
- resolve_
instrument_ families - Resolves instrument families for a given instrument type.
- should_
retry_ error_ code - Determines if an OKX error code should trigger a retry.