nautilus_live/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//! Live system node for [NautilusTrader](https://nautilustrader.io).
17//!
18//! The `nautilus-live` crate provides high-level abstractions and infrastructure for running live trading
19//! systems, including data streaming, execution management, and system lifecycle handling.
20//! It builds on top of the system kernel to provide simplified interfaces for live deployment:
21//!
22//! - `LiveNode` High-level abstraction for live system nodes.
23//! - `LiveNodeConfig` Configuration for live node deployment.
24//! - `AsyncRunner` for managing system real-time data flow.
25//!
26//! # NautilusTrader
27//!
28//! [NautilusTrader](https://nautilustrader.io) is an open-source, production-grade, Rust-native
29//! engine for multi-asset, multi-venue trading systems.
30//!
31//! The system spans research, deterministic simulation, and live execution within a single
32//! event-driven architecture, providing research-to-live semantic parity.
33//!
34//! # Feature Flags
35//!
36//! This crate provides feature flags to control source code inclusion during compilation,
37//! depending on the intended use case, i.e. whether to provide Python bindings
38//! for the [nautilus_trader](https://pypi.org/project/nautilus_trader) Python package,
39//! or as part of a Rust only build.
40//!
41//! - `node` (default): Enables the full live node, builder, config, and execution manager.
42//! - `ffi`: Enables the C foreign function interface (FFI) from [cbindgen](https://github.com/mozilla/cbindgen).
43//! - `streaming`: Enables `persistence` dependency for streaming configuration (requires `node`).
44//! - `python`: Enables Python bindings from [PyO3](https://pyo3.rs) (auto-enables `node` and `streaming`).
45//! - `defi`: Enables DeFi (Decentralized Finance) support.
46//! - `extension-module`: Builds the crate as a Python extension module.
47//!
48//! # Lean adapter builds
49//!
50//! Adapters and other consumers that only need the async event emitter, runner, and
51//! `ExecutionClientCore` re-export can opt out of the full kernel by disabling the
52//! `node` feature:
53//!
54//! ```toml
55//! nautilus-live = { workspace = true, default-features = false }
56//! ```
57//!
58//! With `node` disabled, this crate exposes only `emitter` and `runner`, and skips
59//! the transitive dependencies on `nautilus-system`, `nautilus-trading`,
60//! `nautilus-portfolio`, `nautilus-risk`, and `nautilus-data`.
61
62#![warn(rustc::all)]
63#![deny(unsafe_code)]
64#![deny(unsafe_op_in_unsafe_fn)]
65#![deny(nonstandard_style)]
66#![deny(missing_debug_implementations)]
67#![deny(clippy::missing_errors_doc)]
68#![deny(clippy::missing_panics_doc)]
69#![deny(rustdoc::broken_intra_doc_links)]
70
71pub mod emitter;
72pub mod runner;
73
74#[cfg(feature = "node")]
75pub mod builder;
76#[cfg(feature = "node")]
77pub mod config;
78#[cfg(feature = "node")]
79pub mod manager;
80#[cfg(feature = "node")]
81pub mod node;
82
83// Re-exports for adapters
84pub use emitter::ExecutionEventEmitter;
85pub use nautilus_common::factories::OrderEventFactory;
86pub use nautilus_execution::client::core::ExecutionClientCore;
87
88#[cfg(feature = "python")]
89pub mod python;