top traders

Returns 100 DEX trades by token on Tron, where currency smart contract is TJ9mxW…diAq, side currency smart contract is TNUC9Q…jWFR and side amount is above 0, 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 20 September 2024 · run 7 times · Bitquery API v2

What it returns

Filters

The query

query TopTraders($token: String, $base: String) {
  Tron {
    DEXTradeByTokens(
      orderBy: {descendingByField: "volumeUsd"}
      limit: {count: 100}
      where: {Trade: {Currency: {SmartContract: {is: $token}}, Side: {Amount: {gt: "0"}, Currency: {SmartContract: {is: $base}}}}, Transaction: {Result: {Success: true}}}
    ) {
      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

{
  "token": "TJ9mxWPmQSJswqMakEehFWcAntg73odiAq",
  "base": "TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR"
}

Similar queries