Tron top trades aggregated

Returns 1000 DEX trades on Tron, sorted by count, highest first: count, sum of trade buy amount, sum of trade sell amount, buy buyer and sell seller.

By Srdjan Stankovic · saved 23 September 2024 · run 3 times · Bitquery API v2

What it returns

The query

query TronTopTradersAggregated($token: String!) {
  Tron {
    DEXTrades(
      orderBy: {descendingByField: "count"}
      limit: {count: 1000}
      where: {any: [{Trade: {Buy: {Currency: {SmartContract: {is: $token}}}}}, {Trade: {Sell: {Currency: {SmartContract: {is: $token}}}}}], Transaction: {Result: {Success: true}}}
    ) {
      count
      buyAmount: sum(
        of: Trade_Buy_Amount
        if: {Trade: {Buy: {Currency: {Native: false}}}}
      )
      sellAmount: sum(
        of: Trade_Sell_Amount
        if: {Trade: {Buy: {Currency: {Native: true}}}}
      )
      Trade {
        Buy {
          Buyer
        }
        Sell {
          Seller
        }
      }
    }
  }
}

Variables

{
  "token": "TRbQEffHP6kMAhdvFbLumhCjpv59ezpUWC"
}

Similar queries