bsc pancakeswap ohlc using trading api

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 Kshitij Mahajan · saved 18 November 2025 · run 2 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(dataset: realtime) {
    Pairs(
      where: {
        Price: {IsQuotedInUsd: false}, 
        Interval: {Time: {Duration: {eq: 1}}}, 
        Currency: {Id: {is: "bid:eth"}}, 
        QuoteCurrency: {Id: {is: "usdc"}}, 
        Market: {Protocol: {is: "pancake_swap_v3"}}
      }
      limit: {count: 10}
      orderBy: {descending: Interval_Time_End}
    ) {
      Token {
        Id
        Symbol
        Address
        NetworkBid
        Network
        Name
      }
      QuoteToken {
        Id
        Symbol
        Address
        Name
        NetworkBid
      }
      Interval {
        Time {
          Start
          End
          Duration
        }
      }
      Volume {
        Usd
        Quote
        Base
      }
      Price {
        IsQuotedInUsd
        Ohlc {
          Open
          High
          Low
          Close
        }
        Average {
          Estimate
          ExponentialMoving
          Mean
          SimpleMoving
          WeightedSimpleMoving
        }
      }
    }
  }
}

Similar queries