dechart query

Returns 1000 DEX trades on Ethereum, where base currency is 0xa0b8…eb48, quote currency is 0xc02a…6cc2 and date since 2021-08-16, sorted by time interval day: day, base currency symbol, base currency address, base amount, quote currency symbol, quote currency address, quote amount and 5 more fields.

By gaurav · saved 1 September 2021 · run 5 times · Bitquery API v1

What it returns

Filters

The query

query getBars($token0Id: String!, $token1Id: String!, $from: ISO8601DateTime!, $to: ISO8601DateTime!, $period: Int!, $network: EthereumNetwork!) {
  ethereum(network: $network) {
    dexTrades(
      options: {limit: 1000, asc: "timeInterval.day"}
      date: {since: $from, till: $to}
      baseCurrency: {is: $token0Id}
      quoteCurrency: {is: $token1Id}
    ) {
      timeInterval {
        day(count: $period, format: "%FT%TZ")
      }
      baseCurrency {
        symbol
        address
      }
      baseAmount
      quoteCurrency {
        symbol
        address
      }
      volume: quoteAmount
      trades: count
      quotePrice
      high: quotePrice(calculate: maximum)
      low: quotePrice(calculate: minimum)
      open: minimum(of: block, get: quote_price)
      close: maximum(of: block, get: quote_price)
      tradeAmount(in: USD)
    }
  }
}

Variables

{
  "from": "2021-08-16",
  "network": "ethereum",
  "period": 15,
  "to": "2021-09-01",
  "token0Id": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
  "token1Id": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
}

Similar queries