DEX Trade Statistics

Returns DEX trades on Ethereum, where DEX protocol name is uniswap_v2, block date since 2023-07-10 and block date till 2023-07-10: chain ID, count, sum of trade sell amount, sum of trade sell amount in USD, sum of trade buy amount, sum of trade buy amount in USD, average of trade sell amount and average of trade sell amount in USD.

By Nadia · saved 17 February 2025 · run 1 time · Bitquery API v2

What it returns

Filters

The query

query ($network: evm_network, $from: String, $till: String, $protocol: String) {
  EVM(dataset: combined, network: $network) {
    DEXTrades(
      where: {Block: {Date: {since: $from, till: $till}}, Trade: {Dex: {ProtocolName: {is: $protocol}}}}
    ) {
      ChainId
      trades: count
      sum_sell: sum(of: Trade_Sell_Amount)
      sum_sell_usd: sum(of: Trade_Sell_AmountInUSD)
      sum_buy: sum(of: Trade_Buy_Amount)
      sum_buy_usd: sum(of: Trade_Buy_AmountInUSD)
      avg_trade_size: average(of: Trade_Sell_Amount)
      avg_trade_size_usd: average(of: Trade_Sell_AmountInUSD)
      uniq_pairs: count(distinct: Trade_Sell_Currency_Symbol)
      uniq_sellers: count(distinct: Trade_Sell_Seller)
      uniq_buyers: count(distinct: Trade_Sell_Buyer)
    }
  }
}

Variables

{
  "network": "eth",
  "protocol": "uniswap_v2",
  "limit": 10,
  "from": "2023-07-10",
  "till": "2023-07-10"
}

Similar queries