realtime usd price of a token

Historical data This query uses the realtime dataset (the default), which holds only a recent window - hours to days depending on the cube. For older data add a dataset to the top-level element: EVM(network: bsc, dataset: combined) archive full history combined archive + realtime in one result Ar

By Kshitij Mahajan · saved 20 June 2025 · run 64 times · Bitquery API v2

What it returns

Filters

The query

# Historical data
#   This query uses the realtime dataset (the default), which holds only a
#   recent window - hours to days depending on the cube.
#
#   For older data add a dataset to the top-level element:
#
#     EVM(network: bsc, dataset: combined)
#
#     archive   full history
#     combined  archive + realtime in one result
#
#   Archive and combined need the historical data add-on:
#   https://bitquery.io/pricing
#
# Datasets:  https://docs.bitquery.io/docs/graphql/dataset/archive/
# Retention: https://docs.bitquery.io/docs/graphql/data-coverage-retention/
#

{
  EVM(network: bsc) {
    DEXTrades(
      where: {Trade: {Buy: {Currency: {SmartContract: {is: "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c"}}}}}
      limit: {count: 1}
      orderBy: {descending: Block_Time}
    ) {
      Block {
        Number
        Time
      }
      Transaction {
        From
        To
        Hash
      }
      Trade {
        Buy {
          Amount
          Buyer
          Currency {
            Name
            Symbol
            SmartContract
          }
          Seller
          Price
          PriceInUSD
        }
        Sell {
          Amount
          Buyer
          Currency {
            Name
            SmartContract
            Symbol
          }
          Seller
          Price
          PriceInUSD
        }
        PriceAsymmetry(selectWhere: {lt: 1})
      }
    }
  }
}

Similar queries