candle api

Returns the latest DEX trades by token on Ethereum, where side currency smart contract is 0xa0b8…eb48, currency smart contract is 0x2260…c599 and block time since 2023-08-25: block time, quantile of trade price in USD, average of trade price in USD and sum of trade side amount in USD.

By gaurav · saved 25 September 2025 · run 1 time · Bitquery API v2

What it returns

Filters

The query

query tradingViewPairs($network: evm_network, $dataset: dataset_arg_enum, $interval: Int, $token: String, $base: String, $from: DateTime, $to: DateTime) {
  EVM(network: $network, dataset: $dataset) {
    DEXTradeByTokens(
      orderBy: {descendingByField: "Block_Time"}
      where: {TransactionStatus: {Success: true}, Trade: {Side: {Amount: {gt: "100"}, Currency: {SmartContract: {is: $token}}}, Currency: {SmartContract: {is: $base}}, Success: true}, Block: {Time: {since: $from, till: $to}}}
    ) {
      Block {
        Time(interval: {count: $interval, in: seconds})
      }
      min: quantile(of: Trade_PriceInUSD, level: 0.1)
      max: quantile(of: Trade_PriceInUSD, level: 0.9)
      close: average(of: Trade_PriceInUSD)
      open: average(of: Trade_PriceInUSD)
      volume: sum(of: Trade_Side_AmountInUSD)
    }
  }
}

Variables

{
  "network": "eth",
  "base": "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599",
  "token": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
  "time_ago": "2025-09-22T15:17:16Z",
  "dataset": "combined",
  "local": "EVM",
  "interval": 86400,
  "from": "2023-08-25T00:00:00Z",
  "to": "2025-09-26T00:00:00Z"
}

Similar queries