> ## 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.

# OrderbookProvider

> Context provider that manages the Orderbook lifecycle and configuration.

The `OrderbookProvider` is responsible for instantiating the core `Orderbook` class, managing the WebSocket connection lifecycle, and making the instance available to all child components via context.

## Import

```ts theme={null}
import { OrderbookProvider } from '@krono/hooks'
```

## Usage

Wrap your application root or a specific feature section.

```tsx theme={null}
<OrderbookProvider config={{ symbol: 'ETH/USD', limit: 50 }}>
  <OrderbookWidget />
</OrderbookProvider>
```

<Note>
  The provider automatically calls `.connect()` when the component mounts and `.disconnect()` when it unmounts.
</Note>

## Props

<ParamField body="config" type="OrderbookConfigOptions" required>
  The configuration object passed directly to the underlying `Orderbook` constructor.

  <Expandable title="Properties">
    <ParamField body="symbol" type="string" required>
      The trading pair to subscribe to (e.g., `BTC/USD`).
    </ParamField>

    <ParamField body="limit" type="number">
      Max number of price levels to keep in memory.
    </ParamField>

    <ParamField body="depth" type="number">
      Kraken subscription depth (10, 25, 100, 500, 1000).
    </ParamField>

    <ParamField body="throttleMs" type="number">
      Throttle updates to UI components (e.g., `100`ms).
    </ParamField>

    <ParamField body="historyEnabled" type="boolean">
      Enable if you plan to use `useOrderbookPlayback`.
    </ParamField>

    <ParamField body="debug" type="boolean">
      Enable verbose console logging.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="children" type="ReactNode">
  The React components that need access to the orderbook data.
</ParamField>
