> For the complete documentation index, see [llms.txt](https://docs.kaiko.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kaiko.com/rest-api/cefi-spot-markets/market-data/order-book-aggregations/liquidity-weighted-average-price-lwap.md).

# Liquidity-weighted average price (LWAP)

{% hint style="info" %}

### This data is included in the following Kaiko packages:

* **Level 1 & Level 2 Data** \[Level 2 Aggregations Tier]
* **Level 1 & Level 2 Data** \[Level 2 Tick-Level Tier]

*Subscriptions with "CeFi Spot" as the market type.*
{% endhint %}

### What is this endpoint for? <a href="#what-is-this-endpoint-for" id="what-is-this-endpoint-for"></a>

This endpoint returns the liquidity-weighted average price (LWAP) of an instrument, one row per order book snapshot. The LWAP is the average price you would get by filling an order against the resting orders, from the best ask (or best bid) up to a given depth. Each row gives the LWAP on both sides at four depths (0.05%, 0.25%, 0.5% and 1% from the best price), with the slippage against the best price and the executed size in USD.

### Endpoint

{% code overflow="wrap" %}

```http
https://<eu|us>.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/{exchange}/{instrument_class}/{instrument}/snapshots/lwap
```

{% endcode %}

### Path parameters

<table><thead><tr><th width="203">Parameter</th><th>Required?</th><th>Description</th></tr></thead><tbody><tr><td><code>region</code></td><td>Yes</td><td>Choose between <code>eu</code> and <code>us</code>.</td></tr><tr><td><code>exchange</code></td><td>Yes</td><td>Exchange <code>code</code>.<br><br>See <a data-mention href="https://docs.kaiko.com/rest-api/cefi-spot-markets/reference-data/exchange-codes.md">Exchange codes</a></td></tr><tr><td><code>instrument_class</code></td><td>Yes</td><td>Instrument <code>class</code>: <code>spot</code>.</td></tr><tr><td><code>instrument</code></td><td>Yes</td><td>Instrument <code>code</code>.<br><br>See <a data-mention href="https://docs.kaiko.com/rest-api/cefi-spot-markets/reference-data/exchange-trading-pair-codes-instruments.md">Exchange trading pair codes (instruments)</a></td></tr></tbody></table>

### Query parameters

<table><thead><tr><th width="187">Parameter</th><th width="114">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>start_time</code></td><td>No</td><td>Starting time in ISO 8601 (inclusive).<br><br><em>Automatically included in continuation tokens.</em></td></tr><tr><td><code>end_time</code></td><td>No</td><td>Ending time in ISO 8601 (exclusive).<br><br><em>Automatically included in continuation tokens.</em></td></tr><tr><td><code>page_size</code></td><td>No</td><td>Number of rows per page. Default 100.<br><br>See <a data-mention href="https://docs.kaiko.com/rest-api/general/getting-started/pagination.md">Pagination</a><br><br><em>Automatically included in continuation tokens.</em></td></tr><tr><td><code>sort</code></td><td>No</td><td>Return the data in ascending (<code>asc</code>) or descending (<code>desc</code>) order.<br><br>Default <code>desc</code>.<br><br><em>Automatically included in continuation tokens.</em></td></tr><tr><td><code>continuation_token</code></td><td>No</td><td>See <a data-mention href="https://docs.kaiko.com/rest-api/general/getting-started/pagination.md">Pagination</a></td></tr></tbody></table>

### Fields

`{L}` is the depth: `0_05` (0.05%), `0_25` (0.25%), `0_5` (0.5%) and `1` (1%).

<table><thead><tr><th width="230">Field</th><th>Description</th></tr></thead><tbody><tr><td><code>poll_timestamp</code></td><td>Time we took the order book snapshot, in Unix milliseconds.</td></tr><tr><td><code>poll_date</code></td><td>Time we took the order book snapshot, in ISO 8601.</td></tr><tr><td><code>best_bid</code></td><td>Best bid price.</td></tr><tr><td><code>best_ask</code></td><td>Best ask price.</td></tr><tr><td><code>mid_price</code></td><td>Mid price between the best bid and the best ask.</td></tr><tr><td><code>spread_percent</code></td><td>Bid-ask spread as a fraction of the mid price (for example <code>0.0001</code> is 0.01%).</td></tr><tr><td><code>ask_lwap{L}</code></td><td>LWAP of buying through the asks up to L% above the best ask. <code>null</code> when the order book doesn't reach that depth.</td></tr><tr><td><code>bid_lwap{L}</code></td><td>LWAP of selling through the bids up to L% below the best bid. <code>null</code> when the order book doesn't reach that depth.</td></tr><tr><td><code>ask_slippage{L}</code></td><td>Difference between <code>ask_lwap{L}</code> and the best ask, as a fraction of the best ask.</td></tr><tr><td><code>bid_slippage{L}</code></td><td>Difference between <code>bid_lwap{L}</code> and the best bid, as a fraction of the best bid.</td></tr><tr><td><code>ask_lwap{L}_usd</code></td><td>Size executed on the ask side up to that depth, in USD.</td></tr><tr><td><code>bid_lwap{L}_usd</code></td><td>Size executed on the bid side up to that depth, in USD.</td></tr></tbody></table>

### Request examples

{% tabs %}
{% tab title="cURL" %}
{% code overflow="wrap" %}

```url
curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
  'https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/cbse/spot/btc-usd/snapshots/lwap'
```

{% endcode %}
{% endtab %}

{% tab title="Python" %}

```python
import requests
import pandas as pd

api_key = "YOUR_API_KEY"
exchange = "cbse"
instrument_class = "spot"
instrument = "btc-usd"

url = f"https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/{exchange}/{instrument_class}/{instrument}/snapshots/lwap"
headers = {"Accept": "application/json", "X-Api-Key": api_key}
params = {
    "start_time": "2026-11-01T00:00:00Z",
    "end_time": "2026-11-02T00:00:00Z",
    "sort": "desc",
    "page_size": 100,
}

rows = []
res = requests.get(url, headers=headers, params=params)
res.raise_for_status()
data = res.json()
rows.extend(data.get("data", []))

# Follow next_url until every page is retrieved
while data.get("next_url"):
    res = requests.get(data["next_url"], headers=headers)
    res.raise_for_status()
    data = res.json()
    rows.extend(data.get("data", []))

df = pd.DataFrame(rows)
```

{% endtab %}
{% endtabs %}

### Response example

Shortened to the 0.05% level.

```json
{
  "query": {
    "exchange": "cbse",
    "instrument_class": "spot",
    "instrument": "btc-usd",
    "start_time": "2026-11-01T00:00:00.000Z",
    "end_time": "2026-11-02T00:00:00.000Z",
    "page_size": 1,
    "sort": "desc",
    "aggregation": "lwap",
    "data_version": "v1",
    "commodity": "order_book_snapshots",
    "request_time": "2026-11-09T17:46:30.67349096Z"
  },
  "time": "2026-11-09T17:46:30.748814498Z",
  "timestamp": 1794246390748,
  "data": [
    {
      "poll_timestamp": 1793577574539,
      "poll_date": "2026-11-01T23:59:34.539Z",
      "best_bid": "78234.68",
      "best_ask": "78234.69",
      "mid_price": "78234.685",
      "spread_percent": "0.00000012782054416545841",
      "ask_lwap0_05": "78253.57060531883",
      "ask_slippage0_05": "0.0002413329089542111",
      "ask_lwap0_05_usd": "824041.475025677",
      "bid_lwap0_05": "78206.91529867187",
      "bid_slippage0_05": "0.00035488994558581846",
      "bid_lwap0_05_usd": "694114.4761486562"
    }
  ],
  "result": "success",
  "continuation_token": "7NMA1wVjLvgvF2kHMNfV...",
  "next_url": "https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/cbse/spot/btc-usd/snapshots/lwap?continuation_token=..."
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.kaiko.com/rest-api/cefi-spot-markets/market-data/order-book-aggregations/liquidity-weighted-average-price-lwap.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
