BSC OHLC API For Token Pair
Historical data This query uses the realtime dataset (the default), which holds only a recent window - hours to days depending on the cube. For older data add a dataset to the top-level element: EVM(network: bsc, dataset: combined) archive full history combined archive + realtime in one result Ar
What it returns
- block time
- quantile of trade price in USD
- average of trade price in USD
- sum of trade side amount in USD
Filters
- side currency smart contract is 0x55d3…7955
- currency smart contract is 0xbb4c…095c
- side amount is above 0
The query
# Historical data
# This query uses the realtime dataset (the default), which holds only a
# recent window - hours to days depending on the cube.
#
# For older data add a dataset to the top-level element:
#
# EVM(network: bsc, dataset: combined)
#
# archive full history
# combined archive + realtime in one result
#
# Archive and combined need the historical data add-on:
# https://bitquery.io/pricing
#
# Datasets: https://docs.bitquery.io/docs/graphql/dataset/archive/
# Retention: https://docs.bitquery.io/docs/graphql/data-coverage-retention/
#
query tradingViewPairs {
EVM(network: bsc, dataset: realtime) {
DEXTradeByTokens(
orderBy: {ascendingByField: "Block_Time"}
where: {TransactionStatus: {Success: true}, Trade: {Side: {Amount: {gt: "0"}, Currency: {SmartContract: {is: "0x55d398326f99059ff775485246999027b3197955"}}}, Currency: {SmartContract: {is: "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c"}}, Success: true}}
limit: {count: 10}
) {
Block {
Time(interval: {count: 60, in: seconds})
}
min: quantile(of: Trade_PriceInUSD, level: 0.1)
max: quantile(of: Trade_PriceInUSD, level: 0.9)
close: average(of: Trade_PriceInUSD)
open: average(of: Trade_PriceInUSD)
volume: sum(of: Trade_Side_AmountInUSD)
}
}
}
Similar queries
- bStocks 3am: QQQB 30-day DEX volume · BNB Chain · DEXTradeByTokens
- bStocks 3am: tokenized Tesla 30-day volume · BNB Chain · DEXTradeByTokens
- bsc token ohlcv · BNB Chain · DEXTradeByTokens
- optimized query to get pools data · Ethereum · DEXTradeByTokens
- KTI_primeiros_trades · BNB Chain · DEXTradeByTokens