final

Returns 3 DEX trades by token on Solana, sorted by block time: block time, quantile of trade price, median of trade price, count, sum of trade amount, trade price, currency name and 5 more fields.

By d4fdfdf · saved 10 August 2025 · Bitquery API v2

What it returns

The query

query TradesSolToken($base_asset: String!, $mkt_addr: String!, $dataset: dataset_arg_enum, $interval: Int) {
  Solana(dataset: $dataset) {
    DEXTradeByTokens(
      limit: {count: 3}
      orderBy: {ascendingByField: "Block_Time"}
      where: {Trade: {Currency: {MintAddress: {is: $base_asset}},Market: {MarketAddress: {is: $mkt_addr}}}, Transaction: {Result: {Success: true}}}
    ) {
      Block {
        Time(interval: {count: $interval, in: minutes})
      }
      px_pct_1th: quantile(of: Trade_Price, level: 0.01)
      px_pct_25th: quantile(of: Trade_Price, level: 0.25)
      px_pct_75th: quantile(of: Trade_Price, level: 0.75)
      px_pct_99th: quantile(of: Trade_Price, level: 0.99)
      px_median: median(of: Trade_Price)
      count
      volume: sum(of: Trade_Amount)
      Trade {
        high: Price(maximum: Trade_Price)
        low: Price(minimum: Trade_Price)
        open: Price(minimum: Block_Slot)
        close: Price(maximum: Block_Slot)
        Currency {
          Name
          Symbol
        }
        Side {
          Currency {
            Name
            Symbol
          }
          min_quote_qty: Amount(minimum: Trade_Side_Amount)
          max_quote_qty: Amount(maximum: Trade_Side_Amount)
        }
        min_base_qty: Amount(minimum: Trade_Amount)
        max_base_qty: Amount(maximum: Trade_Amount)
      }
    }
  }
}

Variables

{
  "interval": 30,
  "dataset": "combined",
  "base_asset": "F6TsRcjtLBzkdtZYqjTPVq9WtnwHMMc1WcQguEgCpump"
  "mkt_addr": "Hv4wMatEoiREbyZjEW5V3AYHQ7wwdtrMWcp26GLM6hBr"
}

Similar queries