> ## Documentation Index
> Fetch the complete documentation index at: https://docs.probalytics.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Liquidity

> Depth within 1¢, 5¢, and 10¢ of mid, book totals, and imbalance per outcome

> [!NOTE]
>
> Liquidity is an **early access** dataset available through [SQL](https://docs.probalytics.io/docs/sql-guide/overview.md). It requires orderbook access. To request access, email [support@probalytics.io](mailto:support@probalytics.io).

Resting size near the mid, totals per side, and book imbalance for each outcome. Computed at query time from verified [orderbook snapshots](https://docs.probalytics.io/docs/datasets/orderbook.md) (`state = 'VERIFIED'`).

| View | Rows |
| - | - |
| `liquidity` | One per snapshot |
| `liquidity_1s`, `liquidity_10s`, `liquidity_1m`, `liquidity_5m` | One per outcome per bucket |

## Raw view

`liquidity` has one row per verified snapshot. It reads `orderbook_snapshots` directly, so always filter by `market_id` and a `timestamp` range:

```sql theme={null}
SELECT timestamp, outcome.name, bid_5c, ask_5c, imbalance
FROM liquidity
WHERE market_id = '00000000-0000-0000-0000-000000000000'
  AND timestamp >= now() - INTERVAL 1 HOUR
ORDER BY timestamp
```

## Sampled views

The `_1s`, `_10s`, `_1m`, and `_5m` views are parameterized and return the book **as of** each bucket boundary, on a regular time grid:

```sql theme={null}
SELECT *
FROM liquidity_1m(
    market_id = '00000000-0000-0000-0000-000000000000',
    start = '2026-11-01 00:00:00',
    end = '2026-11-02 00:00:00'
)
```

| Parameter | Type | Meaning |
| - | - | - |
| `market_id` | `UUID` | Market. Joins to `markets.id`. |
| `start` | `DateTime` (UTC) | Range start, rounded down to the bucket boundary. Inclusive. |
| `end` | `DateTime` (UTC) | Range end. Exclusive. |

* Each row describes the last verified snapshot at or before `timestamp`. The book is carried forward through buckets with no updates.
* The views look back at most **1 day before `start`** for the starting book. If an outcome had no update in that window, its rows are `null` until the first update.
* Every outcome of the market gets a row per bucket.

## Fields

The raw `liquidity` view also has `path_index` and `indexed_at` from the snapshot.

Depth bands are measured from the mid. If one side of the book is empty, the bid band is measured from the best bid and the ask band from the best ask.

| Field | Type | Values and meaning |
| - | - | - |
| `platform` | `enum` | Source venue. |
| `market_id` | `UUID` | Probalytics market ID. |
| `market_platform_id` | `string` | Venue market ID. |
| `outcome` | `tuple` | Outcome struct. |
| `timestamp` | `datetime` | Snapshot time (raw view) or bucket time (sampled views). |
| `best_bid`, `best_ask` | `decimal \| null` | Best prices. |
| `mid`, `spread` | `decimal \| null` | Midpoint and best ask minus best bid. |
| `bid_1c`, `ask_1c` | `decimal` | Shares resting within 1¢ of the mid on each side. |
| `bid_5c`, `ask_5c` | `decimal` | Shares within 5¢. |
| `bid_10c`, `ask_10c` | `decimal` | Shares within 10¢. |
| `bid_total`, `ask_total` | `decimal` | All shares on each side. |
| `bid_1c_usd` … `ask_10c_usd` | `decimal` | Same bands in dollars (`price × size`). |
| `bid_total_usd`, `ask_total_usd` | `decimal` | Whole side in dollars. |
| `imbalance` | `float \| null` | `(bid_5c - ask_5c) / (bid_5c + ask_5c)`, from -1 (all asks) to 1 (all bids). `null` if both are 0. |
| `bid_levels`, `ask_levels` | `integer` | Number of price levels on each side. |

## Usage tips

* Use the sampled views to align the book with other time series, such as [OHLC candles](https://docs.probalytics.io/docs/datasets/ohlc.md).
* Coverage and history follow [orderbook snapshots](https://docs.probalytics.io/docs/datasets/orderbook.md#coverage-by-venue-and-product).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.