OHLC historical solana at specific time

Returns one DEX trade by token on Solana, where currency mint address is 3Z2YCE…pump, block time after 2024-11-07 and side amount is above 0, sorted by block time: price in USD, sum of trade side amount in USD and block time.

By gaurav · saved 9 November 2024 · run 26 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: archive) {
    DEXTradeByTokens(
      limit: {count: 1}
      orderBy: {ascendingByField: "Block_Time"}
      where: {Block: {Time: {after: $time_ago, before: $time_before}, Date: {}}, Trade: {Side: {Amount: {gt: "0"}}, 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": "3Z2YCECRR2U3GEDc6yVDG2cpgqG2X7Hqefc7sACApump",
  "time_ago": "2024-11-07T01:39:00.000Z",
  "time_before": null,
  "space": 1,
  "resolution": "minutes"
}

Similar queries