solana clickhouse error on aggregates

Returns 5000 DEX trades by token on Solana, where currency mint address is Dz9mQ9…bonk, block time since 2025-09-01 and block time till 2025-10-01, sorted by block timefield: block time, count, sum of trade amount in USD, sum of trade amount and price in USD.

By Divyasshree · saved 17 November 2025 · Bitquery API v2

What it returns

Filters

The query

{
  Solana(dataset: combined) {
    recent: DEXTradeByTokens(
      where: {Block: {Time: {since: "2025-09-01T00:00:00Z", till: "2025-10-01T00:00:00Z"}}, Trade: {Currency: {MintAddress: {is: "Dz9mQ9NzkBcCsuGPFJ3r1bS4wgqKMHBPiVuniW8Mbonk"}}}}
      orderBy: {ascendingByField: "Block_Timefield"}
      limit: {count: 5000}
    ) {
      Block {
        Timefield: Time(interval: {in: minutes, count: 1})
      }
      trades: count
      volumeUsd: sum(of: Trade_AmountInUSD)
      volumeBase: sum(of: Trade_Amount)
      Trade {
        highUsd: PriceInUSD(maximum: Trade_Price)
        lowUsd: PriceInUSD(minimum: Trade_Price)
        openUsd: PriceInUSD(minimum: Block_Slot)
        closeUsd: PriceInUSD(maximum: Block_Slot)
      }
    }
  }
}

Similar queries