multiple tokens volume and SMA
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 ID
- token name
- token symbol
- mean
- sum of volume USD
Filters
- token ID is bid:solana:Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB or bid:solana:BKQucpTXB2d67jSNXMznSTj2iNLVtyga9JW86QoWpump
- time duration is 3600
- 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: 3600}, Start: {since_relative: {days_ago: 28}}}},
Token: {Id: {in: ["bid:solana:Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB", "bid:solana:BKQucpTXB2d67jSNXMznSTj2iNLVtyga9JW86QoWpump"]}}
}
) {
Token {
Id
Name
Symbol
}
Price {
Average {
currentPrice: Mean(maximum: Block_Time)
H1Ago: Mean(
minimum: Block_Time
if: {Block: {Time: {since_relative: {hours_ago: 1}}}}
)
H4Ago: Mean(
minimum: Block_Time
if: {Block: {Time: {since_relative: {hours_ago: 4}}}}
)
H24Ago: Mean(
minimum: Block_Time
if: {Block: {Time: {since_relative: {hours_ago: 24}}}}
)
}
}
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)
}
}
TokenAsQuote: Trading {
Pairs(
where: {Interval: {Time: {Duration: {eq: 1}, Start: {since_relative: {days_ago: 0}}}}, Token: {Id: {in: ["bid:solana:Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB", "bid:solana:BKQucpTXB2d67jSNXMznSTj2iNLVtyga9JW86QoWpump"]}}}
) {
Token {
Id
Name
Symbol
}
Price {
Average {
currentPrice: Mean(maximum: Block_Time)
H1Ago: Mean(
minimum: Block_Time
if: {Block: {Time: {since_relative: {hours_ago: 1}}}}
)
H4Ago: Mean(
minimum: Block_Time
if: {Block: {Time: {since_relative: {hours_ago: 4}}}}
)
H24Ago: Mean(
minimum: Block_Time
if: {Block: {Time: {since_relative: {hours_ago: 24}}}}
)
}
}
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