OHLC with usage of quantile values

Returns the latest DEX trades by token on Solana, where currency mint address is 9BB6NF…pump, side currency mint address is So1111…1112 and market market address is Bzc9NZ…5iiw: block time, sum of trade amount, trade price and count.

By Akshat · saved 19 December 2024 · run 1 time · Bitquery API v2

What it returns

Filters

The query

query ($mainCurrencyAddress: String , $sideCurrencyAddress: String, $pairAddress: String, $lowerBoundPrice: Float, $upperBoundPrice: Float, $timestamp1Hago: DateTime ){
  Solana {
    DEXTradeByTokens(
      orderBy: {descendingByField: "Block_Timefield"}
      where: {Trade: {Currency: {MintAddress: {is: $mainCurrencyAddress}}, Side: {Currency: {MintAddress: {is: $sideCurrencyAddress}}}, Market: {MarketAddress: {is: $pairAddress}}, PriceInUSD: {ge: $lowerBoundPrice, le: $upperBoundPrice}}, Transaction: {Result: {Success: true}}, Block: {Time: {since: $timestamp1Hago}}}
    ) {
      Block {
        Timefield: Time(interval: {in: minutes, count: 1})
      }
      volume: sum(of: Trade_Amount)
      Trade {
        high: Price(maximum: Trade_Price)
        low: Price(minimum: Trade_Price)
        open: Price(minimum: Block_Slot)
        close: Price(maximum: Block_Slot)
      }
      count
    }
  }
}

Variables

{
  "mainCurrencyAddress": "9BB6NFEcjBCtnNLFko2FqVQBq8HHM13kCyYcdQbgpump",
  "sideCurrencyAddress": "So11111111111111111111111111111111111111112",
  "pairAddress": "Bzc9NZfMqkXR6fz1DBph7BDf9BroyEf6pnzESP7v5iiw",
  "lowerBoundPrice": "1.0117961082458495",
  "upperBoundPrice": "1.0709270496368408",
  "timestamp1Hago" : "2024-12-19T08:00:00Z"
}

Similar queries