getBars-matic-example

Returns 10 DEX trades on Ethereum and Polygon, where trade amount USD is above 10, sorted by time interval minute, highest first: minute, base currency symbol, base currency address, quote currency symbol, quote currency address, quote amount, quote price and 2 more fields.

By Sayon · saved 12 August 2021 · run 6 times · Bitquery API v1

What it returns

Filters

The query

query (
  # $from: ISO8601DateTime!, 
  # $to: ISO8601DateTime!, 
  $interval: Int, 
  $baseAddress: String) {
  ethereum(network: matic) {
    dexTrades(
      options: {desc: "timeInterval.minute", limit: 10}
      # date: {between: [$from, $to]}
      any: [
        {
          baseCurrency: {is: $baseAddress}, quoteCurrency: {is: "0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270"}
        },
        {
          baseCurrency: {is: "0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270"}, quoteCurrency: {is: "0x2b21ca040e745704a2b5eca8aada6b603d8a46fd"}
        }
      ]
      tradeAmountUsd: {gt: 10}
    ) {
      timeInterval {
        minute(count: $interval)
      }
      baseCurrency {
        symbol
        address
      }
      quoteCurrency {
        symbol
        address
      }
      volume: quoteAmount
      low: quotePrice(calculate: minimum)
      high: quotePrice(calculate: maximum)
      open: minimum(of: block, get: quote_price)
      close: maximum(of: block, get: quote_price)
    }
  }
}

Variables

{
  "from": "2021-05-01T00:00:05Z",
  "to": "2021-05-01T04:20:05Z",
  "interval": 5,
  "baseAddress": "0x0000000000004946c0e9f43f4dee607b0ef1fa1c"
}

Similar queries