testt

Returns 50 DEX trades on Ethereum and BNB Chain, where smart contract address is 0x60c9…dcf5 and time since 2021-12-03, sorted by time interval time: hour, base currency symbol, base currency address, quote currency symbol, quote currency address, full name, quote price and 3 more fields.

By Mahmut Yaman · saved 3 December 2021 · Bitquery API v1

What it returns

Filters

The query

query ($currency1: String!, $currency2: String!, $pair: String!, $startTime: ISO8601DateTime!, $limit: Int!, $network: EthereumNetwork!) {
  ethereum(network: $network) {
    latestTrades: dexTrades(
      options: {asc: "timeInterval.time", limit: $limit}
      time: {since: $startTime}
      smartContractAddress: {is: $pair}
      any: [{baseCurrency: {is: $currency1}, quoteCurrency: {is: $currency2}}]
    ) {
      timeInterval {
        time: hour(count: 4, format: "%FT%TZ")
      }
      baseCurrency {
        symbol
        address
      }
      quoteCurrency {
        symbol
        address
      }
      exchange {
        fullName
      }
      median: quotePrice(calculate: median)
      high: quotePrice(calculate: maximum)
      low: quotePrice(calculate: minimum)
      open: minimum(of: time, get: quote_price)
      close: maximum(of: time, get: quote_price)
      volume: quoteAmount(calculate: sum, in: USD)
    }
  }
}

Variables

{
  "currency1": "0x293c3ee9abacb08bb8ced107987f00efd1539288",
  "currency2": "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c",
  "pair": "0x60c9bd6eee0a911b987a749f0db0f24d79bcdcf5",
  "startTime": "2021-12-03T00:00:00.00Z",
  "limit": 50,
  "network": "bsc"
}

Similar queries