bought and sold token of an address

Returns 10 DEX trades by token on Ethereum, where side currency smart contract is 0xC02a…6Cc2, sorted by volume USD, highest first: currency name, currency symbol, smart contract, side currency name, side currency symbol, side smart contract, sum of trade side amount in USD and sum of trade amount.

By gaurav · saved 8 July 2025 · run 27 times · Bitquery API v2

What it returns

Filters

The query

query MyQuery {
  EVM(network: eth, dataset: combined) {
    DEXTradeByTokens(
      limit:{count:10}
      orderBy:{descendingByField:"volumeUsd"}
      where: {any: [{Trade: {Buyer: {is: "0xacefce78e31332cf2d1b9e770d609c31d26afc09"}}}, {Trade: {Seller: {is: "0xacefce78e31332cf2d1b9e770d609c31d26afc09"}}}], Trade: {Side: {Currency: {SmartContract: {is: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"}}}}}
    ) {
      Trade {
        Currency {
          Name
          Symbol
          SmartContract
        }
        Side {
          Currency {
            Name
            Symbol
            SmartContract
          }
        }
      }
      bought: sum(of: Trade_Side_AmountInUSD, if: {Trade: {Side: {Type: {is: sell}}}})
      sold: sum(of: Trade_Side_AmountInUSD, if: {Trade: {Side: {Type: {is: buy}}}})
      volume: sum(of: Trade_Amount)
      volumeUsd: sum(of: Trade_Side_AmountInUSD)
    }
  }
}

Similar queries