Fetch latest price on Uniswap

Returns the latest DEX trade on Ethereum, where base currency is 0x2b59…eb39, quote currency is 0xdac1…1ec7 and exchange name is Uniswap: timestamp time, base currency symbol, base currency address, base amount, quote currency symbol, quote currency address, quote amount and 2 more fields.

By abc · saved 17 October 2021 · run 4 times · Bitquery API v1

What it returns

Filters

The query

{
  ethereum(network: ethereum) {
    dexTrades(
      options: {limit: 1, desc: "block.timestamp.time"}
      exchangeName: {is: "Uniswap"}
      baseCurrency: {is: "0x2b591e99afE9f32eAA6214f7B7629768c40Eeb39"}
      quoteCurrency: {is: "0xdac17f958d2ee523a2206206994597c13d831ec7"}
    ) {
      block {
        timestamp {
          time(format: "%Y-%m-%d %H:%M:%S")
        }
      }
      baseCurrency {
        symbol
        address
      }
      baseAmount
      quoteCurrency {
        symbol 
        address
      } 
      quoteAmount
      trades: count
      quotePrice
    }
  }
}

Similar queries