OHLC historical solana at specific time possibly working works histroical or realtime up to 2 days ago. works for

OHLC historical solana at specific time OHLC historical solana at specific time possibly working works histroical or realtime up to 2 days ago. works for minute thing only

By Bilal Ghafoor · saved 28 November 2024 · run 39 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: 1000000}
      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": "GfWzdfr96LunGme5byQczrW5jMU39PW4naFF9SH2pump",
  "time_ago": "2024-01-01T01:39:00.000Z",
  "time_before": null,
  "space": 1,
  "resolution": "minutes"
}

Similar queries