Get the Buys, Sells, Buy Volume, Sell Volume and Makers of Multiple Tokens

Returns DEX trades by token on Ethereum, where DEX smart contract is 0x055F…26a1 or 0x8d34…0A44 and side currency smart contract is 0xC02a…6Cc2: currency name, smart contract, currency symbol, price in USD, protocol name, protocol family, side currency symbol and 4 more fields.

By Akshat · saved 5 February 2026 · Bitquery API v2

What it returns

Filters

The query

query MyQuery(
  $network: evm_network,
  $token: String,
  $pairAddress: [String!]
) {
  EVM(dataset: realtime, network: $network) {
    DEXTradeByTokens(
      where: {
        TransactionStatus: { Success: true },
        Trade: {
          Dex: { SmartContract: { in: $pairAddress } },
          Side: { Currency: { SmartContract: { is: $token } } }
        },
        Block: { Time: { since_relative: {hours_ago:1} } }
      }
    ) {
      Trade {
        Currency {
          Name
          SmartContract
          Symbol
        }
        startPrice: PriceInUSD(minimum: Block_Time)
        Price_at_min5: PriceInUSD(
          minimum: Block_Time
          if: { Block: { Time: { after_relative:{minutes_ago:5} } } }
        )
        current_price: PriceInUSD(maximum: Block_Time)
        Dex {
          ProtocolName
          ProtocolFamily
          SmartContract
        }
        Side {
          Currency {
            Symbol
            Name
            SmartContract
          }
        }
      }
      makers: count(distinct: Transaction_From)
      makers_5min: count(
        distinct: Transaction_From
        if: { Block: { Time: { after_relative:{minutes_ago:5} } } }
      )
      buyers: count(
        distinct: Transaction_From
        if: { Trade: { Side: { Type: { is: sell } } } }
      )
      buyers_5min: count(
        distinct: Transaction_From
        if: {
          Trade: { Side: { Type: { is: sell } } }
          Block: { Time: { after_relative:{minutes_ago:5} } }
        }
      )
      sellers: count(
        distinct: Transaction_From
        if: { Trade: { Side: { Type: { is: buy } } } }
      )
      sellers_5min: count(
        distinct: Transaction_From
        if: {
          Trade: { Side: { Type: { is: buy } } }
          Block: { Time: { after_relative:{minutes_ago:5} } }
        }
      )
      trades: count
      trades_5min: count(if: { Block: { Time: { after_relative:{minutes_ago:5} } } })
      traded_volume: sum(of: Trade_Side_AmountInUSD)
      traded_volume_5min: sum(
        of: Trade_Side_AmountInUSD
        if: { Block: { Time: { after_relative:{minutes_ago:5} } } }
      )
      buy_volume: sum(
        of: Trade_Side_AmountInUSD
        if: { Trade: { Side: { Type: { is: sell } } } }
      )
      buy_volume_5min: sum(
        of: Trade_Side_AmountInUSD
        if: {
          Trade: { Side: { Type: { is: sell } } }
          Block: { Time: { after_relative:{minutes_ago:5} } }
        }
      )
      sell_volume: sum(
        of: Trade_Side_AmountInUSD
        if: { Trade: { Side: { Type: { is: buy } } } }
      )
      sell_volume_5min: sum(
        of: Trade_Side_AmountInUSD
        if: {
          Trade: { Side: { Type: { is: buy } } }
          Block: { Time: { after_relative:{minutes_ago:5} } }
        }
      )
      buys: count(if: { Trade: { Side: { Type: { is: sell } } } })
      buys_5min: count(
        if: {
          Trade: { Side: { Type: { is: sell } } }
          Block: { Time: { after_relative:{minutes_ago:5} } }
        }
      )
      sells: count(if: { Trade: { Side: { Type: { is: buy } } } })
      sells_5min: count(
        if: {
          Trade: { Side: { Type: { is: buy } } }
          Block: { Time: { after_relative:{minutes_ago:5} } }
        }
      )
    }
  }
}

Variables

{
  "network": "eth",
  "token": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
  "pairAddress": [
    "0x055FB841Cce69000FBAFF2691Ad39Fa6E23826a1",
    "0x8d345583C9289D69d4a55797CcadC5A1eA150A44"
  ]
}

Similar queries