Quotes
Last updated
Was this helpful?
Last updated
Was this helpful?
Quotes consist of the best bid and the best ask for a market at a given point in time. The best bid represents the highest price that a buyer is willing to pay for one unit of the base asset for a spot market or one contract for a derivatives market. The best ask represents the lowest price that a seller is willing to sell.
Coin Metrics collects quotes representing the best bid order and best ask order residing at the top of the order book for individual markets like coinbase-btc-usd-spot
. To calculate our pair quotes, we aggregate the quotes across a selection of high-quality constituent markets to derive quotes for a pair like btc-usd
. To calculate our asset quotes, we aggregate the quotes across a selection of high-quality constituent markets to derive quotes for an asset like btc
.
Our quotes are conceptually similar to the National Best Bid Offer (NBBO), a regulation issued by the United States Securities and Exchange Commission that requires brokers to execute customer trades at the best available price.
Quotes data is derived from our order book snapshot data by extracting the best bid and best ask. We serve quotes data through a separate endpoint as a convenience for users.
Coin Metrics stores three types of order book snapshots. One type consists of a snapshot of the top 100 bids and top 100 asks taken once every 10 seconds for major markets. The second type includes all levels where the price is within 10 percent of the midprice taken once every 10 seconds. The third type 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. Quotes derived from these snapshots are served through our HTTP API endpoint .
Coin Metrics also serves quotes in real-time for major markets through our websocket API endpoint .
For more information about our quotes data, please reference our page.
Market quotes can be accessed using the timeseries/market-quotes
and timeseries-stream/market-quotes
for markets.
market
: The id of the market. Market ids use the following naming convention: exchangeName-baseAsset-quoteAsset-spot
for spot markets, exchangeName-futuresSymbol-future
for futures markets, and exchangeName-optionsSymbol-option
for options markets.
time
: The exchange-reported time in ISO 8601 date-time format.\
coin_metrics_id
: Unique identifier of the order snapshot.\
ask_price
: The price of the ask on the order book in units of the quote currency.\
ask_size
: The size of the ask on the order book in units of the base asset for a spot market or number of contracts for a derivatives market.\
bid_price
: The price of the bid on the order book in units of the quote currency.\
bid_size
: The size of the bid on the order book in units of the base asset for a spot market or number of contracts for a derivatives market.
CM MDF v1.0 on April 2019: Quotes for major btc-usd
and eth-usd
markets. \
CM MDF v1.0 on July 30, 2019: Added support for websocket endpoint which serves quotes in real-time. \
The previous 24 hours of quotes data is available through our Community API. Community data is available via HTTP API only and is limited to 10 API requests per 6 seconds per IP address. All of our order book data is available through our professional API with higher rate limits.
Our coverage universe is expanding rapidly. Please contact us at info@coinmetrics.io for the latest quotes coverage.
Our /timeseries-stream/pair-quotes
endpoints supports multiple aggregation methods to aggregate the quotes data from individual constituent markets for a given pair. The different aggregation methods can be specified using the aggregation_method
parameter.
Currently, only the aggregated_spread
method is implemented, and alternative methods will be implemented in the future.
The aggregated_spread
method uses the following methodology:
For a given pair, select major spot markets where the market contains the given pair. For each market i, calculate the bid ask spread in percentage terms and the midprice:
Calculate the weighted-average bid-ask spread and weighted-average midprice where the weight is determined by Volume_i, the cumulative volume over some time period [t-1, t] on market i. The advantage of using a trailing volume as opposed to other volume measures, such as order size at the top of the book, is that volume indicates the real contribution of a given exchange to the market. Using order sizes from the book would allow for the random behavior of market participants to bias the aggregate in a way that does not represent the actual contribution of an exchange to the broader crypto market. Using these weights will measure the trading activity actually realized on a market at a given spread. In this way, the volume-weighted spread (as opposed to size-weighted spread) will indicate the spread that is realized via real volume for a given asset or asset-pair.
Using weighted-average midprice and weighted-average spread, calculate the aggregated bid and aggregated ask. The aggregated bid amount and aggregated ask amount are the sum of bid amounts and ask amounts from major markets, respectively.
Pair quotes can be accessed using the timeseries-stream/pair-quotes
endpoints.
time
: The exchange-reported time in ISO 8601 date-time format. Always with nanoseconds precision.\
pair
: The id of the pair.\
ask_price
: The price of the ask order in units of the quote currency as determined by the aggregation method.\
ask_size
: The size of the ask order in units of the base asset as determined by the aggregation method.\
bid_price
: The price of the bid order in units of the quote currency as determined by the aggregation method.\
bid_size
: The size of the bid order in units of the base asset as determined by the aggregation method.\
mid_price
: The average of the ask_price
and bid_price
.\
spread
: The bid-ask spread in raw units.\
cm_sequence_id
: The sequence id number of the websocket message.
Our /timeseries-stream/asset-quotes
endpoint supports multiple aggregation methods to aggregate the quotes data from individual constituent markets for a given asset. The different aggregation methods can be specified using the aggregation_method
parameter.
Asset quotes can be accessed using the /timeseries-stream/asset-quotes
endpoint.
time
: The exchange-reported time in ISO 8601 date-time format. Always with nanoseconds precision.\
asset
: The id of the asset.\
ask_price
: The price of the ask order in units of the quote currency as determined by the aggregation method.\
ask_size
: The size of the ask order in units of the base asset as determined by the aggregation method.\
bid_price
: The price of the bid order in units of the quote currency as determined by the aggregation method.\
bid_size
: The size of the bid order in units of the base asset as determined by the aggregation method.\
mid_price
: The average of the ask_price
and bid_price
.\
spread
: The bid-ask spread in raw units.\
cm_sequence_id
: The sequence id number of the websocket message.
Coin Metrics performed an analysis of the distribution of volume across markets with different quote currencies and selected all major quote currencies such that we capture over 95 percent of the available volume for each asset. The selected quote currencies are: usd
, usdt
, usdc
, busd
, eur
, try
.
All markets from trusted exchanges for which the given asset is the base asset and the quote asset is listed above are selected.
Our websocket API will send a new message once every 250 milliseconds.
CM Market Data Feed v2.8 on May 2023.
The asset quotes are currently available for the following assets: btc
, eth
, ltc
, xrp
, bnb
, usdt
, trx
link
, doge
, usdc
, ada
, atom
, matic
, dai
, sol
, dot
, avax
, uni
.
An sample of the quotes data the coinbase-btc-usd-spot
market from our API endpoint is provided below.
Since our quotes data is derived from our order book data, please reference our page for many frequently asked questions about order book data.
: Expanded coverage universe to include cex.io-btc-usd
and bitflyer-btc-spot
.\
: Expanded our coverage universe to additional markets on Coinbase, Binance, FTX, Bitfinex, itBit. \
: Expanded our coverage universe to additional spot markets on Binance, Binance.US, Bitfinex, bitFlyer, Bitstamp, Bittrex, CEX.io, Coinbase, FTX, Gemini, Huobi, itBit, Kraken, Kucoin, Liquid, and LMAX. Initiated coverage of futures markets on Binance, Bitfinex, bitFlyer, BitMEX, Bybit, Deribit, FTX, Huobi, Kraken, OKEx. Initiated real-time coverage of CME market quotes.
: Expanded our market coverage to include every single market, both spot and futures, on the following 12 exchanges: Binance, Binance.US, Bybit, Coinbase, Deribit, FTX, FTX.US, Gemini, HitBTC, Huobi, Kraken, OKEx. Began storing every single quote update in flat files starting in February 2022, suitable for any use cases that require historical data.
Currently, only the method is implemented, and alternative methods will be implemented in the future.
Coin Metrics uses our to seelct a set of high-quality and trustworthy exchanges in selection of our constituent markets. The set of exchanges includes Bitstamp
, Coinbase
, Bitfinex
, Binance
, Gemini
, Kraken
, OKEx
, Huobi
, Binance.US
, KuCoin
, LMAX
, and Bybit
.
Returns quotes for specified markets. Results are ordered by tuple (market, time)
. To fetch the next page of results use next_page_url
JSON response field.
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.
Downsampling granularity of market order books and quotes. Supported values are raw
, 1m
, 1h
, and 1d
.
raw
Available options: 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 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.
Inclusive or exclusive corresponding start_*
parameters.
true
Inclusive or exclusive corresponding end_*
parameters.
true
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.
UTC
Example: America/New_York
Format of the response. Supported values are json
, json_stream
.
json
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
.
100
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
.
end
Available options: How many entries per market result should contain. It is useful when multiple markets are requested.
Human-readable formatting of JSON responses.
false
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.
Include one-side and empty books in quotes response.
false
Returns a stream of quotes for specified pairs. If you are falling behind (slow client) you will get warning
message first, then error
message and disconnection will happen.
Comma separated list of asset pairs or patterns like btc-*
, or *-btc
. Use the /catalog-all/pairs endpoint for the full list of supported asset pairs.
The method to use for aggregation.
aggregated_spread
What data should be sent upon a connection. By default the latest values are sent just before real-time data.
latest
Available options: Human-readable formatting of JSON responses.
false
No content
Returns a stream of quotes for specified assets. If you are falling behind (slow client) you will get warning
message first, then error
message and disconnection will happen.
Comma separated list of assets. Use the /catalog-all/assets endpoint for the full list of supported assets.
The method to use for aggregation.
aggregated_spread
What data should be sent upon a connection. By default the latest values are sent just before real-time data.
latest
Available options: Human-readable formatting of JSON responses.
false
No content