volume of a token
Historical data The Trading cube covers real time and roughly the last 30 days. For anything older, rebuild the same numbers from raw trades with DEXTradeByTokens. Datasets: https://docs.bitquery.io/docs/graphql/dataset/archive/ Retention: https://docs.bitquery.io/docs/graphql/data-coverage-retenti
What it returns
- token name
- token symbol
- token ID
- mean
- calculate
- sum of volume USD
Filters
- token ID is bid:solana:CZzgUBvxaMLwMhVSLgqJn3npmxoTo6nzMNQPAnwtHF3s, bid:eth:0xfaf0cee6b20e2aaa4b80748a6af4cd89609a3d78 or 2 more
- market protocol is not jupiter or dex_solana_v3
- time duration is 1
The query
# Historical data
# The Trading cube covers real time and roughly the last 30 days. For
# anything older, rebuild the same numbers from raw trades with
# DEXTradeByTokens.
#
# Datasets: https://docs.bitquery.io/docs/graphql/dataset/archive/
# Retention: https://docs.bitquery.io/docs/graphql/data-coverage-retention/
#
# For more info on the endpoint visit -
# https://docs.bitquery.io/docs/trading/crypto-price-api/introduction/
# For faster results try using indexed feilds in where and orderBy clause -
# https://docs.bitquery.io/docs/graphql/indexed-fields-reference/
{
TokenAsBase: Trading {
Pairs(
where: {Interval: {Time: {Duration: {eq: 1}, Start: {since_relative: {hours_ago: 24}}}}, Price: {IsQuotedInUsd: true}, Token: {Id: {in: ["bid:solana:CZzgUBvxaMLwMhVSLgqJn3npmxoTo6nzMNQPAnwtHF3s", "bid:eth:0xfaf0cee6b20e2aaa4b80748a6af4cd89609a3d78", "bid:bsc:0xfaf0cee6b20e2aaa4b80748a6af4cd89609a3d78", "bid:tron:TXL6rJbvmjD46zeN1JssfgxvSo99qC8MRT"]}}, Market: {Protocol: {notIn: ["jupiter", "dex_solana_v3"]}}}
) {
Token {
Name
Symbol
Id
}
Price {
Average {
currentPrice: Mean(maximum: Block_Time)
H1Ago: Mean(
maximum: Block_Time
if: {Block: {Time: {till_relative: {hours_ago: 1}}}}
)
H4Ago: Mean(
maximum: Block_Time
if: {Block: {Time: {till_relative: {hours_ago: 4}}}}
)
H24Ago: Mean(
minimum: Block_Time
if: {Block: {Time: {after_relative: {hours_ago: 24}}}}
)
}
}
Price_change_1h: calculate(
expression: "( ( $Price_Average_currentPrice - $Price_Average_H1Ago ) / $Price_Average_H1Ago ) * 100"
)
Price_change_4h: calculate(
expression: "( ( $Price_Average_currentPrice - $Price_Average_H4Ago ) / $Price_Average_H4Ago ) * 100"
)
Price_change_24h: calculate(
expression: "( ( $Price_Average_currentPrice - $Price_Average_H24Ago ) / $Price_Average_H24Ago ) * 100"
)
v1h: sum(of: Volume_Usd, if: {Block: {Time: {since_relative: {hours_ago: 1}}}})
v4h: sum(of: Volume_Usd, if: {Block: {Time: {since_relative: {hours_ago: 4}}}})
v24h: sum(of: Volume_Usd)
}
}
}
Similar queries
- Elysium pair OHLC candles (WHYPE/USDC, 5 min) · Trading (all chains) · Pairs
- Elysium top trading pairs by USD volume, 24h · Trading (all chains) · Pairs
- arc mainnet minara pool price · Trading (all chains) · Pairs
- Arc Mainnet Trading: Latest price of a token (v2) · Trading (all chains) · Pairs
- save with commit · Trading (all chains) · Tokens