top trades aggregated

Returns 1000 DEX trades on Solana, sorted by count, highest first: count, sum of trade buy amount, sum of trade sell amount, buy account address, buy token owner, sell account address and sell token owner.

By Aleksey · saved 5 July 2024 · run 1 time · Bitquery API v2

What it returns

The query

query TopTraders($token: String!) {
  Solana {
    DEXTrades(
      orderBy: {descendingByField: "count"}
      limit: {count: 1000}
      where: {
        any: [
          {Trade: {Buy: {Currency: {MintAddress: {is: $token}}}}},
          {Trade: {Sell: {Currency: {MintAddress: {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 {
          Account {
            Address
            Token {
              Owner
            }
          }
          
        }
        
        Sell {
          Account {
            Address
            Token {
              Owner
            }
          }
          
        }
        

        
      }
      
    }
  }
}

Variables

{
  "token": "DKK4uXHwqkboQANTnHoSryZwhXP5XzoCNuAf9Zitpump"
}

Similar queries