historical solana ohlc

Returns DEX trades by token on Solana, where currency mint address is cbbtcf…iMij, side currency mint address is 111111…1111, So1111…1112 or 4 more and block time since 2025-07-11, sorted by block time: block time, quantile of trade price in USD, price in USD and sum of trade side amount in USD.

By gaurav · saved 14 August 2025 · run 3 times · Bitquery API v2

What it returns

Filters

The query

query TradingView($token: String, $dataset: dataset_arg_enum, $from: DateTime, $to: DateTime, $interval: Int) {
  Solana(dataset: $dataset) {
    DEXTradeByTokens(
      orderBy: {ascendingByField: "Block_Time"}
      where: {Trade: {Currency: {MintAddress: {is: $token}}, 
        Side: {Currency: {MintAddress: {in: ["11111111111111111111111111111111",
          "So11111111111111111111111111111111111111112", "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB", "JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN", "EKpQGSJtjMFqKZ9KQanSqYXRcF8fBopzLHYxdM65zcjm"]}}}}, Block: {Time: {since: $from, till: $to}}, Transaction: {Result: {Success: true}}}
    ) {
      Block {
        Time(interval: {count: $interval, in: hours})
      }
      min: quantile(of: Trade_PriceInUSD, level: 0.05)
      max: quantile(of: Trade_PriceInUSD, level: 0.95)
      close: Trade {
        PriceInUSD(maximum: Block_Slot)
      }
      open: Trade {
        PriceInUSD(minimum: Block_Slot)
      }
      volume: sum(of: Trade_Side_AmountInUSD)
    }
  }
}

Variables

{
  "network": "solana",
  "token": "cbbtcf3aa214zXHbiAZQwf4122FBYbraNdFqgw4iMij",
  "usdc": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
  "usdt": "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB",
  "wsol": "So11111111111111111111111111111111111111112",
  "dataset": "combined",
  "time_ago": "2025-08-11T14:52:40Z",
  "interval": 1,
  "from": "2025-07-11T14:53:46.000Z",
  "to": "2025-08-14T14:53:46.000Z"
}

Similar queries