Top traders with their bought, sold and total volume

Returns 5 DEX trades by token on Solana, where currency mint address is ECw2YC…pump, sorted by volume, highest first: protocol name, protocol family, program address, currency symbol, currency name, currency mint address, account address and 2 more fields.

By Akshat · saved 5 July 2024 · run 6 times · Bitquery API v2

What it returns

Filters

The query

query TopTraders($token: String) {
  Solana {
    DEXTradeByTokens(
      orderBy: {
        descendingByField: "volume"
      }
      limit: {count: 5}
      where: { 
        Trade: {
          Currency: {
            MintAddress: {
              is: $token
            }
          }
        }
        Transaction: {Result: {Success: true}}}
    ) {
      
      Trade {
        Dex {
          ProtocolName
          ProtocolFamily
          ProgramAddress
        }
        Currency {
          Symbol
          Name
          MintAddress
        }
        
        Account {
          Address
        }
      
      }
      
      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": "ECw2YCA4LYSRbEfErUpdYdWCPDKxkQw2reAk3ppypump"
}

Similar queries