Accurate Coin Price

You need to multiply Median price of WBNB/BUSD and $TARGET/WBNB median price to get the end results

By haxtuf · saved 22 August 2021 · run 1 time · Bitquery API v1

What it returns

Filters

The query

# You need to multiply Median price of WBNB/BUSD and $TARGET/WBNB median price to get the end results
{
  ethereum(network: bsc) {
    dexTrades(
      any: [{baseCurrency: {is: "0x8076c74c5e3f5852037f31ff0093eeb8c8add8d3"}, 
        quoteCurrency: {is: "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c"}},
        {baseCurrency: {is: "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c"}, 
          quoteCurrency: {is: "0xe9e7cea3dedca5984780bafc599bd69add087d56"}}]
      date: {since: "2021-08-22T20:48:00.000Z"}
      options: {desc: ["tradeIndex", "block.timestamp.time"], limitBy: {each: "baseCurrency.symbol", limit: 1}}
    ) {
      timeInterval{
        second(count: 1)
      }
      baseCurrency {
        symbol
        address
      }
      block {
        timestamp {
          time(format: "%Y-%m-%d %H:%M:%S")
        }
        height
      }
      tradeIndex
      buyAmount: baseAmount
      buyAmountInUsd: baseAmount
      quoteCurrency {
        symbol
        address
      }
      sellAmountInUsd: quoteAmount
      tradeAmount(in: USD)
      volume: quoteAmount
      trades: count
      median: quotePrice (calculate: median)
      high: quotePrice(calculate: maximum)
      low: quotePrice(calculate: minimum)
      open: minimum(of: block, get: quote_price)
      close: maximum(of: block, get: quote_price)
    }
  }
}

Similar queries