Top-traders-in-ethddd

d

Returns 20 DEX trades by token on BNB Chain, where currency smart contract is 0xb27a…97cc, sorted by volume, highest first: from, protocol name, protocol family, currency symbol, currency name, smart contract, side currency name and 4 more fields.

By Nazim Bekteshi · saved 15 July 2024 · run 17 times · Bitquery API v2

What it returns

Filters

The query

query TopTraders($token: String) {
  EVM(network: bsc, 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": "0xb27adaffb9fea1801459a1a81b17218288c097cc"
}

Similar queries