Data Sources
Orderbook
Orderbook selectors, returned fields, and examples for Furge scripts.
Returned record
Illustrative direct-feed values. Prices use the market's quote asset per base asset, and timestamps use Unix milliseconds.
{
"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
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.
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 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.