Kraken RS: High-Performance SDK & TUI

Production-ready Async Rust SDK processing 648k+ msg/sec. Features strict types, auto-reconnect, and a "Grandmaster" Terminal UI for real-time analytics.

Websitegithub
  • 0 Raised
  • 604 Views
  • 0 Judges

Categories

  • SDK Client

Gallery

Description

1. Project Name

Kraken Rust SDK

2. Short Tagline 

A high-performance, strictly-typed Async Rust SDK for Kraken with a built-in Terminal UI (648k msg/sec).

3. The Problem

Building reliable trading systems on raw WebSockets is painful:- Dynamic languages like Python are prone to runtime errors when API schemas change- Handling millions of messages per hour requires robust infrastructure- Manual state management leads to data inconsistencies

4. The Solution

The Kraken Rust SDK is a production-grade library designed for high-frequency trading systems.

Key Architecture:

  • Leverages Rust's Actor Pattern (via Tokio) to decouple event loop from application logic
  • Ensures zero-latency handling of market data
  • Implements CRC32 checksum validation to mathematically verify orderbook integrity

5. Performance Benchmarks

Tested against Python's `json.loads` processing 10,000 Kraken messages:

| Implementation | Throughput       | Type Safety          |

|-----------------|-----------------|-------------------|

|      Rust SDK      | 648,000 msg/s | ✅ Compile-time |

|  Python (Raw)   | 602,000 msg/s  | ❌ Runtime-only    |

Result: 8% faster with full compile-time safety.

6. Key Features

648k msg/sec Throughput - Zero-copy deserialization with Serde  

Grandmaster Terminal UI - Full TUI (ratatui) with orderbook, liquidity depth, and live candles

CRC32 Checksum Validation - Mathematically verify orderbook integrity on every update

Auto-Reconnection - Deterministic state machine for subscription restoration  

HMAC-SHA512 Authentication - Verified private feed support  

10 Working Examples - Including algorithmic trading bot 

Docker Support - One-command deployment  

CI/CD Pipeline - GitHub Actions with automated testing  

7.  Tech Stack / Built With

  • Language: Rust 🦀
  • Async Runtime: Tokio
  • Networking: Tokio-Tungstenite (WebSockets), Reqwest (REST)
  • Parsing: Serde, Serde-Json (Zero-copy)
  • UI: Ratatui, Crossterm
  • Cryptography: HMAC-SHA512, CRC32Fast

8.URLS

Repository URL

https://github.com/Nihal-Pandey-2302/kraken-rs

Documentation URL

https://nihal-pandey-2302.github.io/kraken-rs/kraken_sdk/

Demo Video URL

https://youtu.be/hQP03oT1gkY

10. How It Works

Installation (2 lines):

cargo add tokio --features full
cargo add kraken_sdk --git https://github.com/Nihal-Pandey-2302/kraken-rs

Usage (5 lines):

let client = KrakenClient::new();
client.connect().await?;
client.subscribe(vec!["XBT/USD"], "trade", None).await?;
let mut rx = client.subscribe_events();
while let Ok(event) = rx.recv().await { /* Process typed events */ }

Run Examples:

cargo run --example 01_basic_subscribe  # Basic streaming
cargo run --example 07_terminal_ui      # Professional TUI
./run_all_examples.sh                   # Verify all 10 examples

11.Why This Wins Track #1

Requirements Met:

✅ Lightweight SDK connecting to Kraken WebSocket API  

✅ Processes updates efficiently (648k msg/s benchmarked)  

✅ Exposes clean API for downstream consumers  

✅ Reusable with comprehensive documentation  

Beyond Requirements:

✅ Enables Track #2 visualizers with typed data models  

✅ Enables Track #3 strategy builders with trading bot example  

✅ Production-ready: CI/CD, Docker, monitoring, checksums  

✅ Proven correctness: 65+ checksum validations in verification script  

Competitive Advantages:

  • SDK with CRC32 checksum validation (data integrity guarantee)
  • SDK with auto-reconnection + state restoration (production resilience)
  • SDK with trading bot example (proves real-world usage)
  • SDK with professional TUI (visual proof of capability)
  • SDK with benchmarked performance (concrete metrics, not claims)

 🎥 See It In Action

Watch the 4-minute demo: [YouTube Link]

Unlike other SDKs that just list features, we PROVE ours works:

- ✅ 648,000 msg/sec (benchmarked against Python)

- ✅ 65+ CRC32 checksums validated (shown in video)

- ✅ Trading bot with SMA strategy (example 10)

- ✅ Professional TUI with live charts (examples 7)

- ✅ CI/CD pipeline passing (GitHub Actions)

See the proof, not just the promises.

11. Code Snippets (For Gallery/Images)

Snippet 1: The "Simple" Start  shows  how easy it is to use.

Snippet 2: The "Type Safety" Flex Shows why Rust is superior to Python.

Snippet 3: Auto-Reconnection (Production Feature):

Snippet 4: Trading Bot (Real-World Usage):

Live TUI:


Attachments