> 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/getting-started/kaiko-examples/compare-market-depth-between-exchanges.md).

# Compare market depth between exchanges

Market depth is a measure of how well a market can handle large orders without impacting asset prices. A "deep" market has enough volume on both sides - bids (buy orders) and asks (sell orders) - to handle large orders while keeping prices stable. Market depth varies between exchanges and over time, so traders often monitor it across different platforms to determine the best market on which to trade.

<figure><img src="https://815309201-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzwO3AMVXsp37KK2FngVc%2Fuploads%2FDexNU2bMEfbst1K2oH6I%2FMarket%20Depth.png?alt=media&#x26;token=faffb4b1-2682-42fc-8f09-804631fddd2d" alt=""><figcaption><p>This chart shows the 1% market depth for all trading pairs with BTC as the base asset. It shows the USD value of all bids <code>(bid_volume_1)</code> and asks (<code>ask_volume_1</code>) within 1% of the mid-price.</p></figcaption></figure>

### <mark style="color:blue;">How to build the request</mark>

Use [Market Metrics](/rest-api/monitoring/kaiko-market-explorer/assets.md) (assets) with the following parameters to replicate this chart.

| Parameter   | Value                    |
| ----------- | ------------------------ |
| asset       | btc                      |
| start\_time | 2022-11-05T00:00:00.000Z |
| end\_time   | 2022-11-28T00:00:00.000Z |
| interval    | 1d                       |
| sources     | true                     |

Here's an example of a cURL string request using the values above:

{% code overflow="wrap" %}

```url
curl -X GET "https://us.market-api.kaiko.io/v2/data/analytics.v2/asset_metrics?asset=btc&start_time=2022-11-05T00:00:00.000Z&end_time=2022-11-28T00:00:00.000Z&interval=1d&sources=true" -H "accept: application/json" -H "X-Api-Key: YOUR_API_KEY"
```

{% endcode %}

When you receive your response, search for the following fields to find the data you need:

* `timestamp`
* `buy_market_depths`:
  * exchange
  * volume\_usds: {bid\_volume\_0\_1}
* `sell_market_depth`s:
  * exchange
  * volume\_usds: {ask\_volume\_0\_1}


---

# 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/getting-started/kaiko-examples/compare-market-depth-between-exchanges.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.
