Skip to main content

nautilus_sandbox/
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) sandbox execution adapter.
17//!
18//! The `nautilus-sandbox` crate provides a simulated execution client that uses
19//! the `OrderMatchingEngine` to simulate order execution against live market data.
20//! This enables paper trading and strategy testing in real-time without actual
21//! order execution on exchanges.
22//!
23//! # NautilusTrader
24//!
25//! [NautilusTrader](https://nautilustrader.io) is an open-source, production-grade, Rust-native trading engine
26//! with a deterministic, event-driven architecture for multi-asset, multi-venue systems.
27//!
28//! The system spans research, simulation, and live execution, providing research-to-live semantic parity.
29//!
30//! # Feature Flags
31//!
32//! Feature flags control code inclusion for Rust builds and Python bindings:
33//!
34//! - `example-databento`: Enables the Databento example binary.
35//! - `extension-module`: Builds as a Python extension module.
36//! - `high-precision` (default): Enables
37//!   [high-precision mode](https://nautilustrader.io/docs/nightly/getting_started/installation/#precision-mode)
38//!   to use 128-bit value types.
39//! - `python`: Enables Python bindings from [PyO3](https://pyo3.rs).
40//!
41//! # Documentation
42//!
43//! - [Sandbox configuration](https://nautilustrader.io/docs/nightly/concepts/backtesting/trade-execution/#sandbox-configuration)
44//! - [Rust examples](https://github.com/nautechsystems/nautilus_trader/tree/develop/crates/adapters/sandbox/examples)
45//! - [Python examples](https://github.com/nautechsystems/nautilus_trader/tree/develop/examples/live/sandbox)
46
47#![warn(rustc::all)]
48#![deny(unsafe_code)]
49#![deny(nonstandard_style)]
50#![deny(missing_debug_implementations)]
51#![deny(clippy::missing_errors_doc)]
52#![deny(clippy::missing_panics_doc)]
53#![deny(rustdoc::broken_intra_doc_links)]
54
55pub mod config;
56pub mod execution;
57pub mod factory;
58
59#[cfg(feature = "python")]
60pub mod python;
61
62// Re-exports
63pub use crate::{
64    config::SandboxExecutionClientConfig, execution::SandboxExecutionClient,
65    factory::SandboxExecutionClientFactory,
66};