USD price of an asset

Returns one DEX trade on Ethereum, where buy currency is 0xef8e…6199, time after 2023-05-25 and time before 2023-05-27, sorted by block height trade index: block height, iso8601, transaction hash, trade index, buy currency symbol, buy currency address, buy currency name and 13 more fields.

By gaurav · saved 26 May 2023 · run 27 times · Bitquery API v1

What it returns

Filters

The query

query ($from: ISO8601DateTime!, $to: ISO8601DateTime!, $limit: Int) {
  ethereum(network: ethereum) {
    dexTrades(
      time: {after: $from, before: $to}
      options: {limit: $limit, asc: ["block.height", "tradeIndex"]}
      buyCurrency: {is: "0xef8e456967122db4c3c160314bde8d2602ad6199"}
    ) {
      block {
        height
        timestamp {
          iso8601
        }
      }
      transaction {
        hash
      }
      tradeIndex
      buyCurrency {
        symbol
        address
        name
        tokenType
        decimals
      }
      buyAmount
      buyAmountUSD: buyAmount(in: USD)
      sellCurrency {
        symbol
        address
        name
        tokenType
        decimals
      }
      sellAmount
      sellAmountUSD: sellAmount(in: USD)
      usdPrice: expression(get: "buyAmountUSD / buyAmount")
      maker {
        address
      }
      taker {
        address
      }
      protocol
      exchange {
        address {
          address
        }
        name
      }
      smartContract {
        address {
          address
        }
      }
    }
  }
}

Variables

{
  "from": "2023-05-25T12:06:59.000Z",
  "to": "2023-05-27T12:06:59.000Z",
  "limit": 1
}

Similar queries