Examining Orderbook Depth
Last updated
Last updated
Exchange order book data is one of the most foundational data types in the crypto asset industry— arguably, even more foundational than trades data, as two orders must be matched for a trade to occur. Order book data is useful for various entities, including market makers, systematic or quantitative traders, and funds studying trade execution patterns. The Coin Metrics Market Data Feed offering includes various API endpoints that allow users to retrieve order book snapshots and updates across a collection of top crypto exchanges.
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.
Download the entire notebook as either a jupyter notebook to run yourself or as a pdf from the two links below
Coin Metrics collects and serves 3 types of order book snapshots.
One type (depth_limit=100) consists of a snapshot of the top 100 bids and top 100 asks taken once every 10 seconds for major markets.
The second type (depth_limit=10pct_mid_price) includes all levels where the price is within 10 percent of the midprice taken once every 10 seconds.
The third type (depth_limit=full_book) consists of a full order book snapshot (every bid and every ask) taken once every hour for all markets that we are collecting order book data for . All of these snapshots are served through our HTTP API endpoint /timeseries/market-orderbooks.
6640 rows × 6 columns
market | time | coin_metrics_id | asks | bids | database_time | |
---|---|---|---|---|---|---|
size_ntv | size_usd | side | time | pct_from_best | rolling_3hr_usd | |
---|---|---|---|---|---|---|
163
coinbase-btc-usd-spot
2022-10-26 19:00:00+00:00
48876152429
[{'price': '20682.21', 'size': '0.001'}, {'pri...
[{'price': '20680.45', 'size': '0.01098864'}, ...
2022-10-26 19:02:04.331554+00:00
164
coinbase-btc-usd-spot
2022-10-26 20:00:00+00:00
48880595574
[{'price': '20777.57', 'size': '0.00182293'}, ...
[{'price': '20776.49', 'size': '0.01019999'}, ...
2022-10-26 20:01:16.705315+00:00
165
coinbase-btc-usd-spot
2022-10-26 21:00:00+00:00
48885094324
[{'price': '20748.12', 'size': '0.004'}, {'pri...
[{'price': '20747.05', 'size': '0.00207858'}, ...
2022-10-26 21:00:31.916195+00:00
166
coinbase-btc-usd-spot
2022-10-26 22:00:00+00:00
48888140842
[{'price': '20741.88', 'size': '0.47814895'}, ...
[{'price': '20741.87', 'size': '0.00007231'}, ...
2022-10-26 22:02:24.185607+00:00
167
coinbase-btc-usd-spot
2022-10-26 23:00:00+00:00
48892147093
[{'price': '20819.81', 'size': '0.03138949'}, ...
[{'price': '20817.37', 'size': '0.09902'}, {'p...
2022-10-26 23:01:42.564517+00:00
0.01
-77.155769
-1.470296e+06
asks
2022-10-20 02:00:00+00:00
0.01
-1.105986e+06
0.01
-66.058756
-1.259527e+06
asks
2022-10-20 03:00:00+00:00
0.01
-1.295243e+06
0.01
-126.462072
-2.409340e+06
asks
2022-10-20 04:00:00+00:00
0.01
-1.713054e+06
0.01
-230.090826
-4.417017e+06
asks
2022-10-20 05:00:00+00:00
0.01
-2.695295e+06
0.01
-67.504299
-1.292230e+06
asks
2022-10-20 06:00:00+00:00
0.01
-2.706196e+06
...
...
...
...
...
...
...
1.91
3.150618
6.389480e+04
bid
2022-10-26 19:00:00+00:00
1.91
4.899971e+04
1.91
0.284205
5.790217e+03
bid
2022-10-26 20:00:00+00:00
1.91
4.139945e+04
1.91
2.058624
4.189135e+04
bid
2022-10-26 21:00:00+00:00
1.91
3.719212e+04
1.91
1.328615
2.703422e+04
bid
2022-10-26 22:00:00+00:00
1.91
2.490526e+04
1.91
0.243678
4.974376e+03
bid
2022-10-26 23:00:00+00:00
1.91
2.463332e+04