Skip to content

Instantly share code, notes, and snippets.

@buddies2705

buddies2705/DEX_OHLC.ql

Last active Oct 16, 2020
Embed
What would you like to do?
OHLC data for currency pair on DEX
{
ethereum(network: ethereum) {
dexTrades(options: {limit: 10, asc: "timeInterval.minute"},
protocol: {is: "Uniswap v2"},
date: {is: "2020-10-10"}
buyCurrency: {is: "0xdac17f958d2ee523a2206206994597c13d831ec7"},
sellCurrency: {is: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"}) {
timeInterval {
minute(count: 5)
}
buyCurrency {
symbol
address
}
buyAmount
sellCurrency {
symbol
address
}
sellAmount
trades: count
maximum_price: price(calculate: maximum)
minimum_price: price(calculate: minimum)
open_price: minimum(of: block, get: price)
close_price: maximum(of: block, get: price)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.