nautilus_finfeed/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//! [FinFeedAPI Prediction Markets API](https://www.finfeedapi.com/products/prediction-markets-api?ref=nautilus),
18//! provided by API Bricks.
19//!
20//! This crate provides authenticated REST access, checked Polymarket binary Yes/No instrument
21//! definitions, historical data requests, and book, quote, trade, and closed-bar polling.
22//! Order execution is unsupported.
23//! Importing the Python package neither reads credentials nor connects.
24//!
25//! [`http::client::FinFeedHttpClient`] returns typed provider results.
26//! [`data::FinFeedDataClient`] uses explicit instrument selections and shares a finite request
27//! allowance across bootstrap, history, polling, and retries. Polling provides no completeness or
28//! automatic backfill guarantee. Historical L2 market-by-price (MBP) replay requires a returned
29//! snapshot seed and relies on source action and continuity assumptions. OHLCV `LAST` does not
30//! establish trade-only prices, and no authoritative settlement event is inferred.
31//!
32//! [`loaders::FinFeedDataLoader`] retrieves historical data with retained instrument definitions.
33//! Optional Python bindings expose provider identity, configuration, factories, the standalone data
34//! loader, and read-only REST access with typed queries and results.
35//!
36//! The official FinFeedAPI API reference can be found at
37//! <https://www.finfeedapi.com/products/prediction-markets-api/docs?ref=nautilus>.
38//!
39//! # NautilusTrader
40//!
41//! [NautilusTrader](https://nautilustrader.io) is an open-source, production-grade, Rust-native trading engine
42//! with a deterministic, event-driven architecture for multi-asset, multi-venue systems.
43//!
44//! The system spans research, simulation, and live execution, providing research-to-live semantic parity.
45//!
46//! # Feature Flags
47//!
48//! Feature flags control code inclusion for Rust builds and Python bindings:
49//!
50//! - `extension-module`: Builds as a Python extension module.
51//! - `fuzz`: Enables the REST decoder and domain conversion libFuzzer target.
52//! - `high-precision` (default): Enables
53//! [high-precision mode](https://nautilustrader.io/docs/nightly/getting_started/installation/#precision-mode)
54//! to use 128-bit value types.
55//! - `python`: Enables Python bindings for identity, configuration, factories, the standalone data
56//! loader, and read-only REST access with typed queries and results through [PyO3](https://pyo3.rs).
57//! - `simulation`: Routes time and HTTP transport through deterministic simulation with `cfg(madsim)`.
58//! Simulated transport supports plaintext local peers; HTTPS and explicit proxies require native tests.
59//!
60//! # Integrator Attribution
61//!
62//! REST requests send `X-Referrer: nautilus` for API Bricks usage attribution.
63//! The fixed header contains no credential or account data.
64//!
65//! See [attribution details](https://nautilustrader.io/docs/nightly/integrations/finfeed/#integrator-attribution).
66//!
67//! # Documentation
68//!
69//! - [Integration guide](https://nautilustrader.io/docs/nightly/integrations/finfeed/)
70//! - [Rust examples](https://github.com/nautechsystems/nautilus_trader/tree/develop/crates/adapters/finfeed/examples)
71//! - [Python examples](https://github.com/nautechsystems/nautilus_trader/tree/develop/examples/live/finfeed)
72
73#![warn(rustc::all)]
74#![deny(unsafe_code)]
75#![deny(nonstandard_style)]
76#![deny(missing_debug_implementations)]
77#![deny(clippy::missing_errors_doc)]
78#![deny(clippy::missing_panics_doc)]
79#![deny(rustdoc::broken_intra_doc_links)]
80
81pub mod common;
82pub mod config;
83pub mod data;
84pub mod factories;
85pub mod http;
86pub mod instruments;
87pub mod loaders;
88
89mod book;
90mod history;
91mod parse;
92
93#[cfg(feature = "python")]
94pub mod python;