top traders of a token

Returns 100 DEX trades by token on Ethereum, where currency smart contract is 0x2260…c599, sorted by volume USD, highest first: owner address, protocol family, protocol name, sum of trade amount and sum of trade side amount in USD.

By Akshat · saved 22 September 2024 · run 22 times · Bitquery API v2

What it returns

Filters

The query

query topTraders($network: evm_network, $token: String) {
  EVM(network: $network) {
    DEXTradeByTokens(
      orderBy: {descendingByField: "volumeUsd"}
      limit: {count: 100}
      where: {Trade: {Currency: {SmartContract: {is: $token}}}}
    ) {
      Trade {
        Dex {
          OwnerAddress
          ProtocolFamily
          ProtocolName
        }
      }
      bought: sum(of: Trade_Amount, if: {Trade: {Side: {Type: {is: buy}}}})
      sold: sum(of: Trade_Amount, if: {Trade: {Side: {Type: {is: sell}}}})
      volume: sum(of: Trade_Amount)
      volumeUsd: sum(of: Trade_Side_AmountInUSD)
    }
  }
}

Variables

{
  "network": "eth",
  "token": "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599"
}

Similar queries