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 live market data, historical requests, and order execution for
19//! options, futures, perpetuals, spot, and combo instruments. It includes typed HTTP and WebSocket
20//! clients, instrument loading, and live-node factories for the **Deribit API v2**.
21//!
22//! Deribit uses JSON-RPC 2.0 over both HTTP and WebSocket transports (not REST).
23//! WebSocket is preferred for subscriptions and real-time data.
24//!
25//! The official Deribit API reference can be found at <https://docs.deribit.com/>.
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//! # Documentation
47//!
48//! - [Integration guide](https://nautilustrader.io/docs/nightly/integrations/deribit/)
49//! - [Rust examples](https://github.com/nautechsystems/nautilus_trader/tree/develop/crates/adapters/deribit/examples)
50//! - [Python examples](https://github.com/nautechsystems/nautilus_trader/tree/develop/examples/live/deribit)
51
52#![warn(rustc::all)]
53#![deny(unsafe_code)]
54#![deny(nonstandard_style)]
55#![deny(missing_debug_implementations)]
56#![deny(clippy::missing_errors_doc)]
57#![deny(clippy::missing_panics_doc)]
58#![deny(rustdoc::broken_intra_doc_links)]
59// pyo3's `from_py_object` generates `.clone()` on `Copy` fields that clippy flags from the
60// macro expansion; an item-level `allow` cannot reach the expansion
61#![allow(clippy::clone_on_copy)]
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 websocket;
71
72mod book;
73
74#[cfg(feature = "python")]
75pub mod python;