Price change 5min, 1hr, 6hr precentage of a specific token

Historical data This query already reads history - it uses the combined dataset, which needs the historical data add-on for this chain. Without the add-on it fails with 'access restricted: your plan only allows realtime'. Drop the dataset argument to fall back to the recent window. Datasets: https:

By Akshat · saved 9 December 2025 · run 16 times · Bitquery API v2

What it returns

Filters

The query

# Historical data
#   This query already reads history - it uses the combined dataset, which
#   needs the historical data add-on for this chain.
#
#   Without the add-on it fails with 'access restricted: your plan only allows
#   realtime'. Drop the dataset argument to fall back to the recent window.
#
# Datasets:  https://docs.bitquery.io/docs/graphql/dataset/archive/
# Retention: https://docs.bitquery.io/docs/graphql/data-coverage-retention/
#

query MyQuery {
  EVM(dataset: combined) {
    DEXTradeByTokens(
      where: {Trade: {Currency: {SmartContract: {is: "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599"}}}, TransactionStatus: {Success: true}, Block: {Time: {since_relative: {hours_ago: 24}}}}
    ) {
      Trade {
        Price_5min_ago: PriceInUSD(
          minimum: Block_Number
          if: {Block: {Time: {since_relative: {minutes_ago: 5}}}}
        )
        Price_1h_ago: PriceInUSD(
          minimum: Block_Number
          if: {Block: {Time: {since_relative: {hours_ago: 1}}}}
        )
        Price_6h_ago: PriceInUSD(
          minimum: Block_Number
          if: {Block: {Time: {since_relative: {hours_ago: 6}}}}
        )
        Price_24h_ago: PriceInUSD(minimum: Block_Number)
        CurrentPrice: PriceInUSD(maximum: Block_Number)
      }
      volume_5min: sum(
        of: Trade_Side_AmountInUSD
        if: {Block: {Time: {since_relative: {minutes_ago: 5}}}}
      )
      volume_1h: sum(
        of: Trade_Side_AmountInUSD
        if: {Block: {Time: {since_relative: {hours_ago: 1}}}}
      )
      volume_6h: sum(
        of: Trade_Side_AmountInUSD
        if: {Block: {Time: {since_relative: {hours_ago: 6}}}}
      )
      volume_24h: sum(of: Trade_Side_AmountInUSD)
      Price_Change_5min: calculate(
        expression: "(($Trade_CurrentPrice - $Trade_Price_5min_ago) / $Trade_Price_5min_ago) * 100"
      )
      Price_Change_1h: calculate(
        expression: "(($Trade_CurrentPrice - $Trade_Price_1h_ago) / $Trade_Price_1h_ago) * 100"
      )
      Price_Change_6h: calculate(
        expression: "(($Trade_CurrentPrice - $Trade_Price_6h_ago) / $Trade_Price_6h_ago) * 100"
      )
      Price_Change_24h: calculate(
        expression: "(($Trade_CurrentPrice - $Trade_Price_24h_ago) / $Trade_Price_24h_ago) * 100"
      )
    }
  }
}

Similar queries