sol volume and thing

Returns DEX trades by token on Solana, where account owner is 52Jz92…PmRj and side currency mint address is So1111…1112, sorted by tokens, highest first: currency mint address, currency name, currency symbol, sum of trade amount, sum of trade side amount and sum of trade side amount in USD.

By rishaan agrawal · saved 1 March 2025 · run 3 times · Bitquery API v2

What it returns

Filters

The query

query MyQuery($walletAddress: String!) {
  Solana(dataset: combined) {
    # Get all tokens traded by the wallet
    DEXTradeByTokens(
      orderBy: {descendingByField: "tokens"}
      where: {Trade: {Account: {Owner: {is: $walletAddress}}}}
    ) {
      # Group by unique tokens
      Trade {
        Currency {
          MintAddress
          Name
          Symbol
        }
      }
      tokens: sum(of: Trade_Amount)
    }
    
    # Get total SOL volume for the wallet
    WalletSolVolume: DEXTradeByTokens(
      where: {
        Trade: {
          Account: {Owner: {is: $walletAddress}},
          Side: {Currency: {MintAddress: {is: "So11111111111111111111111111111111111111112"}}}
        }
      }
    ) {
      total_sol_volume: sum(of: Trade_Side_Amount)
      total_sol_volume_usd: sum(of: Trade_Side_AmountInUSD)
    }
  }
}

Variables

{
  "walletAddress": "52Jz92hAxU9rwVShAMGptB9zUspkt2gv7ED7LhSNPmRj"
}

Similar queries