Trade exampple

Returns 10 DEX trades on Ethereum, where base currency is 0x761d…60f3, quote currency is 0xc02a…6cc2 and protocol is Uniswap v2: timestamp time, transaction hash, trade index, base currency symbol, base currency address, base amount, quote currency symbol and 6 more fields.

By Aleksey · saved 1 November 2021 · Bitquery API v1

What it returns

Filters

The query

query ($baseAddress: String, $quoteAddress: String, $from: ISO8601DateTime!, $to: ISO8601DateTime!, $protocol: String, $exchangeName: String) {
  ethereum(network: ethereum) {
    dexTrades(
      protocol: {is: $protocol}
      baseCurrency: {is: $baseAddress}
      quoteCurrency: {is: $quoteAddress}
      date: {between: [$from, $to]}
      exchangeName: {is: $exchangeName}
      options: {limit: 10}
    ) {
      block {
        timestamp {
          time
        }
      }
      transaction {
        hash
      }
      tradeIndex
      buyCurrency: baseCurrency {
        symbol
        address
      }
      buyAmount: baseAmount
      sellCurrency: quoteCurrency {
        symbol
        address
      }
      volume: quoteAmount
      trades: count
      high: quotePrice(calculate: maximum)
      low: quotePrice(calculate: minimum)
      open: minimum(of: block, get: quote_price)
      close: maximum(of: block, get: quote_price)
    }
  }
}

Variables

{
  "from": "2021-10-01T21:18:24+03:00",
  "to": "2021-11-01T11:19:24+02:00",
  "interval": 30,
  "baseAddress": "0x761d38e5ddf6ccf6cf7c55759d5210750b5d60f3",
  "quoteAddress": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
  "protocol": "Uniswap v2",
  "exchangeName": "Uniswap"
}

Similar queries