OHLC -abdi

OHLC

Returns the latest 10000 DEX trades by token on Solana, where DEX protocol family is Raydium, block time after 2024-08-01 and block time before 2024-09-21: block time, sum of trade amount and price in USD.

By Abdullah · saved 23 December 2024 · run 1 time · Bitquery API v2

What it returns

Filters

The query

query getMinuteOHLC(
  $tokenA: String!,
  $tokenB: String!,
  $start: DateTime!,
  $end: DateTime!,
  $limit: Int!,
  $offset: Int!
) {
  Solana(dataset: archive) {
    DEXTradeByTokens(
      orderBy: {descending: Block_Time}
      where: {
        Block: { Time: {after: $start, before: $end} }
        Trade: {
          Dex: {
            ProtocolFamily: {is: "Raydium"}
        }
          Currency: {MintAddress: {is: $tokenA}}
          Side:     {Currency: {MintAddress: {is: $tokenB}}}
        }
      }
      limit: {count: $limit, offset: $offset}
    ) {
      Block {
        minuteTimestamp: Time(interval: {count: 1, in: minute})
      }
      volume: sum(of: Trade_Amount)
      Trade {
      highest: PriceInUSD(maximum: Trade_Price)
      lowest: PriceInUSD(minimum: Trade_Price)
      open: PriceInUSD(first: Block_Time)
      close: PriceInUSD(last:  Block_Time)
      }
    }
  }
}

Variables

{
  "start": "2024-08-01T01:39:00.000Z",
  "end": "2024-09-21T01:39:00.000Z",
  "limit": 10000,
  "offset": 10
}

Similar queries