Top-traders-in-eth

Returns 20 DEX trades by token on Ethereum, where currency smart contract is 0xC902…f3Ad, sorted by volume, highest first: from, protocol name, protocol family, currency symbol, currency name, smart contract, side currency name and 4 more fields.

By Akshat · saved 6 July 2024 · run 28 times · Bitquery API v2

What it returns

Filters

The query

query TopTraders($token: String) {
  EVM(network: eth, dataset: combined) {
    DEXTradeByTokens(
      orderBy: {descendingByField: "volume"}
      limit: {count: 20}
      where: {Trade: {Currency: {SmartContract: {is: $token}}}, TransactionStatus: {Success: true}}
    ) {
      Transaction {
        From
      }
      Trade {
        Dex {
          ProtocolName
          ProtocolFamily
        }
        Currency {
          Symbol
          Name
          SmartContract
        }
        Side {
          Currency {
            Name
            Symbol
            SmartContract
          }
        }
      }
      bought: sum(
        of: Trade_Side_AmountInUSD
        if: {Trade: {Side: {Type: {is: sell}}}}
        selectWhere: {gt: "0"}
      )
      sold: sum(
        of: Trade_Side_AmountInUSD
        if: {Trade: {Side: {Type: {is: buy}}}}
        selectWhere: {gt: "0"}
      )
      volume: sum(of: Trade_Amount)
      volumeUsd: sum(of: Trade_Side_AmountInUSD)
    }
  }
}

Variables

{
  "token": "0xC90242Cd9959b7Be6EC01B5e99702Ee21161f3Ad"
}

Similar queries