Skip to main content

nautilus_binance/
lib.rs

1// -------------------------------------------------------------------------------------------------
2//  Copyright (C) 2015-2026 Nautech Systems Pty Ltd. All rights reserved.
3//  https://nautechsystems.io
4//
5//  Licensed under the GNU Lesser General Public License Version 3.0 (the "License");
6//  You may not use this file except in compliance with the License.
7//  You may obtain a copy of the License at https://www.gnu.org/licenses/lgpl-3.0.en.html
8//
9//  Unless required by applicable law or agreed to in writing, software
10//  distributed under the License is distributed on an "AS IS" BASIS,
11//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12//  See the License for the specific language governing permissions and
13//  limitations under the License.
14// -------------------------------------------------------------------------------------------------
15
16//! [NautilusTrader](https://nautilustrader.io) adapter for the
17//! [Binance](https://www.binance.com/) cryptocurrency exchange.
18//!
19//! The `nautilus-binance` crate provides client bindings (HTTP & WebSocket), data
20//! models, and helper utilities that wrap the official **Binance API**, covering:
21//!
22//! - Spot trading (api.binance.com)
23//! - Spot margin trading
24//! - USD-M Futures (fapi.binance.com)
25//! - COIN-M Futures (dapi.binance.com)
26//! - European Options (eapi.binance.com)
27//!
28//! The official Binance API reference can be found at <https://binance-docs.github.io/apidocs/>.
29//!
30//! # NautilusTrader
31//!
32//! [NautilusTrader](https://nautilustrader.io) is an open-source, production-grade, Rust-native
33//! engine for multi-asset, multi-venue trading systems.
34//!
35//! The system spans research, deterministic simulation, and live execution within a single
36//! event-driven architecture, providing research-to-live semantic parity.
37//!
38//! # Feature Flags
39//!
40//! This crate provides feature flags to control source code inclusion during compilation,
41//! depending on the intended use case (Rust-only builds vs. Python bindings through PyO3).
42//!
43//! - `python`: Enables Python bindings via [PyO3](https://pyo3.rs).
44//! - `extension-module`: Builds as a Python extension module (used together with `python`).
45//!
46//! [High-precision mode](https://nautilustrader.io/docs/nightly/getting_started/installation#precision-mode) (128-bit value types) is enabled by default.
47//!
48//! # Documentation
49//!
50//! See <https://docs.rs/nautilus-binance> for the latest API documentation.
51
52#![warn(rustc::all)]
53#![deny(unsafe_code)]
54#![deny(nonstandard_style)]
55#![deny(missing_debug_implementations)]
56#![deny(clippy::missing_errors_doc)]
57#![deny(clippy::missing_panics_doc)]
58#![deny(rustdoc::broken_intra_doc_links)]
59
60pub mod arrow;
61pub mod common;
62pub mod config;
63pub mod factories;
64pub mod futures;
65pub mod spot;
66
67#[cfg(feature = "python")]
68pub mod python;