Orderbook.Root component serves as the context provider for all orderbook-related components in @krono/kit. It wraps the core @krono/core functionality and provides React hooks and components with access to orderbook data, asset pairs, and playback features.
Basic Setup
The minimal configuration requires only a trading pair symbol:Configuration Structure
Theconfig prop accepts an object with orderbook settings and optional asset pairs configuration:
Context Providers
TheOrderbook.Root component automatically provides the context providers, defined by @krono/hooks:
- Orderbook Context: Core settings for symbol, depth, limits, and reconnection
- AssetPairs Context: Manages trading pair metadata via
useAssetPairs()
The
Orderbook.Root component must wrap all components that need access to orderbook data. It cannot be nested.Configuration Sections
- Orderbook Settings: Core settings for symbol, depth, limits, and reconnection
- Performance Settings: Throttling and debouncing for optimal performance
- History Configuration: Enable snapshot tracking and playback features
- Asset Pairs: Configure trading pair metadata fetching
Props
Configuration object for the orderbook provider.
Child components that will have access to orderbook context.
Related
Performance
Fine-tune update frequency with throttling and debouncing options.
History
Enable snapshot tracking and playback features for historical analysis and debugging.
Asset Pairs
Configure how trading pair metadata is fetched and cached. Required for auto-populating
tickSize.Orderbook
Configure the core orderbook behavior.

