weth/wbtc

Returns DEX trades by token on Ethereum, where side currency smart contract is 0x2260…c599, currency smart contract is 0xc02a…6cc2 and block time since 2024-12-19, sorted by block time: block time, quantile of trade price in USD, average of trade price in USD and sum of trade side amount in USD.

By rb · saved 22 December 2024 · run 2 times · Bitquery API v2

What it returns

Filters

The query

query tradingViewPairs($network: evm_network, $dataset: dataset_arg_enum, $interval: Int, $token: String, $base: String, $time_ago: DateTime) {
  EVM(network: $network, dataset: $dataset) {
    DEXTradeByTokens(
      orderBy: {ascendingByField: "Block_Time"}
      where: {Trade: {Side: {Amount: {gt: "0"}, Currency: {SmartContract: {is: $token}}}, Currency: {SmartContract: {is: $base}}}, Block: {Time: {since: $time_ago}}}
    ) {
      Block {
        Time(interval: {count: $interval, in: minutes})
      }
      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": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
  "token": "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599",
  "time_ago": "2024-12-19T13:31:55Z",
  "dataset": "realtime",
  "interval": 5
}

Similar queries