nautilus_bybit/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//! [Bybit](https://www.bybit.com) cryptocurrency exchange.
18//!
19//! The `nautilus-bybit` crate provides instrument loading, live market data, and order execution for
20//! Bybit's spot, futures, perpetual, and options markets. It includes typed HTTP and WebSocket clients
21//! for the **Bybit v5 API**, with live-node factories and optional Python bindings.
22//!
23//! All public links inside this crate reference the English version of the documentation.
24//!
25//! The official Bybit API reference can be found at <https://bybit-exchange.github.io/docs/v5/intro>.
26//!
27//! # NautilusTrader
28//!
29//! [NautilusTrader](https://nautilustrader.io) is an open-source, production-grade, Rust-native trading engine
30//! with a deterministic, event-driven architecture for multi-asset, multi-venue systems.
31//!
32//! The system spans research, simulation, and live execution, providing research-to-live semantic parity.
33//!
34//! # Feature Flags
35//!
36//! Feature flags control code inclusion for Rust builds and Python bindings:
37//!
38//! - `arrow`: Enables Apache Arrow data support.
39//! - `examples`: Enables the crate's example binaries.
40//! - `extension-module`: Builds as a Python extension module.
41//! - `high-precision` (default): Enables
42//! [high-precision mode](https://nautilustrader.io/docs/nightly/getting_started/installation/#precision-mode)
43//! to use 128-bit value types.
44//! - `python`: Enables Python bindings from [PyO3](https://pyo3.rs).
45//!
46//! # Integrator Attribution
47//!
48//! HTTP requests use `X-Referer`, and WebSocket orders use `Referer`, for NautilusTrader's integration ID.
49//! Post-only orders omit attribution when background detection identifies the account as a market maker.
50//!
51//! # Documentation
52//!
53//! - [Integration guide](https://nautilustrader.io/docs/nightly/integrations/bybit/)
54//! - [Rust examples](https://github.com/nautechsystems/nautilus_trader/tree/develop/crates/adapters/bybit/examples)
55//! - [Python examples](https://github.com/nautechsystems/nautilus_trader/tree/develop/examples/live/bybit)
56
57#![warn(rustc::all)]
58#![deny(unsafe_code)]
59#![deny(nonstandard_style)]
60#![deny(missing_debug_implementations)]
61// #![deny(clippy::missing_errors_doc)]
62#![deny(clippy::missing_panics_doc)]
63#![deny(rustdoc::broken_intra_doc_links)]
64// pyo3's `from_py_object` generates `.clone()` on `Copy` fields that clippy flags from the
65// macro expansion; an item-level `allow` cannot reach the expansion
66#![allow(clippy::clone_on_copy)]
67
68pub mod common;
69pub mod config;
70pub mod data;
71pub mod data_types;
72pub mod execution;
73pub mod factories;
74pub mod http;
75pub mod websocket;
76
77pub(crate) mod book;
78pub(crate) mod repay;
79
80#[cfg(feature = "python")]
81pub mod python;