Skip to main content

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.

Live Demos

These applications run entirely client-side, powered by the WASM-compiled orderbook engine:
ApplicationDescriptionLink
HavsynReal-time L2 Orderbook Visualizerhavsyn.vercel.app
HavdepthCumulative Depth Chartinghavdepth.vercel.app
HavflowOrder Flow Imbalance Analyzerhavflow.vercel.app
HavnetMulti-Symbol Dashboardhavnet.vercel.app
HavwatchPrice Alert SystemGitHub

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:
OperationLatencyThroughput
Best bid/ask lookup1.0 ns1,000,000,000/s
Spread calculation3.5 ns285,000,000/s
Apply delta update~100 ns10,000,000/s
Apply full snapshot10.0 us100,000/s
CRC32 validation5.9 us169,000/s
All financial calculations use rust_decimal to prevent floating-point errors inherent in f64 representations.

What’s 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