Skip to main content

nautilus_blockchain/
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//! Blockchain data adapter for [NautilusTrader](https://nautilustrader.io).
17//!
18//! The `nautilus-blockchain` crate provides a high-performance, universal, extensible adapter for ingesting
19//! DeFi data from decentralized exchanges (DEXs), liquidity pools, and on-chain events.
20//! It enables you to power analytics pipelines and trading strategies with real-time and historical
21//! on-chain data.
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, i.e. whether to provide Python bindings
35//! for the [nautilus_trader](https://pypi.org/project/nautilus_trader) Python package,
36//! or as part of a Rust only build.
37//!
38//! - `extension-module`: Builds as a Python extension module.
39//! - `hypersync`: Enables the
40//!   [`hypersync-client`](https://crates.io/crates/hypersync-client) integration.
41//! - `python`: Enables Python bindings from [PyO3](https://pyo3.rs).
42//! - `turmoil`: Enables deterministic network simulation testing with
43//!   [turmoil](https://crates.io/crates/turmoil).
44
45#![warn(rustc::all)]
46#![allow(
47    clippy::pedantic,
48    reason = "shield the CLI --all-features pedantic gate until the blockchain slice migrates"
49)]
50#![deny(unsafe_code)]
51#![deny(nonstandard_style)]
52#![deny(missing_debug_implementations)]
53#![deny(clippy::missing_errors_doc)]
54#![deny(clippy::missing_panics_doc)]
55#![deny(rustdoc::broken_intra_doc_links)]
56#![allow(
57    clippy::assert_is_empty,
58    reason = "`assert!(x.is_empty())` is clearer than comparing against an empty value"
59)]
60
61pub mod config;
62pub mod constants;
63pub mod contracts;
64pub mod decode;
65pub mod events;
66pub mod math;
67pub mod reporting;
68pub mod rpc;
69
70#[cfg(feature = "hypersync")]
71pub mod cache;
72
73#[cfg(feature = "hypersync")]
74pub mod execution;
75
76#[cfg(feature = "hypersync")]
77pub mod data;
78
79#[cfg(feature = "hypersync")]
80pub mod exchanges;
81
82#[cfg(feature = "hypersync")]
83pub mod factories;
84
85#[cfg(feature = "hypersync")]
86pub mod hypersync;
87
88#[cfg(feature = "hypersync")]
89pub mod services;
90
91#[cfg(feature = "python")]
92pub mod python;