Skip to main content
kraken-sdk is the official Rust SDKs for building integrations against the Spot API. It is async-native, built on tokio, and presents REST and WebSocket v2 behind a single client.
Currently Spot-only. Derivatives support is planned.

Requirements

Requires Rust 1.88 or later and the tokio async runtime.

Install

What it covers

  • Spot REST — complete public market data, plus authenticated account and trading endpoints
  • Spot WebSocket v2 — public data streams and the authenticated executions and balances channels
  • Order operations: add, amend, cancel, batch add, batch cancel, cancel-all, and a dead man’s switch
  • Order routing over REST or authenticated WebSocket, selectable per call
  • Real-time order book construction with CRC32 checksum validation and automatic reseeding on mismatch
  • Automatic reconnect with subscription replay
  • Typed errors carrying a stable code, category, retryable flag and request id
  • An event bus for connection state, rate-limit warnings, order book gaps and order lifecycle

Example

Public market data needs no credentials:

Notes for developers coming from other Kraken SDKs

  • Symbols use the modern format only. BTC/USD, not XBTUSD or XXBTZUSD. Legacy codes return a typed error rather than being silently translated. Asset codes in responses are normalised the same way, so balances are keyed BTC and USD.
  • Prices and quantities are decimals, not floats. Parse them from strings ("0.01".parse()?). The API does not accept f64.
  • A WebSocket subscription is two steps: register a handler, then subscribe. The on_*_for helpers do both in one call and unsubscribe when dropped.
  • Rate limits are reported, not enforced. The SDK emits a warning event as you approach your tier limit and never sleeps on your behalf, so pacing stays under your control.