Skip to main content

Documentation Index

Fetch the complete documentation index at: https://krono.fabianpiper.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

A project built for the Kraken Forge Hackathon (Track #2: Orderbook Visualizer) by Fabian Piper
Krono Hero Light

Krono

Krono provides a complete solution for visualizing cryptocurrency orderbook data from Kraken’s WebSocket API. Built with a modular architecture, it consists of three packages:

Core

The @krono/core package provides framework-agnostic orderbook logic with WebSocket management.

Hooks

The @krono/hooks package provides a react integration library with composable hooks.

Kit

The @krono/kit package provides pre-built UI components using shadcn/ui and Tailwind CSS.
For a deeper look at Krono’s architecture, such as the update pipeline and design patterns, see the Architecture guide

Features

  • Ready-to-use components: Pre-built UI based on shadcn/ui and Tailwind CSS for orderbook visualization, configuration panels, and asset pair selection
  • Time travel playback: Replay historical orderbook states with frame-accurate precision for debugging, backtesting, and market analysis
  • High-performance WebSocket: Optimized Kraken WebSocket integration with intelligent throttling and debouncing to keep your UI responsive
  • 7+ React hooks: Composable hooks for orderbook data, subscriptions, and state management with full control over data flow
  • Framework-agnostic: Core package works with any framework, including React, Vue, Svelte, Angular, or vanilla JavaScript
  • TypeScript first: End-to-end type safety with excellent IDE autocomplete and compile-time error detection

Usage

Use the following code snippet to get a live orderbook with time travel capabilities:
import {
  formatDigits,
  formatPrice,
  Orderbook,
  OrderbookControls,
  OrderbookTable,
} from '@krono/kit';

export function OrderbookPanel() {
  return (
      <Orderbook.Root config={{ symbol: 'BTC/USD' }}>
        <Orderbook.Panel
          renderTable={(props) => (
            <OrderbookTable.Root
              columns={{
                total: {
                  label: 'Total',
                  children: ({ value }) => formatDigits(value.total),
                },
                quantity: {
                  label: 'Quantity',
                  children: ({ value }) => formatDigits(value.quantity),
                },
                price: {
                  label: 'Price',
                  className: 'font-semibold',
                  children: ({ value }) => formatPrice(value.price, 4),
                },
              }}
              {...props}
            />
          )}
        >
          <OrderbookControls.Root>
            <OrderbookControls.LiveBadge />
            <OrderbookControls.Toolbar>
              <OrderbookControls.PlaybackButtons />
              <OrderbookControls.Timeline />
            </OrderbookControls.Toolbar>
          </OrderbookControls.Root>
        </Orderbook.Panel>
    </Orderbook.Root>
  );
}
The examples above assume local packages. Krono is not yet available on the npm registry. See the development guide for setup instructions.

Browser Support

Krono works in all modern browsers that support WebSocket and ES2020+ features:
  • Chrome/Edge 90+
  • Firefox 88+
  • Safari 14+
  • Modern mobile browsers (iOS Safari 14+, Chrome Mobile)

What’s Next?

Development Guide

Follow our step-by-step local installation guide

Browse Examples

See implementation examples

Architecture Overview

Explore Krono’s core architecture

View Source

Check out the code on GitHub