Build Trading Systems That Scale
Havklo is a high-performance Rust SDK for Kraken’s WebSocket APIs. Designed for algorithmic trading, market making, and real-time data streaming with sub-microsecond orderbook operations. The architecture decouples core market logic from the networking layer, allowing the orderbook engine to compile to WebAssembly. The same validation logic powering high-frequency backends runs with near-native performance in web browsers.Quick Start
Stream your first orderbook in under 5 minutes
Architecture
Understand the modular design enabling native + WASM builds
API Reference
Complete documentation for KrakenClient
Examples
11 runnable examples covering common scenarios
Live Demos
These applications run entirely client-side, powered by the WASM-compiled orderbook engine:| Application | Description | Link |
|---|---|---|
| Havsyn | Real-time L2 Orderbook Visualizer | havsyn.vercel.app |
| Havdepth | Cumulative Depth Charting | havdepth.vercel.app |
| Havflow | Order Flow Imbalance Analyzer | havflow.vercel.app |
| Havnet | Multi-Symbol Dashboard | havnet.vercel.app |
| Havwatch | Price Alert System | GitHub |
Why Havklo?
Sub-us Performance
Best bid lookup in 1 nanosecond. Delta updates in 100 nanoseconds.
Financial Precision
Uses rust_decimal throughout. No floating-point errors in your P&L.
Browser Ready
Core engine compiles to WASM. Same code runs native and in-browser.
Performance
All benchmarks on Apple M1 Pro using Criterion.rs:| Operation | Latency | Throughput |
|---|---|---|
| Best bid/ask lookup | 1.0 ns | 1,000,000,000/s |
| Spread calculation | 3.5 ns | 285,000,000/s |
| Apply delta update | ~100 ns | 10,000,000/s |
| Apply full snapshot | 10.0 us | 100,000/s |
| CRC32 validation | 5.9 us | 169,000/s |
All financial calculations use
rust_decimal to prevent floating-point errors inherent in f64 representations.What’s Included
- In Scope
- Not Included
- Kraken WebSocket API v2 (Spot + Futures)
- Real-time market data streaming
- L2 and L3 orderbook management
- WebSocket-based order management
- CRC32 checksum validation
- Automatic reconnection with circuit breaker
- Browser support via WebAssembly