historical price and historical volume

Historical data The Trading cube covers real time and roughly the last 30 days. For anything older, rebuild the same numbers from raw trades with DEXTradeByTokens. Datasets: https://docs.bitquery.io/docs/graphql/dataset/archive/ Retention: https://docs.bitquery.io/docs/graphql/data-coverage-retenti

By Akshat · saved 20 February 2026 · run 14 times · Bitquery API v2

What it returns

Filters

The query

# Historical data
#   The Trading cube covers real time and roughly the last 30 days. For
#   anything older, rebuild the same numbers from raw trades with
#   DEXTradeByTokens.
#
# Datasets:  https://docs.bitquery.io/docs/graphql/dataset/archive/
# Retention: https://docs.bitquery.io/docs/graphql/data-coverage-retention/
#

{
  Trading {
    Tokens(
      where: {Interval: {Time: {Duration: {eq: 1}}}, Block: {Time: {since_relative: {hours_ago: 24}}}, Token: {Id: {in: ["bid:solana:9WHhgXJBGgxghkh5wAUWJFHVbnsRbonRYTnH2EChpump"]}}}
    ) {
      Currency {
        Id
        Name
        Symbol
      }
      Price {
        Average {
          currentPrice: Mean(maximum: Block_Time)
          H1Ago: Mean(
            minimum: Block_Time
            if: {Block: {Time: {since_relative: {hours_ago: 1}}}}
          )
          H4Ago: Mean(
            minimum: Block_Time
            if: {Block: {Time: {since_relative: {hours_ago: 4}}}}
          )
          H24Ago: Mean(
            minimum: Block_Time
            if: {Block: {Time: {since_relative: {hours_ago: 24}}}}
          )
        }
      }
      v1h: sum(of: Volume_Usd, if: {Block: {Time: {since_relative: {hours_ago: 1}}}})
      v4h: sum(of: Volume_Usd, if: {Block: {Time: {since_relative: {hours_ago: 4}}}})
      v24h: sum(of: Volume_Usd)
    }
  }
}

Similar queries