subscribe-matic-example

Returns 10 DEX trades on Ethereum and Polygon, where trade amount USD is above 10, sorted by time interval minute, highest first: second, 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 1 time · Bitquery API v1

What it returns

Filters

The query

query (
  # $from: ISO8601DateTime!, 
  # $to: ISO8601DateTime!, 
  $baseAddress: String
) {
  ethereum(network: matic) {
    dexTrades(
      options: {limit: 10, desc: "timeInterval.minute"}
      # date: {between: [$from, $to]}
      # time: {between: [$from, $to]}
      any: [{baseCurrency: {is: $baseAddress}, quoteCurrency: {is: "0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270"}}, {baseCurrency: {is: "0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270"}, quoteCurrency: {is: "0x2b21ca040e745704a2b5eca8aada6b603d8a46fd"}}]
      tradeAmountUsd: {gt: 10}
    ) {
      timeInterval {
        minute: second(count: 10)
      }
      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

{
  "baseAddress": "0x0000000000004946c0e9f43f4dee607b0ef1fa1c"
}

Similar queries