three one

OHLC historical solana multiple token

Returns DEX trades by token on Solana, where currency mint address is kNS9ED…pump, block time after 2024-12-06 and block time before 2024-12-06, sorted by block time: currency name, price in USD, side currency name, sum of trade side amount in USD and block time.

By Abdirahman Waari · saved 6 December 2024 · 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(
      orderBy: {ascendingByField: "Block_Time"}
      where: {Block: {Time: {after: $time_ago, before: $time_before}, Date: {}}, Trade: {Side: {Amount: {gt: "0"}}, Currency: {MintAddress: {in: $token}}}}
    ) {
      Trade {
        Currency {
          Name
        }
        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)
        Side {
          Currency {
            Name
          }
        }
      }
      volume: sum(of: Trade_Side_AmountInUSD)
      Block {
        Time(interval: {count: $space, in: $resolution})
      }
    }
  }
}

Variables

{
  "token": ["kNS9EDwpiJNBJpUCQ2eYcZkuj5Xo4cco4jsrwk9pump"],
  "time_ago": "2024-12-06T02:08:00.000Z",
  "time_before": "2024-12-06T02:11:00.000Z",
  "space": 1,
  "resolution": "minutes"
}

Similar queries