query token trade

Returns DEX trades by token on Solana, where side currency mint address is So1111…1112, currency mint address is 61V8vB…pump and side amount is above 0, sorted by block time: block time, quantile of trade price in USD, median of trade price in USD and sum of trade side amount in USD.

By keychains · saved 25 December 2024 · run 2 times · 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})
      }
      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": "61V8vBaqAGMpgDQi4JcAwo1dmBGHsyhzodcPqnEVpump",
  "token": "So11111111111111111111111111111111111111112",
  "interval": 5,
  "dataset": "realtime"
}

Similar queries