OHLC_CP_Latest

Returns the latest 1000 DEX trades by token on Solana, where currency mint address is 2zucbz…pump and side currency mint address is So1111…1112: block time, sum of trade amount, sum of trade amount in USD, trade price, price in USD, sum of trade side amount in USD and count.

By CP Singh · saved 19 April 2025 · run 2 times · Bitquery API v2

What it returns

Filters

The query

{
    priceHistory: Solana(dataset:combined) {
      DEXTradeByTokens(
        limit: {count: 1000}  # 24 intervals (e.g., hourly for a day)
        orderBy: {descendingByField: "Block_Timefield"}
        where: {
          Trade: {
            Currency: {MintAddress: {is: "2zucbzn42wA6GQiH1myPbgJ8bbkXb5ti4ikKSAhHpump"}},
            Side: {Currency: {MintAddress: {is: "So11111111111111111111111111111111111111112"}}}
          },
          Transaction: {Result: {Success: true}}
        }
      ) {
        Block {
          Timefield: Time(interval: {in: minutes, count: 1})  # Hourly intervals
        }
        volume: sum(of: Trade_Amount)
        volumeUSD: sum(of: Trade_AmountInUSD)
        Trade {
          high: Price(maximum: Trade_Price)
          low: Price(minimum: Trade_Price)
          open: Price(minimum: Block_Slot)
          close: Price(maximum: Block_Slot)
          highUSD: PriceInUSD(maximum: Trade_PriceInUSD)
          lowUSD: PriceInUSD(minimum: Trade_PriceInUSD)
          openUSD: PriceInUSD(minimum: Block_Slot)
          closeUSD: PriceInUSD(maximum: Block_Slot)
          
        }
      bought: sum(of: Trade_Amount, if: {Trade: {Side: {Type: {is: buy}}}})
      sold: sum(of: Trade_Amount, if: {Trade: {Side: {Type: {is: sell}}}})
      volume: sum(of: Trade_Amount)
      volumeUsd: sum(of: Trade_Side_AmountInUSD)
      buyCount: count(if: {Trade: {Side: {Type: {is: buy}}}})
      sellCount: count(if: {Trade: {Side: {Type: {is: sell}}}})
        count
      }
    }
}

Variables

{
  "token": "59VxMU35CaHHBTndQQWDkChprM5FMw7YQi5aPE5rfSHN",
  "base": "So11111111111111111111111111111111111111112"
}

Similar queries