For the complete documentation index, see llms.txt. This page is also available as Markdown.

Aggregating Orderbook Depth to Create Liquidity Metrics

A liquid order book (the collection of outstanding bids and asks for a market) is a necessary component of a mature financial asset. The ability to quickly enter and exit large positions with a small degree of price impact, or slippage, is a desirable feature for institutional market participants. Coin Metrics has been collecting order book snapshots for major crypto assets since 2019, and recently launched new liquidity metrics as part of our Market Data Feed offering to further enhance institutions’ view of the crypto markets. In this demo, we explore how these metrics can be used to quantify and aggregate order book depth across some of the most actively-traded BTC markets.

Resources

This notebook demonstrates basic functionality offered by the Coin Metrics Python API Client and Market Data Feed.

Coin Metrics offers a vast assortment of data for hundreds of cryptoassets. The Python API Client allows for easy access to this data using Python without needing to create your own wrappers using requests and other such libraries.

To understand the data that Coin Metrics offers, feel free to peruse the resources below.

  • The Coin Metrics API v4 website contains the full set of endpoints and data offered by Coin Metrics.

  • The Coin Metrics Product Documentation gives detailed, conceptual explanations of the data that Coin Metrics offers.

  • The API Spec contains a full list of functions.

File Download

Download the entire notebook as either a jupyter notebook to run yourself or as a pdf from the two links below

Open

Notebook Setup

market
exchange
base
quote
pair
symbol
type
size_asset
margin_asset
strike
...
order_amount_min
order_amount_max
order_price_increment
order_price_min
order_price_max
order_size_min
order_taker_fee
order_maker_fee
margin_trading_enabled
experimental

0

bibox-btc-gusd-spot

bibox

btc

gusd

btc-gusd

BTC_GUSD

spot

<NA>

<NA>

<NA>

...

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

1

bibox-btc-sai-spot

bibox

btc

sai

btc-sai

BTC_SAI

spot

<NA>

<NA>

<NA>

...

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

2

bibox-btc-usdc-spot

bibox

btc

usdc

btc-usdc

BTC_USDC

spot

<NA>

<NA>

<NA>

...

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

3

bibox-btc-usdt-spot

bibox

btc

usdt

btc-usdt

BTC_USDT

spot

<NA>

<NA>

<NA>

...

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

4

binance-btc-aeur-spot

binance

btc

aeur

btc-aeur

BTCAEUR

spot

<NA>

<NA>

<NA>

...

0.00001

9000.0

0.01

0.01

1000000

5.0

<NA>

<NA>

<NA>

<NA>

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

393

upbit-btc-usdt-spot

upbit

btc

usdt

btc-usdt

USDT-BTC

spot

<NA>

<NA>

<NA>

...

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

394

zb.com-btc-pax-spot

zb.com

btc

pax

btc-pax

btc_pax

spot

<NA>

<NA>

<NA>

...

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

395

zb.com-btc-qc-spot

zb.com

btc

qc

btc-qc

btc_qc

spot

<NA>

<NA>

<NA>

...

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

396

zb.com-btc-usdc-spot

zb.com

btc

usdc

btc-usdc

btc_usdc

spot

<NA>

<NA>

<NA>

...

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

397

zb.com-btc-usdt-spot

zb.com

btc

usdt

btc-usdt

btc_usdt

spot

<NA>

<NA>

<NA>

...

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

398 rows × 37 columns

market
exchange
base
quote
pair
symbol
type
size_asset
margin_asset
strike
...
order_amount_min
order_amount_max
order_price_increment
order_price_min
order_price_max
order_size_min
order_taker_fee
order_maker_fee
margin_trading_enabled
experimental

0

bibox-btc-gusd-spot

bibox

btc

gusd

btc-gusd

BTC_GUSD

spot

<NA>

<NA>

<NA>

...

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

1

bibox-btc-sai-spot

bibox

btc

sai

btc-sai

BTC_SAI

spot

<NA>

<NA>

<NA>

...

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

2

bibox-btc-usdc-spot

bibox

btc

usdc

btc-usdc

BTC_USDC

spot

<NA>

<NA>

<NA>

...

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

3

bibox-btc-usdt-spot

bibox

btc

usdt

btc-usdt

BTC_USDT

spot

<NA>

<NA>

<NA>

...

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

4

binance-btc-aeur-spot

binance

btc

aeur

btc-aeur

BTCAEUR

spot

<NA>

<NA>

<NA>

...

0.00001

9000.0

0.01

0.01

1000000

5.0

<NA>

<NA>

<NA>

<NA>

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

393

upbit-btc-usdt-spot

upbit

btc

usdt

btc-usdt

USDT-BTC

spot

<NA>

<NA>

<NA>

...

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

394

zb.com-btc-pax-spot

zb.com

btc

pax

btc-pax

btc_pax

spot

<NA>

<NA>

<NA>

...

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

395

zb.com-btc-qc-spot

zb.com

btc

qc

btc-qc

btc_qc

spot

<NA>

<NA>

<NA>

...

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

396

zb.com-btc-usdc-spot

zb.com

btc

usdc

btc-usdc

btc_usdc

spot

<NA>

<NA>

<NA>

...

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

397

zb.com-btc-usdt-spot

zb.com

btc

usdt

btc-usdt

btc_usdt

spot

<NA>

<NA>

<NA>

...

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

398 rows × 37 columns

market
exchange
base
quote
pair
symbol
type
size_asset
margin_asset
strike
...
order_amount_min
order_amount_max
order_price_increment
order_price_min
order_price_max
order_size_min
order_taker_fee
order_maker_fee
margin_trading_enabled
experimental

2

bibox-btc-usdc-spot

bibox

btc

usdc

btc-usdc

BTC_USDC

spot

<NA>

<NA>

<NA>

...

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

3

bibox-btc-usdt-spot

bibox

btc

usdt

btc-usdt

BTC_USDT

spot

<NA>

<NA>

<NA>

...

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>

10

binance-btc-busd-spot

binance

btc

busd

btc-busd

BTCBUSD

spot

<NA>

<NA>

<NA>

...

0.00001

9000.0

0.01

0.01

1000000

10.0

<NA>

<NA>

<NA>

<NA>

27

binance-btc-usdc-spot

binance

btc

usdc

btc-usdc

BTCUSDC

spot

<NA>

<NA>

<NA>

...

0.00001

9000.0

0.01

0.01

1000000

5.0

<NA>

<NA>

<NA>

<NA>

30

binance-btc-usdt-spot

binance

btc

usdt

btc-usdt

BTCUSDT

spot

<NA>

<NA>

<NA>

...

0.00001

9000.0

0.01

0.01

1000000

5.0

<NA>

<NA>

<NA>

<NA>

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

389

therocktrading-btc-usdc-spot

therocktrading

btc

usdc

btc-usdc

BTCUSDC

spot

<NA>

<NA>

<NA>

...

<NA>

<NA>

<NA>

<NA>

<NA>

<NA>