nautilus_interactive_brokers/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
17//! [Interactive Brokers](https://www.interactivebrokers.com).
18//!
19//! The `nautilus-interactive-brokers` crate wraps the [`ibapi`](https://crates.io/crates/ibapi)
20//! client and connects it to NautilusTrader's live data, execution, historical data, and
21//! instrument loading infrastructure.
22//!
23//! # NautilusTrader
24//!
25//! [NautilusTrader](https://nautilustrader.io) is an open-source, production-grade, Rust-native
26//! engine for multi-asset, multi-venue trading systems.
27//!
28//! The system spans research, deterministic simulation, and live execution within a single
29//! event-driven architecture, providing research-to-live semantic parity.
30//!
31//! # Feature flags
32//!
33//! This crate provides feature flags to control source code inclusion during compilation,
34//! depending on the intended use case (Rust-only builds vs. Python bindings through PyO3).
35//!
36//! - `python`: Enables PyO3 bindings for configs, enums, the historical client, the instrument
37//! provider, and the Dockerized gateway helper.
38//! - `gateway`: Enables the Dockerized IB Gateway helper via [`bollard`](https://crates.io/crates/bollard).
39//! - `extension-module`: Builds as a Python extension module (used together with `python` and `gateway`).
40//!
41//! # Documentation
42//!
43//! See <https://docs.rs/nautilus-interactive-brokers> for the latest API documentation.
44
45#![warn(rustc::all)]
46#![deny(unsafe_code)]
47// Clippy: allow style lints that would require large refactors across the adapter
48#![allow(
49 clippy::collapsible_if,
50 clippy::if_not_else,
51 clippy::uninlined_format_args,
52 clippy::map_unwrap_or,
53 clippy::redundant_clone,
54 clippy::ignored_unit_patterns,
55 clippy::items_after_statements,
56 clippy::bool_to_int_with_if,
57 clippy::cloned_instead_of_copied,
58 clippy::option_if_let_else,
59 clippy::type_complexity,
60 clippy::await_holding_lock,
61 clippy::module_inception,
62 clippy::result_large_err,
63 clippy::implicit_clone,
64 clippy::single_char_pattern,
65 clippy::bind_instead_of_map,
66 clippy::explicit_iter_loop,
67 clippy::too_many_arguments,
68 clippy::missing_errors_doc,
69 clippy::doc_overindented_list_items,
70 clippy::needless_borrows_for_generic_args
71)]
72#![deny(nonstandard_style)]
73#![deny(missing_debug_implementations)]
74#![deny(clippy::missing_panics_doc)]
75#![deny(rustdoc::broken_intra_doc_links)]
76
77pub mod common;
78pub mod config;
79pub mod data;
80pub mod error;
81pub mod execution;
82pub mod factories;
83pub mod gateway;
84pub mod historical;
85pub mod providers;
86
87#[cfg(feature = "python")]
88pub mod python;