TokenMaxPriceFinder

Returns one DEX trade on Ethereum, where buy currency is 0x2260…c599, sell currency is 0xdac1…1ec7 or 0xa0b8…eb48 and date since 2018-11-24, sorted by price in USD, highest first: block height, day, trade amount, transaction hash, buy amount and expression.

By Aakriti · saved 24 March 2024 · run 5 times · Bitquery API v1

What it returns

Filters

The query

query TokenMaxPriceInUSD{
  ethereum(network: ethereum) {
    dexTrades(
      options: {desc: "priceInUsd", limit: 1} ## desc in priceUsd because we can set limit as 1 and the points and data consumed will be much lesser
      buyCurrency: {is: "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599"} ##bitcoin address
      sellCurrency: {in: ["0xdac17f958d2ee523a2206206994597c13d831ec7" , "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"]} ## sell currency - USDT 
      date: {since: "2018-11-24"} ## query Token deployement date gives us the contract creation date of our token
    ) {
      block {
        height ## Height - blockNumber at which the highest price was recorded.
      }
      timeInterval {
        day ##Day at which the highest price was achieved
      }
      tradeAmount: tradeAmount(in: BTC)
      transaction {
        hash
      }
      buyAmount
      buy_amount_usd: buyAmount(in: USD)
      priceInUsd: expression(get: "buy_amount_usd/buyAmount")
    }
  }
}

Similar queries