nautilus_blockchain/lib.rs
1// -------------------------------------------------------------------------------------------------
2// Copyright (C) 2015-2025 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](http://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//! # Platform
24//!
25//! [NautilusTrader](http://nautilustrader.io) is an open-source, high-performance, production-grade
26//! algorithmic trading platform, providing quantitative traders with the ability to backtest
27//! portfolios of automated trading strategies on historical data with an event-driven engine,
28//! and also deploy those same strategies live, with no code changes.
29//!
30//! # Feature flags
31//!
32//! This crate provides feature flags to control source code inclusion during compilation,
33//! depending on the intended use case, i.e. whether to provide Python bindings
34//! for the [nautilus_trader](https://pypi.org/project/nautilus_trader) Python package,
35//! or as part of a Rust only build.
36//!
37//! - `hypersync`: Enables the [HyperSync](https://envio.dev/#hypersync) client integration.
38//! - `python`: Enables Python bindings from [PyO3](https://pyo3.rs).
39//! - `extension-module`: Builds as a Python extension module (used with `python`).
40
41#![warn(rustc::all)]
42#![deny(unsafe_code)]
43#![deny(nonstandard_style)]
44#![deny(missing_debug_implementations)]
45#![deny(clippy::missing_errors_doc)]
46#![deny(clippy::missing_panics_doc)]
47#![deny(rustdoc::broken_intra_doc_links)]
48
49pub mod config;
50pub mod contracts;
51pub mod decode;
52pub mod events;
53pub mod math;
54pub mod rpc;
55
56#[cfg(feature = "hypersync")]
57pub mod cache;
58
59#[cfg(feature = "hypersync")]
60pub mod data;
61
62#[cfg(feature = "hypersync")]
63pub mod exchanges;
64
65#[cfg(feature = "hypersync")]
66pub mod factories;
67
68#[cfg(feature = "hypersync")]
69pub mod hypersync;
70
71#[cfg(feature = "hypersync")]
72pub mod reporting;
73
74#[cfg(feature = "python")]
75pub mod python;