Skip to main content

nautilus_coinbase/
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) adapter for
17//! [Coinbase Advanced
18//! Trade](https://docs.cdp.coinbase.com/coinbase-app/advanced-trade-apis/overview).
19//!
20//! The `nautilus-coinbase` crate provides integration with the Coinbase Advanced Trade API for
21//! trading spot, futures, and perpetuals on the Coinbase exchange.
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//! - `examples`: Enables the crate's example binaries.
39//! - `extension-module`: Builds as a Python extension module.
40//! - `high-precision` (default): Enables
41//!   [high-precision mode](https://nautilustrader.io/docs/nightly/getting_started/installation/#precision-mode)
42//!   to use 128-bit value types.
43//! - `python`: Enables Python bindings from [PyO3](https://pyo3.rs).
44
45#![warn(rustc::all)]
46#![deny(unsafe_code)]
47#![deny(nonstandard_style)]
48#![deny(missing_debug_implementations)]
49// #![deny(clippy::missing_errors_doc)]
50#![deny(clippy::missing_panics_doc)]
51#![deny(rustdoc::broken_intra_doc_links)]
52// pyo3's `from_py_object` generates `.clone()` on `Copy` fields that clippy flags from the
53// macro expansion; an item-level `allow` cannot reach the expansion
54#![allow(clippy::clone_on_copy)]
55
56pub mod common;
57pub mod config;
58pub mod data;
59pub mod execution;
60pub mod factories;
61pub mod http;
62pub mod provider;
63pub mod websocket;
64
65#[cfg(feature = "python")]
66pub mod python;
67
68pub use crate::{
69    config::{CoinbaseDataClientConfig, CoinbaseExecutionClientConfig},
70    data::CoinbaseDataClient,
71    execution::CoinbaseExecutionClient,
72    factories::{CoinbaseDataClientFactory, CoinbaseExecutionClientFactory},
73    http::client::{CoinbaseHttpClient, CoinbaseRawHttpClient},
74    provider::CoinbaseInstrumentProvider,
75};