Skip to main content

nautilus_deribit/
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 [Deribit](https://www.deribit.com) cryptocurrency exchange.
17//!
18//! The `nautilus-deribit` crate provides client bindings (HTTP & WebSocket) and data
19//! models for the official **Deribit API v2**.
20//!
21//! Deribit uses JSON-RPC 2.0 over both HTTP and WebSocket transports (not REST).
22//! WebSocket is preferred for subscriptions and real-time data.
23//!
24//! The official Deribit API reference can be found at <https://docs.deribit.com/>.
25//!
26//! # NautilusTrader
27//!
28//! [NautilusTrader](https://nautilustrader.io) is an open-source, production-grade, Rust-native
29//! engine for multi-asset, multi-venue trading systems.
30//!
31//! The system spans research, deterministic simulation, and live execution within a single
32//! event-driven architecture, providing research-to-live semantic parity.
33//!
34//! # Feature Flags
35//!
36//! This crate provides feature flags to control source code inclusion during compilation,
37//! depending on the intended use case, i.e. whether to provide Python bindings
38//! for the [nautilus_trader](https://pypi.org/project/nautilus_trader) Python package,
39//! or as part of a Rust only build.
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` (default): 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#![warn(rustc::all)]
50#![deny(unsafe_code)]
51#![deny(nonstandard_style)]
52#![deny(missing_debug_implementations)]
53#![deny(clippy::missing_errors_doc)]
54#![deny(clippy::missing_panics_doc)]
55#![deny(rustdoc::broken_intra_doc_links)]
56// pyo3's `from_py_object` generates `.clone()` on `Copy` fields that clippy flags from the
57// macro expansion; an item-level `allow` cannot reach the expansion
58#![allow(clippy::clone_on_copy)]
59
60pub mod common;
61pub mod config;
62pub mod data;
63pub mod data_types;
64pub mod execution;
65pub mod factories;
66pub mod http;
67pub mod websocket;
68
69#[cfg(feature = "python")]
70pub mod python;