Marketcap of tokens

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 gaurav · saved 19 December 2025 · run 5 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 GetAthMarketCap($tokens: [String!]!) {
  Solana(dataset: combined) {
    DEXTradeByTokens(
      limitBy: {by: Trade_Side_Currency_MintAddress, count: 1}
      where: {Trade: {Currency: {MintAddress: {in: $tokens}}}}
    ) {
      Trade {
        Currency {
          MintAddress
          Name
          Symbol
        }
        PriceInUSD(maximum: Trade_PriceInUSD)
        Starting_Price: PriceInUSD(minimum: Block_Slot)
        Side {
          Currency {
            Name
            Symbol
            MintAddress
          }
        }
      }
      max: quantile(of: Trade_PriceInUSD, level: 0.98)
      quantile_price_ATH_Marketcap: calculate(expression: "$max * 1000000000")
      Real_maximum_price_ATH_Marketcap: calculate(
        expression: "$Trade_PriceInUSD_maximum * 1000000000"
      )
      Starting_Marketcap: calculate(expression: "$Trade_Starting_Price * 1000000000")
    }
  }
}

Variables

{
  "tokens": "8SAwv8EKMKaKnupTsYjoQdgBuWxJdo3ouA178UU7pump"
}

Similar queries