Skip to main content

nautilus_data/
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//! Data engine and market data processing for [NautilusTrader](https://nautilustrader.io).
17//!
18//! The `nautilus-data` crate provides a framework for handling market data ingestion,
19//! processing, and aggregation within the NautilusTrader ecosystem. This includes real-time
20//! data streaming, historical data management, and various aggregation methodologies:
21//!
22//! - High-performance data engine for orchestrating data operations.
23//! - Data client infrastructure for connecting to market data providers.
24//! - Bar aggregation machinery supporting tick, volume, value, and time-based aggregation.
25//! - Order book management and delta processing capabilities.
26//! - Subscription management and data request handling.
27//! - Configurable data routing and processing pipelines.
28//!
29//! # NautilusTrader
30//!
31//! [NautilusTrader](https://nautilustrader.io) is an open-source, production-grade, Rust-native
32//! engine for multi-asset, multi-venue trading systems.
33//!
34//! The system spans research, deterministic simulation, and live execution within a single
35//! event-driven architecture, providing research-to-live semantic parity.
36//!
37//! # Feature Flags
38//!
39//! This crate provides feature flags to control source code inclusion during compilation,
40//! depending on the intended use case, i.e. whether to provide Python bindings
41//! for the [nautilus_trader](https://pypi.org/project/nautilus_trader) Python package,
42//! or as part of a Rust only build.
43//!
44//! - `ffi`: Enables the C foreign function interface (FFI) from [cbindgen](https://github.com/mozilla/cbindgen).
45//! - `high-precision`: Enables [high-precision mode](https://nautilustrader.io/docs/nightly/getting_started/installation#precision-mode) to use 128-bit value types.
46//! - `streaming`: Enables `persistence` dependency for catalog-based data streaming.
47//! - `defi`: Enables DeFi (Decentralized Finance) support.
48
49#![warn(rustc::all)]
50#![deny(unsafe_code)]
51#![deny(unsafe_op_in_unsafe_fn)]
52#![deny(nonstandard_style)]
53#![deny(missing_debug_implementations)]
54#![deny(clippy::missing_errors_doc)]
55#![deny(clippy::missing_panics_doc)]
56#![deny(rustdoc::broken_intra_doc_links)]
57
58pub mod aggregation;
59pub mod client;
60pub mod engine;
61pub mod option_chains;
62
63#[cfg(feature = "python")]
64pub mod python;
65
66#[cfg(feature = "defi")]
67pub mod defi;
68
69// Re-exports
70pub use aggregation::{
71    FixedTickSchemeRounder, MapVegaProvider, SpreadPriceRounder, SpreadQuoteAggregator,
72    VegaProvider,
73};
74pub use client::DataClientAdapter;