Skip to main content

Design Philosophy

Havklo is built on one core principle: separate computation from I/O. The orderbook engine (kraken-book) contains zero networking code and no async runtime dependencies. This enables:
  • Native performance with Tokio in backend systems
  • Browser execution when compiled to WebAssembly
  • Deterministic testing without network mocking
  • Runtime portability across different async executors

Crate Hierarchy

Crate Overview

For browser/WASM usage, only kraken-book (35 deps) is needed. The full SDK includes the async runtime, networking, and observability.

Data Flow

Why This Matters

Same Logic Everywhere

CRC32 validation, decimal precision, and state management work identically native and in-browser.

Test Once, Run Anywhere

Unit tests run synchronously against kraken-book without mocking network calls.

Minimal Browser Bundle

Only 35 dependencies compile to WASM. No async runtime bloat.

Incremental Adoption

Use just kraken-types for definitions, or the full SDK for a complete solution.

Dependency Strategy

When building a WASM app, JavaScript handles the WebSocket. The WASM module only runs orderbook logic - no networking compiled into the binary.