High_Low_|_Current_Price

Returns the latest DEX trade on Ethereum, where base currency is 0xb569…8b05, quote currency is 0xc02a…6cc2 and time since 2018-01-13: year, base currency name, quote currency name, quote price, maximum of quote price, minimum of quote price, expression and 6 more fields.

By Omkar_BQ · saved 24 November 2023 · run 6 times · Bitquery API v1

What it returns

Filters

The query

{
 ethereum(network: ethereum) {
   highlow: dexTrades(
     baseCurrency: {is: "0xb569e1739a452585ce799ef3b0c606a4f0e28b05"}
     quoteCurrency: {is: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"}
     time: {since: "2018-01-13T00:00:00Z", till: "2023-12-20T00:00:00Z"}
     priceAsymmetry: {lt: 1}
     tradeAmountUsd: {gt: 50}
     options: {limit: 10, desc: "timeInterval.year"}
   ) {
     timeInterval {
       year(count: 5)
     }
     baseCurrency {
       name
     }
     quoteCurrency {
       name
     }
     high: quotePrice(calculate: maximum)
     high_timestamp:maximum(of:quote_price,get:time)
     low: quotePrice(calculate: minimum)
     low_timestamp:minimum(of:quote_price,get:time)
   }
  current_price:dexTrades(
      options: {desc: ["block.height", "tradeIndex"], limit: 1}
      baseCurrency: {is: "0xb569e1739a452585ce799ef3b0c606a4f0e28b05"}
     quoteCurrency: {is: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"}
    ) {
      quotePrice
      USDPrice: expression(get: "quoteAmountUSD / baseAmount")
      block {
        height
      }
      tradeIndex
      baseAmount
      baseCurrency {
        symbol
      }
      quoteAmountUSD:quoteAmount(in: USD)
      quoteCurrency {
        symbol
      }
    }
 }
}

Similar queries