Get OHLC

Returns 10 DEX trades on Ethereum and BNB Chain, where base currency is 0xbb4c…095c, quote currency is 0xe9e7…7d56 and time since 2022-04-05, sorted by time interval minute, highest first: minute, base currency symbol, base currency address, base amount, quote currency symbol, quote currency address, quote amount and 7 more fields.

By Hong · saved 5 April 2022 · run 1 time · Bitquery API v1

What it returns

Filters

The query

query ($network: EthereumNetwork!, $since: ISO8601DateTime, $till: ISO8601DateTime, $limit: Int, $offset: Int) {
  ethereum(network: $network) {
    dexTrades(
      options: {limit: $limit, offset: $offset, desc: "timeInterval.minute"}
      time: {since: $since, till: $till}
      baseCurrency: {
        is: "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c"
      }
      quoteCurrency: {
        is: "0xe9e7cea3dedca5984780bafc599bd69add087d56"
      }
    ) {
      timeInterval {
        minute(count: 1)
      }
      baseCurrency {
        symbol
        address
      }
      baseAmount
      quoteCurrency {
        symbol
        address
      }
      quoteAmount
      trades: count
      quotePrice
      maximum_price: quotePrice(calculate: maximum)
      minimum_price: quotePrice(calculate: minimum)
      median_price: quotePrice(calculate: median)
      open_price: minimum(of: block, get: quote_price)
      close_price: maximum(of: block, get: quote_price)
      smartContract {
        address {
          address
        }
        contractType
        currency {
          name
        }
      }
    }
  }
}

Variables

{
 "network": "bsc",
  "since": "2022-04-05T12:10:00Z",
  "till": "2022-04-05T12:59:00Z",
  "limit": 10,
  "offset": 0 
}

Similar queries