Get price token to show tradingview chart

Returns DEX trades on Ethereum and BNB Chain, where base currency is 0xbb4c…095c, quote currency is 0xe9e7…7d56 and exchange name is Pancake: minute, base currency symbol, base currency address, base amount, quote currency symbol, quote currency address, protocol and 5 more fields.

By linthertoss · saved 21 May 2022 · run 24 times · Bitquery API v1

What it returns

Filters

The query

query (
  $baseAddress: String
  $quoteAddress: String
  $from: ISO8601DateTime!
  $interval: Int
  
  $exchangeName: String
) {
  ethereum(network: bsc) {
    dexTrades(
     
      baseCurrency: { is: $baseAddress }
      quoteCurrency: { is: $quoteAddress }
      time: { since: $from }
      exchangeName: { is: $exchangeName }
      priceAsymmetry: { lt: 0.7 }
      any: [{ tradeAmountUsd: { gt: 0.00001 } }, { tradeAmountUsd: { is: 0 } }]
    ) {
      timeInterval {
        minute(format: "%FT%TZ", count: $interval)
      }
      buyCurrency: baseCurrency {
        symbol
        address
      }
      buyAmount: baseAmount
      sellCurrency: quoteCurrency {
        symbol
        address
      }
      protocol
      volume: quoteAmount
      trades: count
      high: quotePrice(calculate: maximum)
      low: quotePrice(calculate: minimum)
      open: minimum(of: block, get: quote_price)
      close: maximum(of: block, get: quote_price)
    }
  }
}

Variables

{
   "from": "2022-01-01T00:00:00",
    "interval": 30,
    "baseAddress": "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c",
    "quoteAddress": "0xe9e7cea3dedca5984780bafc599bd69add087d56",
    "protocol": "Pancake v2",
    "exchangeName": "Pancake"
}

Similar queries