nautilus_coinapi/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 the
17//! [CoinAPI Market Data API](https://www.coinapi.io/products/market-data-api?ref=nautilus),
18//! provided by API Bricks.
19//!
20//! This crate provides authenticated REST and WebSocket access, native venue instrument definitions,
21//! live market data, historical requests, and loaders for downloaded flat files.
22//! Order execution and account management are unsupported.
23//!
24//! [`http::client::CoinApiHttpClient`] returns typed provider results, and
25//! [`websocket::client::CoinApiWebSocketClient`] exposes raw market-data streams.
26//! [`data::CoinApiDataClient`] uses explicit instrument selections and shares a finite lifetime REST
27//! credit allowance across all REST requests, including retries. Metadata and current book snapshots
28//! cost one credit per attempt. Historical requests can return truncated results when that allowance
29//! runs out. CoinAPI and native adapters must load disjoint instrument sets within a node; separate
30//! client IDs do not isolate definitions or feeds.
31//!
32//! L2 market-by-price (MBP) and L3 market-by-order (MBO) deltas include snapshot gating and sequence
33//! gap recovery. Every book subscription shares one WebSocket book channel; L3 requires individual
34//! order IDs. Bars publish when a later period arrives, and reconnects discard retained periods to
35//! avoid incomplete bars. Historical book snapshots are unsupported.
36//!
37//! [`loaders::CoinApiDataLoader`] loads local exports and historical REST data with retained metadata.
38//! Optional Python bindings expose provider identity, configuration, factories, and the standalone data loader.
39//!
40//! The official CoinAPI API reference can be found at <https://www.coinapi.io/products/market-data-api/docs?ref=nautilus>.
41//!
42//! # NautilusTrader
43//!
44//! [NautilusTrader](https://nautilustrader.io) is an open-source, production-grade, Rust-native trading engine
45//! with a deterministic, event-driven architecture for multi-asset, multi-venue systems.
46//!
47//! The system spans research, simulation, and live execution, providing research-to-live semantic parity.
48//!
49//! # Feature Flags
50//!
51//! Feature flags control code inclusion for Rust builds and Python bindings:
52//!
53//! - `examples`: Enables the crate's example binaries.
54//! - `extension-module`: Builds as a Python extension module.
55//! - `fuzz`: Enables libFuzzer integration for fuzz targets.
56//! - `high-precision` (default): Enables
57//! [high-precision mode](https://nautilustrader.io/docs/nightly/getting_started/installation/#precision-mode)
58//! to use 128-bit value types.
59//! - `python`: Enables Python bindings for identity, configuration, factories, and the standalone data loader
60//! through [PyO3](https://pyo3.rs).
61//! - `simulation`: Routes HTTP and WebSocket through deterministic transport when built with
62//! `cfg(madsim)`.
63//!
64//! # Integrator Attribution
65//!
66//! REST requests and WebSocket handshakes include `X-Referrer: nautilus` for API Bricks usage attribution.
67//! The fixed header contains no credential or account data.
68//!
69//! See [attribution details](https://nautilustrader.io/docs/nightly/integrations/coinapi/#integrator-attribution).
70//!
71//! # Documentation
72//!
73//! - [Integration guide](https://nautilustrader.io/docs/nightly/integrations/coinapi/)
74//! - [Rust examples](https://github.com/nautechsystems/nautilus_trader/tree/develop/crates/adapters/coinapi/examples)
75//! - [Python examples](https://github.com/nautechsystems/nautilus_trader/tree/develop/examples/live/coinapi)
76
77#![warn(rustc::all)]
78#![deny(unsafe_code)]
79#![deny(nonstandard_style)]
80#![deny(missing_debug_implementations)]
81#![deny(clippy::missing_errors_doc)]
82#![deny(clippy::missing_panics_doc)]
83#![deny(rustdoc::broken_intra_doc_links)]
84
85pub mod book;
86pub mod common;
87pub mod config;
88pub mod data;
89pub mod factories;
90pub mod http;
91pub mod loaders;
92pub mod websocket;
93
94mod csv;
95
96#[cfg(feature = "python")]
97pub mod python;