Example
Usage Guidelines
- Historical aggregate chart data is available back to timestamp 1753121580
- Refer to getBars for additional usage guidelines and troubleshooting tips.
Pricing for aggregate charts will no longer only use the top pair. Weighted average pricing will be used across a token’s top pairs, based on liquidity/recency, while filtering out lower quality pairs from contributing.
Returns: TokenBarsResponse
Arguments
The ID of the pair or token (
pairAddress:networkId
or tokenAddress:networkId
). If a token contract address is provided, the token’s top pair is used. For example, 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2:1
returns WETH’s top pair on Ethereum.The unix timestamp for the start of the requested range.
The unix timestamp for the end of the requested range.
The time frame for each candle. Available options are
1S
, 5S
, 15S
, 30S
, 1
, 5
, 15
, 30
, 60
, 240
, 720
, 1D
, 7D
. Resolutions lower than 1 minute are only updated for the last 24 hours due to the volume of data produced.The currency to use for the response. Can be
USD
or TOKEN
. Default is USD
. Use currencyCode: TOKEN
for native token pricing.Whether to remove leading null values from the response. Default is
false
. To fetch a token’s entire history, set resolution to 1D
, from
value to 0
and removeLeadingNullValues
to true
.Whether to remove empty bars from the response. This is useful for eliminating gaps in low-activity tokens. Default is
false
.The type of statistics returned. Can be
FILTERED
or UNFILTERED
. Default is UNFILTERED
.Guarantees number of bars returned is at most this number. Use
countback: 1500
with from: 0
for maximum results.