Skip to main content

polar_bear_hft_crypto/
lib.rs

1//! # polar-bear-hft-crypto
2//!
3//! Cryptographic signing layer for high-frequency trading.
4//!
5//! ## Architecture
6//!
7//! ```text
8//! ┌─────────────────────────────────────────────────────────────┐
9//! │                    polar-bear-hft-crypto                    │
10//! ├─────────────────────────────────────────────────────────────┤
11//! │  crypto::ecdsa      ECDSA / secp256k1  (k256 crate)        │
12//! │  crypto::ed25519    Ed25519 / Twisted Edwards               │
13//! ├─────────────────────────────────────────────────────────────┤
14//! │  exchange::binance  HMAC-SHA256 REST + WebSocket auth       │
15//! │  exchange::kraken   HMAC-SHA512 + nonce                     │
16//! │  exchange::okx      HMAC-SHA256 + ISO-8601 timestamp        │
17//! │  exchange::bybit    HMAC-SHA256 + recv-window               │
18//! │  exchange::coinbase HMAC-SHA256 (Advanced Trade API)        │
19//! │  exchange::kucoin   HMAC-SHA256 + base64 + passphrase       │
20//! │  exchange::hyperliquid  Ed25519 L1 action signing           │
21//! ├─────────────────────────────────────────────────────────────┤
22//! │  agent::hft_agent   rig-core AI agent (feature = ai-agent) │
23//! └─────────────────────────────────────────────────────────────┘
24//! ```
25//!
26//! ## Usage
27//!
28//! ```rust,no_run
29//! use polar_bear_hft_crypto::crypto::ecdsa::EcdsaSigner;
30//! use polar_bear_hft_crypto::exchange::binance::BinanceAuth;
31//!
32//! let signer = EcdsaSigner::generate();
33//! let pubkey_hex = signer.verifying_key_hex();
34//! println!("Public key: {pubkey_hex}");
35//! ```
36
37pub mod crypto;
38pub mod exchange;
39
40#[cfg(feature = "ai-agent")]
41pub mod agent;