solana net buy and sell

Returns DEX trades by token on Solana, where currency mint address is H8xQ6p…pump, side currency mint address is So1111…1112 and block time since 2025-10-01: currency name, currency symbol, currency mint address, decimals, side currency name, side currency symbol, side currency mint address and 3 more fields.

By gaurav · saved 4 November 2025 · run 67 times · Bitquery API v2

What it returns

Filters

The query

query GetTokenBuySellVolume($tokenAddress: String!, $startTime: DateTime!, $endTime: DateTime) {
  Solana(dataset: combined) {
    DEXTradeByTokens(
      where: {
        Block: { Time: { since: $startTime, till: $endTime } }
        Transaction: { Result: { Success: true } }
        Trade: {
          Currency: { MintAddress: { is: $tokenAddress } }
          Side: { Currency: { MintAddress: 
            { is: "So11111111111111111111111111111111111111112" } } }
        }
      }
    ) {
      Trade {
        Currency {
          Name
          Symbol
          MintAddress
          Decimals
        }
        Side {
          Currency {
            Name
            Symbol
            MintAddress
          }
        }
      }
      buy_volume_usd: sum(
        of: Trade_Side_AmountInUSD
        if: { Trade: { Side: { Type: { is: buy } } } }
      )
      sell_volume_usd: sum(
        of: Trade_Side_AmountInUSD
        if: { Trade: { Side: { Type: { is: sell } } } }
      )
      buy_volume_token: sum(
        of: Trade_Amount
        if: { Trade: { Side: { Type: { is: buy } } } }
      )
      sell_volume_token: sum(
        of: Trade_Amount
        if: { Trade: { Side: { Type: { is: sell } } } }
      )
      total_trades: count
      buy_trades: count(if: { Trade: { Side: { Type: { is: buy } } } })
      sell_trades: count(if: { Trade: { Side: { Type: { is: sell } } } })
    }
  }
}

Variables

{
  "tokenAddress": "H8xQ6poBjB9DTPMDTKWzWPrnxu4bDEhybxiouF8Ppump",
  "startTime": "2025-10-01T00:00:00Z",
  "endTime":  "2025-10-02T00:00:00Z"
}

Similar queries