open/close

Returns DEX trades by token on Solana, where side currency mint address is EPjFWd…Dt1v, currency mint address is So1111…1112 and block time after 2025-02-06, sorted by block time: block time, price in USD, quantile of trade price in USD, median of trade price in USD and sum of trade side amount in USD.

By Aleksey · saved 6 February 2025 · Bitquery API v2

What it returns

Filters

The query

query ($token: String, $base: String, $dataset: dataset_arg_enum, $time_ago: DateTime, $interval: Int) {
  Solana(dataset: $dataset) {
    DEXTradeByTokens(
      orderBy: {ascendingByField: "Block_Time"}
      where: {Trade: {Side: {Amount: {gt: "0"}, Currency: {MintAddress: {is: $token}}}, Currency: {MintAddress: {is: $base}}}, Block: {Time: {after: $time_ago}}}
    ) {
      Block {
        Time(interval: {count: $interval, in: minutes})
      }
      close1: Trade {
        PriceInUSD(maximum: Block_Slot)
      }
      open1: Trade {
        PriceInUSD(minimum: Block_Slot)
      }
      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_AmountInUSD)
    }
  }
}

Variables

{
  "base": "So11111111111111111111111111111111111111112",
  "token": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
  "interval": 5,
  "dataset": "combined",
  "time_ago": "2025-02-06T05:25:14Z"
}

Similar queries