OHLC by intervals(change interval for test)
Returns 9000 DEX trades by token on Arbitrum, where side currency smart contract is 0xbdbc…dd30, currency smart contract is 0xff97…5cc8 and block date since 2021-01-13, sorted by block time: chain ID, block time, sum of trade amount, trade price, side currency symbol, currency symbol and count.
What it returns
- chain ID
- block time
- sum of trade amount
- trade price
- side currency symbol
- currency symbol
- count
Filters
- side currency smart contract is 0xbdbc…dd30
- currency smart contract is 0xff97…5cc8
- block date since 2021-01-13
- block date till 2024-01-23
- trade price is above 0
The query
query ($network: evm_network, $interval: Int, $from: String, $till: String, $baseCurrency: String, $quoteCurrency: String) {
EVM(network: $network, dataset: combined) {
DEXTradeByTokens(
orderBy: {ascendingByField: "Block_Time"}
where: {Trade: {Side: {Currency: {SmartContract: {is: $baseCurrency}}}, Currency: {SmartContract: {is: $quoteCurrency}}, Price: {gt: 0}}, Block: {Date: {since: $from, till: $till}}}
limit: {count: 9000}
) {
ChainId
Block {
Time(interval: {in: minutes, count: $interval})
}
volume: sum(of: Trade_Amount)
Trade {
high: Price(maximum: Trade_Price)
low: Price(minimum: Trade_Price)
open: Price(minimum: Block_Number)
close: Price(maximum: Block_Number)
Side {
Currency {
Symbol
}
}
Currency {
Symbol
}
}
count
}
}
}
Variables
{
"network": "arbitrum",
"interval": 1440,
"from": "2021-01-13",
"till": "2024-01-23",
"baseCurrency": "0xbdbc16f6aca83ab93a72d0b3bfa3df908ec9dd30",
"quoteCurrency": "0xff970a61a04b1ca14834a43f5de4533ebddb5cc8"
}
Similar queries
- optimized query to get pools data · Ethereum · DEXTradeByTokens
- AfricaCryptoChainx · Ethereum · DEXTradeByTokens
- UniversalSearch EVM · Ethereum · DEXTradeByTokens
- without fragment · Ethereum · DEXTradeByTokens
- trade stats for a token pair on uniswap v4 arbitrum · Arbitrum · DEXTradeByTokens