Average quote price for a given date and range

Provides the average quote price given a base token (e.g. TOSA), connector token (e.g. WETH) and the quote token (e.g. USD) between a range of datetimes.

By Adam · saved 16 February 2023 · run 4 times · Bitquery API v1

What it returns

Filters

The query

query ($startTime: ISO8601DateTime!, $endTime: ISO8601DateTime!, $baseAddress: String!,
$quoteAddress: String!, $connector1: String!,$interval: Int,$minAmount: Float){
ethereum(network: ethereum){
dexTrades(
any: [
{
baseCurrency: {is: $baseAddress}
quoteCurrency: {is: $quoteAddress}
},
{
baseCurrency: {is: $baseAddress}
quoteCurrency: {is: $connector1}
},
{
baseCurrency: {is: $connector1}
quoteCurrency: {is: $quoteAddress}
}
]
time: {between: [$startTime, $endTime]}
tradeAmountUsd: {gt: $minAmount}
){
timeInterval {
minute(format: "%FT%TZ", count: $interval)
}
buyCurrency: baseCurrency {
symbol
address
}
buyAmount: baseAmount
buyAmountInUsd: baseAmount
sellCurrency: quoteCurrency {
symbol
address
}
sellAmountInUsd: quoteAmount
tradeAmount(in: USD)
volume: quoteAmount
trades: count
high: quotePrice(calculate: maximum)
low: quotePrice(calculate: minimum)
open: minimum(of: block, get: quote_price)
close: maximum(of: block, get: quote_price)
}}
}

Variables

{"startTime":"2023-01-29T01:00:00", "endTime":"2023-01-29T01:05:00","interval": 5,"baseAddress":"0x9053bfb430a021bbd9958fa1d663063e4abe17ee","quoteAddress":"0xdac17f958d2ee523a2206206994597c13d831ec7","connector1":"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2","minAmount": 10}

Similar queries