How to get quotePrice in USD

Returns DEX trades on Ethereum and BNB Chain, where exchange address is 0xcA14…0c73, base currency is 0x9fd8…618f and quote currency is 0xbb4C…095c, sorted by time interval minute: minute, quote amount, quote price, minimum of block and maximum of block.

By Sayon · saved 22 September 2021 · Bitquery API v1

What it returns

Filters

The query

query Sayon($from: ISO8601DateTime, $to: ISO8601DateTime, $token: String, $resolution: Int){
  ethereum(network: bsc) {
    dexTrades(
      options: {asc: "timeInterval.minute"}
      date: {since: $from, till: $to}
      exchangeAddress: {is: "0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73"}
      baseCurrency: {is: $token},
      quoteCurrency: {is: "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c"},
      tradeAmountUsd: {gt: 10}
    )
    {
      timeInterval {
        minute(count: $resolution, format: "%Y-%m-%dT%H:%M:%SZ")
      }
      volume: quoteAmount(in: USD)
      high: quotePrice(calculate: maximum)
      low: quotePrice(calculate: minimum)
      open: minimum(of: block, get: quote_price)
      close: maximum(of: block, get: quote_price)
    }
  }
}

Variables

{
  "resolution": 5,
  "from": "2021-09-01",
  "to": null,
  "token": "0x9fd87aefe02441b123c3c32466cd9db4c578618f"
  
}

Similar queries