OHLC historical solana

OHLCV

Returns DEX trades by token on Solana, where DEX program address is 675kPX…1Mp8, currency mint address is 8bdhP1…MS7N and block time after 2024-12-24, sorted by block time: price in USD, sum of trade side amount in USD and block time.

By Cryptonauts · saved 24 December 2024 · run 10 times · Bitquery API v2

What it returns

Filters

The query

query MyQuery($token: String, $time_ago: DateTime, $time_before: DateTime, $resolution: OLAP_DateTimeIntervalUnits, $space: Int) {
  Solana(dataset: combined) {
    DEXTradeByTokens(
      orderBy: {ascendingByField: "Block_Time"}
      where: {Block: {Time: {after: $time_ago, before: $time_before}, Date: {}}, Trade: {Dex: {ProgramAddress: {is: "675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8"}}, Currency: {MintAddress: {is: $token}}}}
    ) {
      Trade {
        high: PriceInUSD(maximum: Trade_PriceInUSD)
        low: PriceInUSD(minimum: Trade_PriceInUSD)
        open: PriceInUSD(minimum: Block_Slot)
        close: PriceInUSD(maximum: Block_Slot)
        price: PriceInUSD(maximum: Trade_PriceInUSD)
      }
      volume: sum(of: Trade_Side_AmountInUSD)
      Block {
        Time(interval: {count: $space, in: $resolution})
      }
    }
  }
}

Variables

{
  "token": "8bdhP1UQMevciC9oJ7NrvgDfoW8XPXPfbkkm6vKtMS7N",
  "time_ago": "2024-12-24T07:29:40Z",
  "time_before": "2024-12-25T07:29:40Z",
  "space": 1,
  "resolution": "days"
}

Similar queries