old query

Returns 500 DEX trades on Ethereum and BNB Chain, where base currency is 0x7130…ad9c, quote currency is 0xbb4c…095c and time before 2023-01-27, 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 linthertoss · saved 27 January 2023 · run 1 time · Bitquery API v1

What it returns

Filters

The query

query getTradingData($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}
     
    ) {
      timeInterval {
        minute(format: "%FT%TZ", count: $interval)
        __typename
      }
      buyCurrency: baseCurrency {
        symbol
        address
        __typename
      }
      buyAmount: baseAmount
      sellCurrency: quoteCurrency {
        symbol
        address
        __typename
      }
      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)
      __typename
    }
    __typename
  }
}

Variables

{
  "from": "2023-01-27T17:32:25.589Z",
  "interval": 30,
  "baseAddress": "0x7130d2a12b9bcbfae4f2634d864a1ee1ce3ead9c",
  "quoteAddress": "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c",
  "limit": 500,
  "offset": 1000,
  "network": "bsc"
}

Similar queries