price of currency on different exchange

Returns the latest DEX trades on Ethereum, where base currency is 0xc02a…6cc2, quote currency is 0x6b17…1d0f and date since 2021-12-29: timestamp time, block height, trade index, full name, address address and quote price.

By gaurav · saved 30 December 2021 · run 1 time · Bitquery API v1

What it returns

Filters

The query

{
  ethereum(network: ethereum) {
    dexTrades(
      options: {desc: ["block.height", "tradeIndex"],
        limitBy: {each: "exchange.address.address", limit: 1}}
      date: {since: "2021-12-29"}
      baseCurrency: {is: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"}
      quoteCurrency: {is: "0x6b175474e89094c44da98b954eedeac495271d0f"}
    ) {
      block {
        timestamp {
          time(format: "%Y-%m-%d %H:%M:%S")
        }
        height
      }
      tradeIndex
      exchange {
        fullName
        address {
          address
        }
      }
      quotePrice
    }
  }
}

Variables

{
  "limit": 10,
  "offset": 0,
  "network": "ethereum",
  "from": "2021-12-01",
  "till": "2021-12-30T23:59:59",
  "dateFormat": "%Y-%m-%d"
}

Similar queries