Skip to main content

nautilus_kraken/
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//! Kraken exchange adapter for NautilusTrader.
17//!
18//! This adapter provides integration with the Kraken cryptocurrency exchange,
19//! supporting both Spot and Futures markets.
20//!
21//! # Features
22//!
23//! - REST API v2 client for market data and account operations.
24//! - WebSocket v2 client for real-time data feeds.
25//! - Support for Spot and Futures markets.
26//! - Instrument, ticker, trade, orderbook, and OHLC data.
27//! - Prepared for execution support (orders, positions, balances).
28//!
29//! # API Documentation
30//!
31//! - [Kraken REST API](https://docs.kraken.com/api/)
32//! - [Kraken WebSocket v2](https://docs.kraken.com/websockets-v2/)
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//! - `python`: Enables Python bindings from [PyO3](https://pyo3.rs).
42//! - `extension-module`: Builds as a Python extension module.
43//!
44//! [High-precision mode](https://nautilustrader.io/docs/nightly/getting_started/installation#precision-mode) (128-bit value types) is enabled by default.
45
46// pyo3's `from_py_object` generates `.clone()` on `Copy` fields that clippy flags from the
47// macro expansion; an item-level `allow` cannot reach the expansion
48#![allow(clippy::clone_on_copy)]
49
50pub mod common;
51pub mod config;
52pub mod data;
53pub mod execution;
54pub mod factories;
55pub mod http;
56pub mod websocket;
57
58#[cfg(feature = "python")]
59pub mod python;
60
61pub use config::{KrakenDataClientConfig, KrakenExecutionClientConfig};
62pub use data::{KrakenFuturesDataClient, KrakenSpotDataClient};
63pub use execution::{KrakenFuturesExecutionClient, KrakenSpotExecutionClient};
64pub use http::{
65    KrakenFuturesHttpClient, KrakenFuturesRawHttpClient, KrakenHttpError, KrakenSpotHttpClient,
66    KrakenSpotRawHttpClient,
67};
68pub use websocket::{
69    futures::client::KrakenFuturesWebSocketClient, spot_v2::client::KrakenSpotWebSocketClient,
70};