Skip to main content

Crate nautilus_okx

Crate nautilus_okx 

Source
Expand description

NautilusTrader adapter for the OKX cryptocurrency exchange.

The nautilus-okx crate provides client bindings (HTTP & WebSocket), data models and helper utilities that wrap the official OKX v5 API.

The official OKX API reference can be found at https://www.okx.com/docs-v5/en/. All public links inside this crate reference the English version.

§NautilusTrader

NautilusTrader is an open-source, production-grade, Rust-native engine for multi-asset, multi-venue trading systems.

The system spans research, deterministic simulation, and live execution within a single event-driven architecture, providing research-to-live semantic parity.

§Feature Flags

This crate provides feature flags to control source code inclusion during compilation, depending on the intended use case, i.e. whether to provide Python bindings for the nautilus_trader Python package, or as part of a Rust only build.

  • python: Enables Python bindings from PyO3.
  • extension-module: Builds as a Python extension module.

High-precision mode (128-bit value types) is enabled by default.

Re-exports§

pub use crate::common::enums::OKXInstrumentType;
pub use crate::common::enums::OKXOrderType;
pub use crate::common::enums::OKXPositionMode;
pub use crate::common::enums::OKXPositionSide;
pub use crate::common::enums::OKXSide;
pub use crate::common::models::OKXInstrument;
pub use crate::data::OKXDataClient;
pub use crate::execution::OKXExecutionClient;
pub use crate::http::client::OKXHttpClient;
pub use crate::http::error::OKXHttpError;
pub use crate::websocket::client::OKXWebSocketClient;
pub use crate::websocket::error::OKXWsError;

Modules§

common
Common functionality shared across the OKX adapter.
config
Configuration structures for the OKX adapter.
data
Live market data client implementation for the OKX adapter.
execution
Live execution client implementation for the OKX adapter.
factories
Factory functions for creating OKX clients and components.
http
HTTP/REST client implementation for the OKX v5 API.
python
Python bindings from pyo3.
websocket
WebSocket client implementation for the OKX v5 API.