Query archive OHLC

Returns DEX trades by token on Solana, where currency mint address is H7RrDF…pump, block time after 2024-10-28 and trade amount is above 0, sorted by block time: block time, market address, protocol name, protocol family, currency symbol, currency name, currency mint address and 7 more fields.

By Aleksey · saved 29 October 2024 · run 2 times · Bitquery API v2

What it returns

Filters

The query

query pumpFunTradesSolToken($token: String, $time_ago: DateTime, $dataset: dataset_arg_enum) {
  Solana(dataset: $dataset) {
    DEXTradeByTokens(
      orderBy: {ascendingByField: "Block_Time"}
      where: {Trade: {Amount: {gt: "0"}, Currency: {MintAddress: {is: $token}}}, Transaction: {Result: {Success: true}}, Block: {Time: {after: $time_ago}}}
    ) {
      Block {
        Time(interval: {count: 5, in: minutes})
      }
      Trade {
        Market {
          MarketAddress
        }
        Dex {
          ProtocolName
          ProtocolFamily
        }
        Currency {
          Symbol
          Name
          MintAddress
          Decimals
        }
        close: Price(maximum: Block_Slot)
        closeUsd: PriceInUSD(maximum: Trade_PriceInUSD)
      }
      min: quantile(of: Trade_PriceInUSD, level: 0.05)
      max: quantile(of: Trade_PriceInUSD, level: 0.95)
      close: median(of: Trade_PriceInUSD)
      open: median(of: Trade_PriceInUSD)
      volume: sum(of: Trade_Side_Amount)
      volumeUsd: sum(of: Trade_Side_AmountInUSD)
    }
  }
}

Variables

{
  "token": "H7RrDFbGsMxyDAHsoSjpzXcJUovdbAK4Wr2bV1s1pump",
  "time_ago": "2024-10-28T23:16:52Z",
  "dataset": "archive"
}

Similar queries