Skip to content

Instantly share code, notes, and snippets.

@buddies2705
Last active April 3, 2022 10:40
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save buddies2705/0cfed972b7317f73e3ac58ac35a87801 to your computer and use it in GitHub Desktop.
Save buddies2705/0cfed972b7317f73e3ac58ac35a87801 to your computer and use it in GitHub Desktop.
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