query dex

Returns one DEX trade on Ethereum, where buy currency is 0x0901…e5f6, sell currency is 0xc02a…6cc2 and exchange name is Uniswap, sorted by block height: price and block height.

By gaurav · saved 8 February 2022 · Bitquery API v1

What it returns

Filters

The query

{
  ethereum(network: ethereum) {
    during: dexTrades(
      exchangeName: {is: "Uniswap"}
      options: {asc: "block.height"}
      buyCurrency: {is: "0x090185f2135308bad17527004364ebcc2d37e5f6"}
      sellCurrency: {is: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"}
      height: {between: [13852566, 13852665]}
    ) {
      price
      block {
        height
      }
    }
    before: dexTrades(
      exchangeName: {is: "Uniswap"}
      options: {limit: 1, desc: "block.height"}
      buyCurrency: {is: "0x090185f2135308bad17527004364ebcc2d37e5f6"}
      sellCurrency: {is: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"}
      height: {lt: 13852566}
    ) {
      price
      block {
        height
      }
    }
    after: dexTrades(
      exchangeName: {is: "Uniswap"}
      options: {limit: 1, asc: "block.height"}
      buyCurrency: {is: "0x090185f2135308bad17527004364ebcc2d37e5f6"}
      sellCurrency: {is: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"}
      height: {gt: 13852665}
    ) {
      price
      block {
        height
      }
    }
  }
}

Similar queries