nautilus_hyperliquid/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 Hyperliquid decentralized exchange.
17//!
18//! The `nautilus-hyperliquid` crate provides integration with the Hyperliquid API for
19//! market data and trading in perpetual futures, HIP-3 builder-deployed perpetuals, spot markets,
20//! and experimental HIP-4 outcome markets. The integration guide's
21//! [product support table](https://nautilustrader.io/docs/nightly/integrations/hyperliquid/#product-support)
22//! defines support levels and validation limits.
23//!
24//! The official Hyperliquid API reference can be found at
25//! <https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api>.
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//! Mainnet orders include NautilusTrader's builder address at a zero fee rate by default.
49//! These orders require a one-time builder-fee approval. Testnet and vault orders omit the builder.
50//!
51//! See [attribution details](https://nautilustrader.io/docs/nightly/integrations/hyperliquid/#builder-code-attribution).
52//!
53//! # Documentation
54//!
55//! - [Integration guide](https://nautilustrader.io/docs/nightly/integrations/hyperliquid/)
56//! - [Rust examples](https://github.com/nautechsystems/nautilus_trader/tree/develop/crates/adapters/hyperliquid/examples)
57//! - [Python examples](https://github.com/nautechsystems/nautilus_trader/tree/develop/examples/live/hyperliquid)
58
59#![warn(rustc::all)]
60#![deny(unsafe_code)]
61#![deny(nonstandard_style)]
62#![deny(missing_debug_implementations)]
63// #![deny(clippy::missing_errors_doc)]
64#![deny(clippy::missing_panics_doc)]
65#![deny(rustdoc::broken_intra_doc_links)]
66// pyo3's `from_py_object` generates `.clone()` on `Copy` fields that clippy flags from the
67// macro expansion; an item-level `allow` cannot reach the expansion
68#![allow(clippy::clone_on_copy)]
69
70pub mod account;
71pub mod common;
72pub mod config;
73pub mod data;
74pub mod data_types;
75pub mod execution;
76pub mod factories;
77pub mod http;
78pub mod outcome_settlement;
79pub mod signing;
80pub mod websocket;
81
82mod book;
83
84#[cfg(feature = "python")]
85pub mod python;
86
87pub use crate::{
88 config::{HyperliquidDataClientConfig, HyperliquidExecutionClientConfig},
89 data::HyperliquidDataClient,
90 execution::HyperliquidExecutionClient,
91 factories::{HyperliquidDataClientFactory, HyperliquidExecutionClientFactory},
92 http::client::HyperliquidHttpClient,
93 websocket::client::HyperliquidWebSocketClient,
94};