tp-tp

Returns 500 DEX trades on Ethereum and BNB Chain, where base currency is 0x7130…ad9c, quote currency is 0xe9e7…7d56 and time before 2022-06-04, sorted by time interval minute, highest first: minute, base currency symbol, base currency address, base amount, quote currency symbol, quote currency address, quote amount and 4 more fields.

By gaurav · saved 4 June 2022 · Bitquery API v1

What it returns

Filters

The query

query ($baseAddress: String, $quoteAddress: String, $from: ISO8601DateTime!, $interval: Int, $limit: Int, $offset: Int, $network: EthereumNetwork!) {
  ethereum(network: $network) {
    dexTrades(
      baseCurrency: {is: $baseAddress}
      quoteCurrency: {is: $quoteAddress}
      time: {before: $from}
      options: {limit: $limit, offset: $offset, desc: "timeInterval.minute"}
      priceAsymmetry: {lt: 0.7}
      any: [{tradeAmountUsd: {gt: 0.00001}}, {tradeAmountUsd: {is: 0}}]
    ) {
      timeInterval {
        minute(format: "%Y-%m-%dT%H:%M:%S:000Z", count: $interval)
      }
      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": "2022-06-04T15:37:54.827Z",
  "interval": 30,
  "baseAddress": "0x7130d2a12b9bcbfae4f2634d864a1ee1ce3ead9c",
  "quoteAddress": "0xe9e7cea3dedca5984780bafc599bd69add087d56",
  "limit": 500,
  "offset": 0,
  "network": "bsc"
}

Similar queries