USD Price of Token at Timestamp

Returns 10 DEX trades on Ethereum, where buy currency is 0xc02a…6cc2 and time is 2023-05-17, 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 Divyasshree N · saved 13 September 2023 · run 29 times · Bitquery API v1

What it returns

Filters

The query

query ( $at: ISO8601DateTime!, $limit: Int) {
  ethereum(network: ethereum) {
    dexTrades(
      time: {is: $at}
      options: {limit: $limit, asc: ["block.height", "tradeIndex"]}
      buyCurrency: {is: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"}
    ) {
      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 / sellAmount")
      maker {
        address
      }
      taker {
        address
      }
      protocol
      exchange {
        address {
          address
        }
        name
      }
      smartContract {
        address {
          address
        }
      }
    }
  }
}

Variables

{
  "at": "2023-05-17T12:21:59.000Z",
  "limit": 10
}

Similar queries