Get Volume Stats for Solana Chain

Traded volume, trade count and active wallets for Solana over a stated window, from `DEXTradeByTokens`. Two things this query has to work around. `Solana.DEXTrades` keeps about 12 hours and has no archive, so it cannot answer this at all. And a `uniq` in the same selection as `sum` and `count` corrupts those aggregates and freezes the time filter with them - asking for 1, 3 or 6 days then returns the same totals - so active wallets is computed in its own aliased call. The volume sum also excludes single trades above $1M, which are mispriced rows; without that guard the total reads about $32 quadrillion a day instead of about $16 billion.

By Akshat · saved 9 December 2025 · run 20 times · Bitquery API v2

What it returns

The query

{
  Solana {
    # A uniq() in the same selection as sum() and count() corrupts those
    # aggregates and freezes the time filter with them: 1, 3 and 6 days all
    # return the same totals. Each metric gets its own aliased call.
    volume: DEXTradeByTokens(
      where: {
        Transaction: { Result: { Success: true } }
        Block: { Time: { since_relative: { days_ago: 5 } } }
      }
    ) {
      Total_VolumeUSD: sum(
        of: Trade_Side_AmountInUSD
        if: { Trade: { Side: { AmountInUSD: { lt: "1000000" } } } }
      )
      Total_Trades: count
    }
    wallets: DEXTradeByTokens(
      where: {
        Transaction: { Result: { Success: true } }
        Block: { Time: { since_relative: { days_ago: 5 } } }
      }
    ) {
      Active_wallets: uniq(of: Transaction_Signer)
    }
  }
}

Similar queries