vol 24

Returns 3 DEX trades on Ethereum and BNB Chain, where base currency is 0xd6fD…44ec, quote currency is 0xbb4c…095c and time till 2024-03-20, sorted by trade amount, highest first: address address, base currency symbol, base currency name, decimals, base currency address, quote currency name, quote currency address and 8 more fields.

By gaurav · saved 20 March 2024 · run 1 time · Bitquery API v1

What it returns

Filters

The query

query ($network: EthereumNetwork!, $limit: Int, $from: ISO8601DateTime, $till: ISO8601DateTime) {
  ethereum(network: $network) {
    dexTrades(
      baseCurrency: {is: "0xd6fDDe76B8C1C45B33790cc8751D5b88984c44ec"}
      quoteCurrency: {in: ["0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c"]}
      time: {since: $from, till: $till}
      date: {after: "2024-03-18"}
      options: {limit: $limit, desc: "tradeAmount", limitBy: {each: "baseCurrency.address, quoteCurrency.address", limit: 1}}
    ) {
      smartContract {
        address {
          address
        }
      }
      baseCurrency {
        symbol
        name
        decimals
        address
      }
      quoteCurrency {
        name
        address
      }
      open_price: minimum(of: block, get: quote_price)
      close_price: maximum(of: block, get: quote_price)
      open_price_time: minimum(of: block, get: time)
      close_price_time: maximum(of: block, get: time)
      diff: expression(get: "close_price - open_price")
      div: expression(get: "diff / open_price")
      final: expression(get: "div * 100")
      count
      tradeAmount(in: USD)
      quotePrice
      quoteVolumeUSD: quoteAmount(in: USD, calculate: sum)
      quoteVolume: quoteAmount(calculate: sum)
      baseVolume: baseAmount(calculate: sum)
      baseVolumeUSD: baseAmount(in: USD, calculate: sum)
    }
  }
}

Variables

{
  "baseCurrency": "0xd6fDDe76B8C1C45B33790cc8751D5b88984c44ec",
  "network": "bsc",
  "limit": 3,
  "From": "2024-03-19T18:24:54",
  "till": "2024-03-20T18:24:54"
}

Similar queries