expression_feature_example

Returns 50 DEX trades on Ethereum and BNB Chain, where quote currency is 0xbb4c…095c, time since 2022-12-01 and trade amount USD is above 10, sorted by base currency name amount expression, highest first: base currency name, base currency address, base currency symbol, trade amount, minimum of block, maximum of block, buy amount and 5 more fields.

By Andrey · saved 3 January 2023 · run 2 times · Bitquery API v1

What it returns

Filters

The query

query GetTopGainers {
  ethereum(network: bsc) {
    dexTrades(
      options: {desc: ["baseCurrency.name", "amount_expression"], limit: 50, limitBy: {each: "buyCurrency.name, a.b", limit: 2}}
      quoteCurrency: {is: "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c"}
      time: {since: "2022-12-01"}
      tradeAmountUsd: {gt: 10}
    ) {
      baseCurrency {
        name
        address
        symbol
      }
      tradeAmount(in: USD)
      open_price: minimum(of: block, get: quote_price)
      close_price: maximum(of: block, get: quote_price)
      buyAmount
      sellAmount
      price_expression: expression(get: "close_price / open_price)")
      Price_expressionX2: expression(get: "price_expression * 2")
      open_price_x2: expression(get: "open_price * 2")
      amount_expression: expression(get: "buyAmount - sellAmount")
      buyCurrency {
        address
        name
      }
      a: sellCurrency {
        b: address
      }
    }
  }
}

Similar queries