looking to get Last, 24h, 7d, prices for a contract in a single query. I’d love to not request a full week’s worth of trades to get it. I can see how to get Last and 7d in a single query (minimum, maximum) but the 24h one is tripping me up
is it possible?
here is what I have so far:
{
ethereum(network: ethereum)
{
dexTrades(
options: { desc: ["trades"], limit: 2, limitBy: { each: "sellCurrency.address", limit: 1 },
offset: 0 },
date: { since: "2021-06-01" till: "2021-06-08" }
sellCurrency: { in: ["0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0"] }
buyCurrency: { in: ["0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"] })
{
trades: count
exchange {
fullName
}
sellCurrency {
address
symbol
}
buyCurrency {
address
symbol
}
ago7d_price: minimum(of: time, get: price)
close_price: maximum(of: time, get: price)
}
}
}