Skip to main content

nautilus_betfair/
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 [Betfair](https://www.betfair.com) betting exchange.
17//!
18//! The `nautilus-betfair` crate connects Betfair market data and order execution to NautilusTrader.
19//! It includes REST and streaming clients, instrument discovery, and historical file loading for
20//! backtesting, with shared protocol models and live-node factories.
21//!
22//! The official Betfair API reference can be found at <https://docs.developer.betfair.com/>.
23//!
24//! # NautilusTrader
25//!
26//! [NautilusTrader](https://nautilustrader.io) is an open-source, production-grade, Rust-native trading engine
27//! with a deterministic, event-driven architecture for multi-asset, multi-venue systems.
28//!
29//! The system spans research, simulation, and live execution, providing research-to-live semantic parity.
30//!
31//! # Naming Conventions
32//!
33//! Betfair's API uses British English spelling. This crate preserves those
34//! spellings in type names, method strings, and fixture files, e.g.
35//! `MarketCatalogue` / `listMarketCatalogue`, not "catalog".
36//!
37//! # Feature Flags
38//!
39//! Feature flags control code inclusion for Rust builds and Python bindings:
40//!
41//! - `arrow`: Enables Apache Arrow data support.
42//! - `examples`: Enables the crate's example binaries.
43//! - `extension-module`: Builds as a Python extension module.
44//! - `high-precision`: Enables
45//!   [high-precision mode](https://nautilustrader.io/docs/nightly/getting_started/installation/#precision-mode)
46//!   to use 128-bit value types.
47//! - `python`: Enables Python bindings from [PyO3](https://pyo3.rs).
48//!
49//! # Documentation
50//!
51//! - [Integration guide](https://nautilustrader.io/docs/nightly/integrations/betfair/)
52//! - [Rust examples](https://github.com/nautechsystems/nautilus_trader/tree/develop/crates/adapters/betfair/examples)
53//! - [Python examples](https://github.com/nautechsystems/nautilus_trader/tree/develop/examples/live/betfair)
54
55#![warn(rustc::all)]
56#![deny(unsafe_code)]
57#![deny(nonstandard_style)]
58#![deny(missing_debug_implementations)]
59#![deny(clippy::missing_errors_doc)]
60#![deny(clippy::missing_panics_doc)]
61#![deny(rustdoc::broken_intra_doc_links)]
62
63pub mod common;
64pub mod config;
65pub mod data;
66pub mod data_types;
67pub mod execution;
68pub mod factories;
69pub mod http;
70pub mod loader;
71pub mod provider;
72pub mod stream;
73
74pub(crate) mod book;
75
76#[cfg(feature = "python")]
77pub mod python;