# Orderbook (/scripting-v2/sources/orderbook)



Live orderbooks accept an optional depth and no timeframe:

```python
history.source("btc@orderbook@binancef@mmt:depth=100")
history.source("btc@orderbook@bulkf:depth=20")
history.source("btc@orderbook@hyperliquidf:depth=20")
```

Depth defaults to 100 where supported. Hyperliquid accepts 1 through 20.

```python
book = history.source("btc@orderbook@bulkf:depth=20", 0)
previous = history.source("btc@orderbook@bulkf:depth=20", 1)
```

MMT also supports historical orderbook heatmaps for backtests:

```python
history.source("btc@orderbook@binancef@mmt:timeframe=60,depth=100")
```

Historical MMT books are reconstructed from binned heatmap data. They are useful for liquidity analysis, not exact raw order replay. Direct BULK and Hyperliquid orderbooks are live-only.

See [Orderbook Data](/scripting-v2/data-types/orderbook) and [Built-In Functions](/scripting-v2/built-ins#orderbook-functions).
