Token OHLC sunpump

Returns DEX trades by token on Tron, where currency smart contract is TMtnE6…Ys6J, block time since 2024-12-23 and trade amount is above 0, sorted by block time: block time, quantile of trade price in USD, average of trade price in USD and sum of trade side amount in USD.

By Nadia · saved 29 January 2025 · run 4 times · Bitquery API v2

What it returns

Filters

The query

query TokenOHLC($token: String, $dataset: dataset_arg_enum, $interval: Int, $time_ago: DateTime) {
  Tron(dataset: $dataset) {
    DEXTradeByTokens(
      orderBy: {ascendingByField: "Block_Time"}
      where: {Trade: {Amount: {gt: "0"}, Currency: {SmartContract: {is: $token}}}, Transaction: {Result: {Success: true}}, Block: {Time: {since: $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: average(of: Trade_PriceInUSD)
      open: average(of: Trade_PriceInUSD)
      volume: sum(of: Trade_Side_AmountInUSD)
    }
  }
}

Variables

{
  "token": "TMtnE61eiYK4LHdiUTV9nvGEa8h4pAYs6J",
  "time_ago": "2024-12-23T08:34:17Z",
  "interval": 5,
  "dataset": "combined"
}

Similar queries