Usd Value at specific time

Returns the latest DEX trade on Ethereum and BNB Chain, where buy currency is 0xbb4c…095c, time since 2024-03-20 and time till 2024-03-20: timestamp time, block height, trade index, protocol, full name, buy amount, buy currency symbol and 4 more fields.

By gaurav · saved 22 March 2024 · run 3 times · Bitquery API v1

What it returns

Filters

The query

{
  ethereum(network: bsc) {
    dexTrades(
      options: {desc: ["block.height", "tradeIndex"], limit: 1, offset: 0}
      buyCurrency: {is: "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c"}
      time: {since: "2024-03-20T22:59:59" till: "2024-03-20T23:59:59"}
    ) {
      block(time: {}) {
        timestamp {
          time(format: "%Y-%m-%d %H:%M:%S")
        }
        height
      }
      tradeIndex
      protocol
      exchange {
        fullName
      }
      buyAmount
      buyCurrency {
        symbol
      }
      buy_amount_usd: buyAmount(in: USD)
      sellAmount
      sellCurrency {
        symbol
      }
      sell_amount_usd: sellAmount(in: USD)
      priceInUSD: expression(get: "sell_amount_usd / buyAmount")
      transaction {
        hash
      }
    }
  }
}

Similar queries