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



## Returned record [#returned-record]

Illustrative direct-feed values. Prices use the market's quote asset per base asset, and timestamps use Unix milliseconds.

```json
{
  "exchange": "hyperliquidf",
  "symbol": "BTC",
  "timestamp_ms": 1793232000000,
  "bids": [
    {
      "price": 80500,
      "quantity": 0.25
    }
  ],
  "asks": [
    {
      "price": 80501,
      "quantity": 0.4
    }
  ]
}
```

| Field | Type | Meaning |
| --- | --- | --- |
| `exchange` | string | Normalized exchange. |
| `symbol` | string | Normalized symbol. |
| `timestamp_ms` | integer | Snapshot time in Unix milliseconds. |
| `bids` | list | Bid levels, best price first. |
| `asks` | list | Ask levels, best price first. |
| `bids[i].price, asks[i].price` | number | Level price. |
| `bids[i].quantity, asks[i].quantity` | number | Level quantity. |

## Configure the feed [#configure-the-feed]

```python
SOURCE = "btc@orderbook@hyperliquidf:depth=5"
```

Direct Hyperliquid and BULK orderbooks are live-only. Do not add a timeframe. Hyperliquid depth is 1 through 20; configured depth caps the returned levels. This is aggregated depth, not a list of individual resting orders or an L4 subscription. Either side can be empty.

```python
script = {"name": "watch-book", "version": "2", "lookback": 2}
SOURCE = "btc@orderbook@hyperliquidf:depth=5"


def on_data(ctx, history):
    book = history.source(SOURCE, 0)
    if book and book["bids"] and book["asks"]:
        return {"metrics": {"spread": book["asks"][0]["price"] - book["bids"][0]["price"]}}
```

Use [Watch the spread](/scripting-v2/furge/examples#watch-the-spread) for a complete example with basis-point conversion.

An indexed read returns one dictionary or `None`; without an index it returns retained records oldest to newest. See [Read history](/scripting-v2/furge/sources#read-history).

[All Furge data sources](/scripting-v2/furge/sources) · [Monitoring](/scripting-v2/furge/monitoring).
