nautilus_binance/
lib.rs

1// -------------------------------------------------------------------------------------------------
2//  Copyright (C) 2015-2025 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](http://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//! # Platform
31//!
32//! [NautilusTrader](http://nautilustrader.io) is an open-source, high-performance, production-grade
33//! algorithmic trading platform, providing quantitative traders with the ability to backtest
34//! portfolios of automated trading strategies on historical data with an event-driven engine,
35//! and also deploy those same strategies live, with no code changes.
36//!
37//! NautilusTrader's design, architecture, and implementation philosophy prioritizes software
38//! correctness and safety at the highest level, with the aim of supporting mission-critical
39//! trading system backtesting and live deployment workloads.
40//!
41//! # Feature flags
42//!
43//! This crate provides feature flags to control source code inclusion during compilation,
44//! depending on the intended use case (Rust-only builds vs. Python bindings through PyO3).
45//!
46//! - `python`: Enables Python bindings via [PyO3](https://pyo3.rs).
47//! - `extension-module`: Builds as a Python extension module (used together with `python`).
48//!
49//! # Documentation
50//!
51//! See <https://docs.rs/nautilus-binance> for the latest API documentation.
52
53#![warn(rustc::all)]
54#![deny(unsafe_code)]
55#![deny(nonstandard_style)]
56#![deny(missing_debug_implementations)]
57// #![deny(clippy::missing_errors_doc)]
58#![deny(clippy::missing_panics_doc)]
59#![deny(rustdoc::broken_intra_doc_links)]
60
61pub mod common;
62pub mod config;
63pub mod data;
64pub mod error;
65pub mod execution;
66pub mod http;
67pub mod spot;
68pub mod websocket;
69
70#[cfg(feature = "python")]
71pub mod python;