Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
TradingView#1 -- The GraphQL query
const QUERY = `
{
ethereum(network: ethereum) {
dexTrades(
options: {limit: 100, asc: "timeInterval.minute"}
date: {since: "2021-05-23"}
exchangeName: {is: "Uniswap"}
baseCurrency: {is: "0x910985ffa7101bf5801dd2e91555c465efd9aab3"}
quoteCurrency: {is: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"}
) {
timeInterval {
minute(count: 5)
}
baseCurrency {
symbol
address
}
baseAmount
quoteCurrency {
symbol
address
}
quoteAmount
trades: count
quotePrice
maximum_price: quotePrice(calculate: maximum)
minimum_price: quotePrice(calculate: minimum)
open_price: minimum(of: block, get: quote_price)
close_price: maximum(of: block, get: quote_price)
}
}
}
`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment