query with index

Returns DEX trades on Ethereum and BNB Chain, sorted by block height transaction index, highest first: block height, timestamp time, trade index, transaction index, transaction hash, buy currency symbol, buy currency address and 5 more fields.

By Aleksey · saved 26 June 2021 · Bitquery API v1

What it returns

The query

query ($fromBlock: Int, $toBlock: Int) {
  ethereum(network: bsc) {
    dexTrades(
      height: {gteq: $fromBlock, lteq: $toBlock}
      options: {desc: ["block.height", "transaction.index"]}
    ) {
      block {
        height
        timestamp {
          time(format: "%Y-%m-%d %H:%M:%S")
        }
      }
      tradeIndex
      transaction {
        index
        hash
      }
      buyCurrency {
        symbol
        address
      }
      sellCurrency {
        symbol
        address
      }
      buyAmount
      sellAmount
      price
    }
  }
}

Variables

{
  "fromBlock": 720000,
  "toBlock": 725000
}

Similar queries