Order Book Depth

Definition

Liquidity depth metrics measure the available order book liquidity at different percentage levels from the midprice. These metrics provide measure the market depth and assess how much volume is available for trading at different price levels. The metrics are computed in both the native units of the base asset for spot markets and in contract values for futures markets, and their equivalent value in USD.

Name
MetricID
Unit
Interval

Order Book Depth, 0.1 Percent From Midprice, Ask, Native Units

Native Units

1h

Order Book Depth, 0.2 Percent From Midprice, Ask, Native Units

Native Unit

1h

Order Book Depth, 0.3 Percent From Midprice, Ask, Native Units

Native Unit

1h

Order Book Depth, 0.4 Percent From Midprice, Ask, Native Units

Native Unit

1h

Order Book Depth, 0.5 Percent From Midprice, Ask, Native Units

Native Unit

1h

Order Book Depth, 0.6 Percent From Midprice, Ask, Native Units

Native Unit

1h

Order Book Depth, 0.7 Percent From Midprice, Ask, Native Units

Native Unit

1h

Order Book Depth, 0.8 Percent From Midprice, Ask, Native Units

Native Unit

1h

Order Book Depth, 0.9 Percent From Midprice, Ask, Native Units

Native Unit

1h

Order Book Depth, 1 Percent From Midprice, Ask, Native Units

Native Units

1h

Order Book Depth, 1.5 Percent From Midprice, Ask, Native Units

Native Units

1h

Order Book Depth, 2 Percent From Midprice, Ask, Native Units

Native Units

1h

Order Book Depth, 3 Percent From Midprice, Ask, Native Units

Native Units

1h

Order Book Depth, 4 Percent From Midprice, Ask, Native Units

Native Units

1h

Order Book Depth, 5 Percent From Midprice, Ask, Native Units

Native Units

1h

Order Book Depth, 6 Percent From Midprice, Ask, Native Units

Native Units

1h

Order Book Depth, 7 Percent From Midprice, Ask, Native Units

Native Units

1h

Order Book Depth, 8 Percent From Midprice, Ask, Native Units

Native Units

1h

Order Book Depth, 9 Percent From Midprice, Ask, Native Units

Native Units

1h

Order Book Depth, 10 Percent From Midprice, Ask, Native Units

Native Units

1h

Order Book Depth, 0.1 Percent From Midprice, Ask, USD

USD

1h

Order Book Depth, 0.2 Percent From Midprice, Ask, USD

USD

1h

Order Book Depth, 0.3 Percent From Midprice, Ask, USD

USD

1h

Order Book Depth, 0.4 Percent From Midprice, Ask, USD

USD

1h

Order Book Depth, 0.5 Percent From Midprice, Ask, USD

USD

1h

Order Book Depth, 0.6 Percent From Midprice, Ask, USD

USD

1h

Order Book Depth, 0.7 Percent From Midprice, Ask, USD

USD

1h

Order Book Depth, 0.8 Percent From Midprice, Ask, USD

USD

1h

Order Book Depth, 0.9 Percent From Midprice, Ask, USD

USD

1h

Order Book Depth, 1 Percent From Midprice, Ask, USD

USD

1h

Order Book Depth, 1.5 Percent From Midprice, Ask, USD

USD

1h

Order Book Depth, 2 Percent From Midprice, Ask, USD

USD

1h

Order Book Depth, 3 Percent From Midprice, Ask, USD

USD

1h

Order Book Depth, 4 Percent From Midprice, Ask, USD

USD

1h

Order Book Depth, 5 Percent From Midprice, Ask, USD

USD

1h

Order Book Depth, 6 Percent From Midprice, Ask, USD

USD

1h

Order Book Depth, 7 Percent From Midprice, Ask, USD

USD

1h

Order Book Depth, 8 Percent From Midprice, Ask, USD

USD

1h

Order Book Depth, 9 Percent From Midprice, Ask, USD

USD

1h

Order Book Depth, 10 Percent From Midprice, Ask, USD

USD

1h

Order Book Depth, 0.1 Percent From Midprice, Bid, Native Units

Native Units

1h

Order Book Depth, 0.2 Percent From Midprice, Bid, Native Units

Native Units

1h

Order Book Depth, 0.3 Percent From Midprice, Bid, Native Units

Native Units

1h

Order Book Depth, 0.4 Percent From Midprice, Bid, Native Units

Native Units

1h

Order Book Depth, 0.5 Percent From Midprice, Bid, Native Units

Native Units

1h

Order Book Depth, 0.6 Percent From Midprice, Bid, Native Units

Native Units

1h

Order Book Depth, 0.7 Percent From Midprice, Bid, Native Units

Native Units

1h

Order Book Depth, 0.8 Percent From Midprice, Bid, Native Units

Native Units

1h

Order Book Depth, 0.9 Percent From Midprice, Bid, Native Units

Native Units

1h

Order Book Depth, 1 Percent From Midprice, Bid, Native Units

Native Units

1h

Order Book Depth, 1.5 Percent From Midprice, Bid, Native Units

Native Unit

1h

Order Book Depth, 2 Percent From Midprice, Bid, Native Units

Native Units

1h

Order Book Depth, 3 Percent From Midprice, Bid, Native Units

Native Units

1h

Order Book Depth, 4 Percent From Midprice, Bid, Native Units

Native Units

1h

Order Book Depth, 5 Percent From Midprice, Bid, Native Units

Native Units

1h

Order Book Depth, 6 Percent From Midprice, Bid, Native Units

Native Units

1h

Order Book Depth, 7 Percent From Midprice, Bid, Native Units

Native Units

1h

Order Book Depth, 8 Percent From Midprice, Bid, Native Units

Native Units

1h

Order Book Depth, 9 Percent From Midprice, Bid, Native Units

Native Units

1h

Order Book Depth, 10 Percent From Midprice, Bid, Native Units

Native Units

1h

Order Book Depth, 0.1 Percent From Midprice, Bid, USD

USD

1h

Order Book Depth, 0.2 Percent From Midprice, Bid, USD

USD

1h

Order Book Depth, 0.3 Percent From Midprice, Bid, USD

USD

1h

Order Book Depth, 0.4 Percent From Midprice, Bid, USD

USD

1h

Order Book Depth, 0.5 Percent From Midprice, Bid, USD

USD

1h

Order Book Depth, 0.6 Percent From Midprice, Bid, USD

USD

1h

Order Book Depth, 0.7 Percent From Midprice, Bid, USD

USD

1h

Order Book Depth, 0.8 Percent From Midprice, Bid, USD

USD

1h

Order Book Depth, 0.9 Percent From Midprice, Bid, USD

USD

1h

Order Book Depth, 1 Percent From Midprice, Bid, USD

USD

1h

Order Book Depth, 1.5 Percent From Midprice, Bid, USD

USD

1h

Order Book Depth, 2 Percent From Midprice, Bid, USD

USD

1h

Order Book Depth, 3 Percent From Midprice, Bid, USD

USD

1h

Order Book Depth, 4 Percent From Midprice, Bid, USD

USD

1h

Order Book Depth, 5 Percent From Midprice, Bid, USD

USD

1h

Order Book Depth, 6 Percent From Midprice, Bid, USD

USD

1h

Order Book Depth, 7 Percent From Midprice, Bid, USD

USD

1h

Order Book Depth, 8 Percent From Midprice, Bid, USD

USD

1h

Order Book Depth, 9 Percent From Midprice, Bid, USD

USD

1h

Order Book Depth, 10 Percent From Midprice, Bid, USD

USD

1h

Details

The liquidity depth metrics follow a structured naming convention:

  • liquidity_depth_{X}_percent_ask_volume_units: Order book depth on the ask side at X% of midprice in base asset units.

  • liquidity_depth_{X}_percent_bid_volume_units: Order book depth on the bid side at X% of midprice in base asset units.

  • liquidity_depth_{X}_percent_ask_volume_usd: Order book depth on the ask side at X% of midprice converted to USD.

  • liquidity_depth_{X}_percent_bid_volume_usd: Order book depth on the bid side at X% of midprice converted to USD.

Each liquidity depth metric represents the cumulative volume available on either the bid or ask side of the order book at a specified percentage away from the midprice.

The midprice is defined as the average of the best bid and best ask prices:

  • Midprice=Best Bid Price+Best Ask Price2 \text{Midprice} = \frac{\text{Best Bid Price} + \text{Best Ask Price}}{2}

The total volume available on the order book at or within X% of the midprice, expressed in the base asset’s native units for spot markets and contract units for futures markets:

  • Liquidity DepthX%=pPmid(1X%)Vbid(p)(for bids) \text{Liquidity Depth}_{X\%} = \sum_{p \geq P_{\text{mid}} (1 - X\%)} V_{\text{bid}}(p) \quad \text{(for bids)}

  • Liquidity DepthX%=pPmid×(1+X%)Vask(p)(for asks) \text{Liquidity Depth}_{X\%} = \sum_{p \leq P_{\text{mid}} \times (1 + X\%)} V_{\text{ask}}(p) \quad \text{(for asks)}

The total volume available on the order book at or within X% of the midprice, expressed in U.S. dollars for spot markets:

  • Liquidity DepthX%,USD=pPmid×(1X%)Vbid(p)×Pbid(for bids) \text{Liquidity Depth}_{X\%, USD} = \sum_{p \geq P_{\text{mid}} \times (1 - X\%)} V_{\text{bid}}(p) \times P_{\text{bid}} \quad \text{(for bids)}

  • Liquidity DepthX%,USD=pPmid×(1+X%)Vask(p)×Pask(for asks) \text{Liquidity Depth}_{X\%, USD} = \sum_{p \leq P_{\text{mid}} \times (1 + X\%)} V_{\text{ask}}(p) \times P_{\text{ask}} \quad \text{(for asks)}

Futures markets follow a modified formula that takes into account the contract size:

  • Liquidity DepthX%,USD=pPmid×(1X%)Vbid(p)×Contract Size×PContractSizeAsset,USD(for bids) \text{Liquidity Depth}_{X\%, USD} = \sum_{p \geq P_{\text{mid}} \times (1 - X\%)} V_{\text{bid}}(p) \times \text{Contract Size} \times P_{\text{ContractSizeAsset,USD}} \quad \text{(for bids)}

  • Liquidity DepthX%,USD=pPmid×(1+X%)Vask(p)×Contract Size×PContractSizeAsset,USD(for asks) \text{Liquidity Depth}_{X\%, USD} = \sum_{p \geq P_{\text{mid}} \times (1 + X\%)} V_{\text{ask}}(p) \times \text{Contract Size} \times P_{\text{ContractSizeAsset,USD}} \quad \text{(for asks)}

API Endpoints

Liquidity order book depth metrics can be accessed using the following endpoints:

  • timeseries/market-metrics

Market metrics

get

Returns metrics for specified markets. Results are ordered by tuple (market, time). To fetch the next page of results use next_page_url JSON response field.

Authorizations
Query parameters
marketsstring[]Required

Comma separated list of markets or market patterns like exchange-* or exchange-*-spot or *USDT-future. Use the /catalog-all/markets endpoint for the full list of supported markets.

metricsstring[]Required

Comma separated metrics to request time series data for. Use the /catalog-all/market-metrics endpoint for the full list of supported metrics per exchange-asset combination.

Example: ["liquidations_reported_future_buy_units_1d","liquidations_reported_future_sell_units_1d"]
frequencystringOptional

Frequency of the market metrics. Supported values are 1m, 5m, 1h, 1d.

Default: 1d
start_timestringOptional

Start of the time interval. This field refers to the time field in the response. Multiple formats of ISO 8601 are supported: 2006-01-20T00:00:00Z, 2006-01-20T00:00:00.000Z, 2006-01-20T00:00:00.123456Z, 2006-01-20T00:00:00.123456789Z, 2006-01-20, 20060120. Inclusive by default. UTC timezone by default. Z suffix is optional and timezone parameter has a priority over it. If start_time is omitted, response will include time series from the earliest time available.

end_timestringOptional

End of the time interval. This field refers to the time field in the response. Multiple formats of ISO 8601 are supported: 2006-01-20T00:00:00Z, 2006-01-20T00:00:00.000Z, 2006-01-20T00:00:00.123456Z, 2006-01-20T00:00:00.123456789Z, 2006-01-20, 20060120. Inclusive by default. UTC timezone by default. Z suffix is optional and timezone parameter has a priority over it. If end_time is omitted, response will include time series up to the latest time available.

start_inclusivebooleanOptional

Inclusive or exclusive corresponding start_* parameters.

Default: true
end_inclusivebooleanOptional

Inclusive or exclusive corresponding end_* parameters.

Default: true
timezonestringOptional

Timezone name for start_time and end_time timestamps. This parameter does not modify the output times, which are always UTC. Format is defined by TZ database.

Default: UTCExample: America/New_York
page_sizeinteger · int32 · min: 1 · max: 10000Optional

Number of items per single page of results. The value of this parameter is ignored if the endpoint supports the format parameter and its value is set to json_stream.

Default: 100
paging_fromstring · enumOptional

Where does the first page start, at the start of the interval or at the end. The value of this parameter is ignored if the endpoint supports the format parameter and its value is set to json_stream.

Default: endPossible values:
sortstring · enumOptional

How results will be sorted. Metrics are sorted by (market, time) by default. If you want to sort 1d metrics by (time, market) you should choose time as value for the sort parameter. Sorting by time is useful if you request metrics for a set of markets.

Default: marketPossible values:
limit_per_marketinteger · int32Optional

How many entries per market result should contain. It is useful when multiple markets are requested.

prettybooleanOptional

Human-readable formatting of JSON responses.

Default: false
formatstring · enumOptional

Format of the response.

Default: jsonPossible values:
next_page_tokenstringOptional

Token for receiving the results from the next page of a query. Should not be used directly. To iterate through pages just use next_page_url response field.

Responses
200
Time series of market metrics.
application/json
get
GET /v4/timeseries/market-metrics HTTP/1.1
Host: api.coinmetrics.io
Accept: */*
{
  "data": [
    {
      "market": "binance-BTCUSDT-future",
      "time": "2022-01-19T20:00:00.000000000Z",
      "liquidations_reported_future_buy_usd_5m": "1298.36866"
    },
    {
      "market": "binance-BTCUSDT-future",
      "time": "2022-01-19T20:10:00.000000000Z",
      "liquidations_reported_future_buy_usd_5m": "39713.60016"
    },
    {
      "market": "binance-BTCUSDT-future",
      "time": "2022-01-19T20:30:00.000000000Z",
      "liquidations_reported_future_buy_usd_5m": "29084.10932"
    },
    {
      "market": "binance-BTCUSDT-future",
      "time": "2022-01-19T21:00:00.000000000Z",
      "liquidations_reported_future_buy_usd_5m": "46294.99528"
    }
  ]
}
curl --compressed "https://api.coinmetrics.io/v4/timeseries/market-metrics?markets=coinbase-btc-usd-spot&metrics=liquidity_depth_2_percent_ask_volume_units&frequency=1h&limit_per_market=1&api_key=<your_key>"

Examples

A sample of the Order Book Depth, 2 Percent From Midprice, Ask, Native Units for the Coinbase BTC-USD spot market is shown below:

{
  "data" : [ {
    "market" : "coinbase-btc-usd-spot",
    "time" : "2023-05-04T20:00:00.000000000Z",
    "liquidity_depth_2_percent_ask_volume_units" : "9866859.984315595"
  }, {
    "market" : "coinbase-btc-usd-spot",
    "time" : "2023-05-04T21:00:00.000000000Z",
    "liquidity_depth_2_percent_ask_volume_units" : "10170729.085314134"
  }, {
    "market" : "coinbase-btc-usd-spot",
    "time" : "2023-05-04T22:00:00.000000000Z",
    "liquidity_depth_2_percent_ask_volume_units" : "10909944.294472648"
  }, {
    "market" : "coinbase-btc-usd-spot",
    "time" : "2023-05-04T23:00:00.000000000Z",
    "liquidity_depth_2_percent_ask_volume_units" : "10983104.902848331"
  }, {
    "market" : "coinbase-btc-usd-spot",
    "time" : "2023-05-05T00:00:00.000000000Z",
    "liquidity_depth_2_percent_ask_volume_units" : "11103789.859471431"
  } ]
}
  • market: The id of the markets.

  • time: The time in ISO 8601 date-time format.

  • liquidity_depth_2_percent_bid_volume_usd: The sum of all bid orders with price within 2 percent from midprice in native units.

Frequently Asked Questions

Why are some of the values for some order book depth metrics and observations missing?

Coin Metrics calculates order book depth metrics from order book snapshots obtained from centralized exchanges. Coin Metrics will obtain the deepest and most complete order book snapshot that the exchange offers — however, the order book depth allowed varies by exchange.

If the order book depth for a market is insufficient to calculate a particular order book depth metric at X% from midprice, Coin Metrics will assign a null value to the observation. The null value was chosen instead of using the available depth to calculate a value (even if the order book depth is insufficient to calculate a value at X% from midprice) to provide transparecy to the user that the order book depth is too shallow. If a non-null value is desired, it is recommended to select a metric with a smaller X% from midprice.

For more information on the available order book depth by exchange, please see Are there any limitations to the order book depth provided by each exchange? Please note that some exchanges only provide an order book with very shallow depth, such as the top 100 levels. Therefore, a large number of nulls can be expected from markets from these exchanges.

How often are the metrics calculated?

The depth metrics are calculated once an hour.

Release History

  • Release Version. Market Data Feed v2.8 on May 2023.

Last updated

Was this helpful?