DEXTradesByToken historical query

When using Time(interval: {in: minutes, count: 1}) with dataset: combined, the response groups trades into per-minute buckets per DEX/side-currency combination Result: Returns ~50 rows, each representing a minute bucket with aggregated counts (e.g., "buys": 22, "sells": 0, "trades": 22). No Transaction.Signature or Trade.Account.Owner per row.

By Robert · saved 12 March 2026 · Bitquery API v2

What it returns

Filters

The query

query MondayTrades($token: String!, $since: DateTime!, $till: DateTime!) {
  Solana(dataset: combined) {
    DEXTradeByTokens(
      orderBy: {descendingByField: "Block_Time"}
      limit: {count: 50}
      where: {Trade: {Currency: {MintAddress: {is: $token}}, Side: {Currency: {MintAddress: {in: ["So11111111111111111111111111111111111111112", "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"]}}}}, Block: {Time: {since: $since, till: $till}}, Transaction: {Result: {Success: true}}}
    ) {
      Block {
        Time(interval: {in: minutes, count: 1})
      }
      Trade {
        Currency {
          Name
          Symbol
          MintAddress
        }
        Side {
          Type
          Currency {
            Name
            Symbol
            MintAddress
          }
        }
        Dex {
          ProtocolName
          ProtocolFamily
          ProgramAddress
        }
        Market {
          MarketAddress
        }
      }
      volume: sum(of: Trade_Side_AmountInUSD)
      buy_volume: sum(
        of: Trade_Side_AmountInUSD
        if: {Trade: {Side: {Type: {is: buy}}}}
      )
      sell_volume: sum(
        of: Trade_Side_AmountInUSD
        if: {Trade: {Side: {Type: {is: sell}}}}
      )
      trades: count
      buys: count(if: {Trade: {Side: {Type: {is: buy}}}})
      sells: count(if: {Trade: {Side: {Type: {is: sell}}}})
    }
  }
}

Variables

{
  "token": "27G8MtK7VtTcCHkpASjSDdkWWYfoqT6ggEuKidVJidD4",
  "since": "2026-03-09T00:00:00Z",
  "till": "2026-03-09T23:59:59Z"
}

Similar queries