Skip to main content

Crate nautilus_binance

Crate nautilus_binance 

Source
Expand description

NautilusTrader adapter for the Binance cryptocurrency exchange.

The nautilus-binance crate provides client bindings (HTTP & WebSocket) and data models for the official Binance API. Live data and execution clients are available for:

  • Spot markets, including Binance US (api.binance.com)
  • USD-M Futures (fapi.binance.com)
  • COIN-M Futures (dapi.binance.com)

The crate also includes shared enums, endpoint constants, URL routing, and credential plumbing for adjacent Binance surfaces such as Margin and European Options. Those surfaces do not have live data or execution clients in this crate. Portfolio Margin likewise has no live clients here, but its signed REST transport is available in papi.

The official Binance API reference can be found at https://developers.binance.com/en/docs/.

§NautilusTrader

NautilusTrader is an open-source, production-grade, Rust-native trading engine with a deterministic, event-driven architecture for multi-asset, multi-venue systems.

The system spans research, simulation, and live execution, providing research-to-live semantic parity.

§Feature Flags

Feature flags control code inclusion for Rust builds and Python bindings:

  • arrow: Enables Apache Arrow data support.
  • examples: Enables the crate’s example binaries.
  • extension-module: Builds as a Python extension module.
  • high-precision (default): Enables high-precision mode to use 128-bit value types.
  • python: Enables Python bindings from PyO3.

§Integrator Attribution

Spot and Futures execution clients and HTTP clients that build orders from Nautilus types encode supported client order IDs with NautilusTrader’s Link and Trade integration prefix. Raw HTTP and WebSocket API trading clients preserve caller-supplied IDs.

See attribution details.

§Documentation

Modules§

arrow
Arrow serialization for Binance adapter types.
common
Common types, constants, and utilities for the Binance adapter.
config
Binance adapter configuration structures.
data_types
Binance-specific custom data types.
factories
Factory functions for creating Binance clients and components.
futures
Binance Futures adapter components.
papi
Binance Portfolio Margin (PAPI) REST transport.
python
Python bindings for the Binance adapter.
spot
Binance Spot market adapter with full SBE (Simple Binary Encoding) support.