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 Trade.
18//!
19//! The `nautilus-coinbase` crate provides instrument loading, live market data, and order execution for
20//! spot, futures, and perpetuals through the **Coinbase Advanced Trade API**. It includes authenticated
21//! HTTP and WebSocket clients, live-node factories, and optional Python bindings.
22//!
23//! The official Coinbase Advanced Trade API reference can be found at
24//! <https://docs.cdp.coinbase.com/coinbase-app/advanced-trade-apis/overview>.
25//!
26//! # NautilusTrader
27//!
28//! [NautilusTrader](https://nautilustrader.io) is an open-source, production-grade, Rust-native trading engine
29//! with a deterministic, event-driven architecture for multi-asset, multi-venue systems.
30//!
31//! The system spans research, simulation, and live execution, providing research-to-live semantic parity.
32//!
33//! # Feature Flags
34//!
35//! Feature flags control code inclusion for Rust builds and Python bindings:
36//!
37//! - `examples`: Enables the crate's example binaries.
38//! - `extension-module`: Builds as a Python extension module.
39//! - `high-precision` (default): Enables
40//!   [high-precision mode](https://nautilustrader.io/docs/nightly/getting_started/installation/#precision-mode)
41//!   to use 128-bit value types.
42//! - `python`: Enables Python bindings from [PyO3](https://pyo3.rs).
43//!
44//! # Documentation
45//!
46//! - [Integration guide](https://nautilustrader.io/docs/nightly/integrations/coinbase/)
47//! - [Rust examples](https://github.com/nautechsystems/nautilus_trader/tree/develop/crates/adapters/coinbase/examples)
48//! - [Python examples](https://github.com/nautechsystems/nautilus_trader/tree/develop/examples/live/coinbase)
49
50#![warn(rustc::all)]
51#![deny(unsafe_code)]
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// pyo3's `from_py_object` generates `.clone()` on `Copy` fields that clippy flags from the
58// macro expansion; an item-level `allow` cannot reach the expansion
59#![allow(clippy::clone_on_copy)]
60
61pub mod common;
62pub mod config;
63pub mod data;
64pub mod execution;
65pub mod factories;
66pub mod http;
67pub mod provider;
68pub mod websocket;
69
70mod book;
71
72#[cfg(feature = "python")]
73pub mod python;
74
75pub use crate::{
76    config::{CoinbaseDataClientConfig, CoinbaseExecutionClientConfig},
77    data::CoinbaseDataClient,
78    execution::CoinbaseExecutionClient,
79    factories::{CoinbaseDataClientFactory, CoinbaseExecutionClientFactory},
80    http::client::{CoinbaseHttpClient, CoinbaseRawHttpClient},
81    provider::CoinbaseInstrumentProvider,
82};