token price on dex overtime

Returns the latest 5 DEX trades on Ethereum, where base currency is 0x6942…9528, quote currency is 0xC02a…6Cc2 and exchange name is Uniswap: timestamp time, count and quote price.

By Emmanuel Ajala · saved 6 May 2024 · Bitquery API v1

What it returns

Filters

The query

query getPrices($till: ISO8601DateTime) {
  ethereum(network: ethereum) {
    dexTrades(
      options: {limit: 5, desc: "block.timestamp.time"}
      baseCurrency: {is: "0x69420E3A3aa9E17Dea102Bb3a9b3B73dcDDB9528"}
      quoteCurrency: {is: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"}
      tradeAmountUsd: {gt: 0}
      time: {till: $till}
      exchangeName: {is: "Uniswap"}
    ) {
      block {
        timestamp {
          time(format: "%Y-%m-%d %H:%M:%S")
        }
      }
      count
      quotePrice(calculate: median)
    }
  }
}

Variables

{"till": "2024-05-08T00:00:00.000Z"}

Similar queries