Candles
Last updated
Was this helpful?
Last updated
Was this helpful?
Candles consist of summary statistics derived from individual trades that describe the trading activity of a market or pair over an interval of time.
Coin Metrics engineers several statistics based on trades data that occurred over an interval of time: opening price, high price, low price, close price, volume-weighted average price, total volume in base asset units, total volume in U.S. dollars, and number of trades in the interval.
Candles are generated at regular time intervals and at a time granularity that is suitable for charting and analysis. For instance, several technical analysis indicators can be calculated using data in candles format.
We produce our candles at 1m
, 5m
, 10m
, 15m
, 30m
, 1h
, 4h
, 1d
intervals. Our candles are calculated directly from our trades data. We construct gapless candles which means that if there are no trades in a candle interval, we fill forward candles through time, setting the open, high, low, and close to the close of the previous candle, setting the vwap to the vwap of the previous candle, and setting the volume to zero. Candles are calculated in real-time and available immediately after the candle interval is complete.
We calculate candles using trades collected from exchanges rather than collecting candles directly reported from the exchange. This approach offers several advantages, such as allowing us to apply a consistent calculation methodology across exchanges to support cross-exchange analysis, and allows us to generate additional fields that are not typically published by exchanges, such as the volume converted to U.S. dollars, trade count, and volume-weighted average price.
Our market data collection system consists of multiple redundant and resilient applications, ensuring that most data is collected with minimal latency (usually a few hundred milliseconds). However, due to the nature of real-time data collection, some trades may not be collected immediately. When certain trades observations are not collected in real-time, our system backfills missing trades with a short delay (usually a few seconds). Internal metrics show that for most exchanges, we collect 99.9 percent of trades observations within roughly 2 seconds of publication by the exchange.
To address the small number of missing trades and to maintain accuracy, we recalculate the most recent candles 20 minutes after initial publication, and every hour for the next three hours after initial publication.
Coin Metrics calculates candles for spot and future and option markets from exchanges that are listed on our exchange coverage universe.
Candles can be accessed using the timeseries/market-candles
or timeseries/pair-candles
endpoint.
Market Candles
An sample of the candles data from the coinbase-btc-usd-spot
market from our /timeseries/market-candles
API endpoint is provided below.
time
: The time of the beginning of the candle interval in ISO 8601 date-time format.\
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.
price_open
: The opening price of the candle.\
price_high
: The high price of the candle.\
price_low
: The low price of the candle.\
price_close
: The close price of the candle.\
vwap
: The volume-weighted average price of the candle.\
volume
: The volume of the candle in units of the base asset.\
candle_usd_volume
: The volume of the candle in units of U.S. dollars. \
candle_trades_count
: The number of trades in the candle interval.
Pair Candles
An sample of the pair candles data for the btc-usd
pair from our /timeseries/pair-candles
API endpoint is provided below.
time
: The time of the beginning of the candle interval in ISO 8601 date-time format.\
pair
: The id of the pair. \
price_open
: The opening price of the candle.\
price_high
: The high price of the candle.\
price_low
: The low price of the candle.\
price_close
: The close price of the candle.
CM MDF v1.0 on April 2020: Added candles for all spot markets on major exchanges. CM MDF v2.0 on December 9, 2019: Added candles for spot markets on Binance.US. Added candles for futures markets on BitMEX and Huobi.
CM MDF v2.1 on May 5, 2020: Added candles for spot markets on Kucoin and FTX. Added candles for futures markets on Deribit, OKEx, Binance, FTX, and Bitfinex.
CM MDF v2.2 on December 2, 2020: Added candles for futures markets on bitFlyer and Kraken.
CM MDF v2.3 on April 25, 2021: Added candles for spot markets on LMAX. Added candles for futures markets on CME and Bybit.
CM MDF v2.4 on September 1, 2021: Extended candles data for Ethereum futures markets on CME.
The previous 24 hours of trades 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 trades data is available through our professional API with higher rate limits. The professional API supports trades data through both our HTTP API and websocket API.
Our coverage can be found by querying our /catalog/markets
or /catalog-all/markets
API endpoints. Alternatively, you can query our /catalog/exchanges
or /catalog-all/exchanges
API endpoints which contain the same information but organized by exchange. See our coverage pages:
Returns candles for specified markets.<br/> Results are ordered by tuple (market, time)
.<br/> To fetch the next page of results use next_page_url
JSON response field.<br/> Coin Metrics derives candles directly from trades. Candles are only generated if there are trades in the underlying interval. Therefore, gaps in candles data through time are normal and to be expected. To construct gapless candles, the client should fill forward candles through time, setting the open, high, low, and close to the close of the previous candle, setting the vwap to the vwap of the previous candle, and setting the volume to zero.
/timeseries/market-candles
Comma separated list of markets or market patterns like exchange-*
or exchange-*-spot
or *USDT-future
.<br/> Use the /catalog-all/markets endpoint for the full list of supported markets.
Candle duration. Supported values are 1m
, 5m
, 10m
, 15m
, 30m
, 1h
, 4h
, 1d
, 1d-HH:00
.
5m
Start of the time interval.<br/> This field refers to the time
field in the response.<br/> 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
.<br/> Inclusive by default.<br/> UTC timezone by default. Z
suffix is optional and timezone
parameter has a priority over it.<br/> If start_time
is omitted, response will include time series from the earliest time available.
End of the time interval.<br/> This field refers to the time
field in the response.<br/> 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
.<br/> Inclusive by default.<br/> UTC timezone by default. Z
suffix is optional and timezone
parameter has a priority over it.<br/> If end_time
is omitted, response will include time series up to the latest time available.
Inclusive or exclusive corresponding start_*
parameters.
Inclusive or exclusive corresponding end_*
parameters.
Timezone name for start_time
and end_time
timestamps.<br/> This parameter does not modify the output times, which are always UTC
.<br/> Format is defined by TZ database.
America/New_York
Number of items per single page of results.<br/> The value of this parameter is ignored if the endpoint supports the format
parameter and its value is set to json_stream
.
Where does the first page start, at the start of the interval or at the end.
start
, end
How many entries per market result should contain. It is useful when multiple markets are requested.
Human-readable formatting of JSON responses.
Format of the response.
json
, csv
Token for receiving the results from the next page of a query.<br/> Should not be used directly. To iterate through pages just use next_page_url
response field.
Returns candles for specified asset pairs.<br/> Results are ordered by tuple (pair, time)
.<br/> To fetch the next page of results use next_page_url
JSON response field.<br/>
/timeseries/pair-candles
Comma separated list of asset pairs.<br/> Use the /catalog-all/pair-candles endpoint for the full list of supported asset pairs.
Candle duration. Supported values are 1m
, 5m
, 10m
, 15m
, 30m
, 1h
, 4h
, 1d
, 1d-HH:00
.
5m
Start of the time interval.<br/> This field refers to the time
field in the response.<br/> 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
.<br/> Inclusive by default.<br/> UTC timezone by default. Z
suffix is optional and timezone
parameter has a priority over it.<br/> If start_time
is omitted, response will include time series from the earliest time available.
End of the time interval.<br/> This field refers to the time
field in the response.<br/> 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
.<br/> Inclusive by default.<br/> UTC timezone by default. Z
suffix is optional and timezone
parameter has a priority over it.<br/> If end_time
is omitted, response will include time series up to the latest time available.
Inclusive or exclusive corresponding start_*
parameters.
Inclusive or exclusive corresponding end_*
parameters.
Timezone name for start_time
and end_time
timestamps.<br/> This parameter does not modify the output times, which are always UTC
.<br/> Format is defined by TZ database.
America/New_York
Number of items per single page of results.<br/> The value of this parameter is ignored if the endpoint supports the format
parameter and its value is set to json_stream
.
Where does the first page start, at the start of the interval or at the end.
start
, end
How many entries per pair result should contain.
Human-readable formatting of JSON responses.
Format of the response.
json
, csv
Token for receiving the results from the next page of a query.<br/> Should not be used directly. To iterate through pages just use next_page_url
response field.