Filtering Uniswap data by block height

Hi,

I wonder if it is possible to filter a Uniswap query by last block number similarly to the BSC filter below?

options: {desc: ["block.height","tradeIndex"], limit: 1}

Yes, use this same filter in the Uniswap query… What you are trying to accomplish? Also show me your query.

I’m trying to get all Uniswap trades in the most recent Ethereum block by running this query:

{
  ethereum(network: ethereum) {
    dexTrades(
      exchangeName: {in: "Uniswap"}
      options: {desc: ["block.height"], limit: 1}
    ) {
      block {
        height
      }
      transaction {
        index
      }
      baseCurrency {
        symbol
      }
      quoteCurrency {
        symbol
      }
      quotePrice
    }
  }
}

However, I get an internal server error as a result:

[ { "message": "ActiveRecord::ActiveRecordError: Response code: 500:\n<html>\r\n<head><title>500 Internal Server Error</title></head>\r\n<body bgcolor=\"white\">\r\n<center><h1>500 Internal Server Error</h1></center>\r\n<hr><center>nginx</center>\r\n</body>\r\n</html>\r\n", "locations": [ { "line": 3, "column": 5 } ], "path": [ "ethereum", "dexTrades" ] } ]
{
  "ethereum": {
    "dexTrades": null
  }
}

Try This.

{
  ethereum(network: ethereum) {
    dexTrades(
      exchangeName: {in: ["Uniswap", "Uniswap v2"]}
      date: {since: "2021-06-15"}
      options: {desc: ["block.height", "tradeIndex"], limit: 1}
    ) {
      block {
        height
      }
      tradeIndex
      transaction {
        index
      }
      baseCurrency {
        symbol
      }
      quoteCurrency {
        symbol
      }
      quotePrice
    }
  }
}

Thank you! Looks like the additional date filter solved the problem.