In this thread, we attempt to further the discussion of a key problem in the oracle category and evolve our understanding of the space where research work has not yet answered the specific problem or question being considered.
As smart contract platforms such as the Ethereum blockchain continue to accelerate in demand and blockspace becomes increasingly scarce, new dynamics have arisen that allow specific network participants to capture value from unsuspecting users. As explored in a recent study, “Flash Boys 2.0”, this takes the form of what is known as Miner Extractable Value (MEV), which describes the opportunities that blockchain miners have to extract value from users by manipulating the order of transactions and their inclusion when mining blocks.
While miners represent the lower bound of who can profit from MEV (as they ultimately control the ordering of transactions within a block), the most common form of MEV seen today in the wild is from arbitrage bots that monitor the transaction mempool for profitable opportunities and frontrun specific transactions such as trades on a decentralized exchange (often by placing a buy order with a higher gas price ahead of the trade and selling afterwards). As a result, the original trader experiences a higher amount of slippage than normal and the arbitrage bot profits from the difference, corrupting the trading experience and siphoning value directly from users. Additionally, in the worst of cases, this can cause chain instability if the profit from MEV is higher than the block reward as miners are incentivized to orphan blocks and take the profits for themselves.
MEV tactics have also gotten more advanced in recent times, as documented in a recent article titled “Ethereum is a Dark Forest” by Dan Robinson. We are now seeing the use of generalized frontrunners that don’t look for specific transaction types (like a trade on Uniswap), but instead monitor and execute all transactions in the mempool to catch any opportunity where it is profitable to frontrun and/or replace the transaction with a copy using a higher gas price with their own address, essentially replacing the transaction and taking the profits for themselves. This has not only created difficulties for white hat hackers attempting to save user funds, but also directly raises the network’s transaction costs as arbitrage bots kick off gas price auction wars due to miners ordering transactions in a block by the highest gas price.
This generalized frontrunning of transactions is not only an issue for simple trades on decentralized exchanges but also presents an issue for other applications such as derivatives platforms which rely upon price oracle updates. These oracle updates, which also occur as on-chain transactions that go through the mempool, can be frontrun to extract value from liquidity providers within certain applications (e.g. placing a buy order on a perpetual futures contract before a price update occurs that increases the price, essentially creating risk free arbitrage). Some decentralized applications such as Synthetix have implemented a fix to this issue through fee reclamations/rebates, which create time delays in order to retroactively adjust the slippage of the trade if an oracle update occurs within that time period. However, such fixes break some forms of atomic composability and are not applicable in all situations. As a result, projects using price feed oracles also need to consider the issues caused by MEV.
While the concept of MEV is now more commonly discussed, there is still an open conversation to be had regarding potential solutions and the implications for applications and their users. Some questions include:
- What percentage of Ethereum’s bandwidth is currently wasted due to the gas auction wars caused by frontrunning bots?
- Are there backwards-compatible solutions to generalized frontrunning and MEV that do not require a network level hard fork to achieve?
- How can users protect themselves from being exploited from MEV and frontrunning bots when engaging with existing smart contract applications?
- Do any on-chain or off-chain “transaction ordering” services exist to prevent MEV and frontrunning?
I am curious about the urgency of this issue, particularly as DeFi continues to increase in total value locked, as well as any solutions that can be implemented today that can prevent the extraction of value from these arbitrage and frontrunning bots altogether.