OHLC for a token on Pump Fun v2 (working)

Returns the latest 5 DEX trades by token on Solana, where currency mint address is 6MsQTw…pump, DEX program address is 6EF8rr…wF6P and block time before 2024-12-11: block time, sum of trade amount, trade price and count.

By Johnathan · saved 11 December 2024 · run 3 times · Bitquery API v2

What it returns

Filters

The query

query test($time_before: DateTime, $time_after: DateTime) {
  Solana {
    DEXTradeByTokens(
      limit: {count: 5}
      orderBy: {descendingByField: "Block_Timefield"}
      where: {Trade: {Currency: {MintAddress: {is: "6MsQTw67t1QsoxBNW778rLtTmyxV5PdgRPMNgr6Tpump"}}, Dex: {ProgramAddress: {is: "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"}}, PriceAsymmetry: {lt: 0.1}}, Block: {Time: {before: $time_before, after: $time_after}}}
    ) {
      Block {
        Timefield: Time(interval: {in: minutes, count: 10})
      }
      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

{
  "time_before": "2024-12-11T04:20:00Z",
  "time_after": "2024-12-11T04:00:00Z"
}

Similar queries