Skip to main content

Module consts

Module consts 

Source
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-algos for cancellation. These cannot be cancelled via the standard cancel-algos endpoint.
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.