OHLC query

Returns 10 DEX trades on Ethereum and BNB Chain, where quote currency is 0xe9e7…7d56 or 0x8076…d8d3, base currency is 0xbb4c…095c and exchange name is Pancake, sorted by USD, highest first: exchange name, timestamp time, base currency address, base currency symbol, quote currency address, quote currency symbol, trade amount and 4 more fields.

By gaurav · saved 3 May 2021 · run 7 times · Bitquery API v1

What it returns

Filters

The query

query ($network: EthereumNetwork!, $starttime: ISO8601DateTime, $endtime: ISO8601DateTime) {
  ethereum(network: $network) {
    dexTrades(
      options: {desc: "USD", limit: 10}
      exchangeName: {is: "Pancake"}
      quoteCurrency: {in: ["0xe9e7cea3dedca5984780bafc599bd69add087d56", "0x8076c74c5e3f5852037f31ff0093eeb8c8add8d3"]}
      time: {since: $starttime, till: $endtime}
      baseCurrency: {in: ["0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c"]}
    ) {
      exchange {
        name
      }
      block {
        timestamp {
          time(format: "%Y-%m-%d %H")
        }
      }
      baseCurrency {
        address
        symbol
      }
      quoteCurrency {
        address
        symbol
      }
      USD: tradeAmount(in: USD, calculate: sum)
      Txs: count
      maximum_price: quotePrice(calculate: maximum)
      minimum_price: quotePrice(calculate: minimum)
      open_price: minimum(of: block, get: quote_price)
      close_price: maximum(of: block, get: quote_price)
    }
  }
}

Variables

{
  "network": "bsc",
  "starttime": "2021-04-18T15:00:00Z",
  "endtime": "2021-04-19T22:00:00Z"
}

Similar queries