calculate avg price across time
Returns DEX trades on Ethereum and BNB Chain, where base currency is 0x07e5…Ee36, quote currency is 0xbb4C…095c and smart contract address is 0xdd81…bd71: minute and quote price.
What it returns
- minute
- quote price
Filters
- base currency is 0x07e5…Ee36
- quote currency is 0xbb4C…095c
- smart contract address is 0xdd81…bd71
- exchange name is Pancake v2
The query
{
ethereum(network: bsc) { # change as needed
dexTrades(
# date: {since: "2022-01-01"}
baseCurrency: {is: "0x07e551E31A793E20dc18494ff6b03095A8F8Ee36"} # token traded to
quoteCurrency: {is: "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c"} # token traded from
exchangeName: {in: ["Pancake v2"]} # the protocol you want to check
smartContractAddress: {is: "0xdd8124318d3dbfb486b4d9fbaba8a97409eebd71"} #the liquidity pool
height: {lteq: 16967666, gteq: 16960000} #lteq is the maximum block (when the trade happened) gteq is the lowest block you want to check from
) {
timeInterval {
minute(format: "%FT%TZ", count: 60) #count is the number of minutes
}
price: quotePrice(calculate: maximum) # the maximum price across the "count" time period
}
}
}
Similar queries
- Latest DODO DEX swaps on BSC · BNB Chain · DEXTrades
- Top DODO liquidity pools by 24h volume on BSC · BNB Chain · DEXTrades
- trades · Ethereum · DEXTrades
- metric_v1_bsc · BNB Chain · DEXTrades
- bsc_tessera · BNB Chain · DEXTrades