Redesigning Order Flow Auctions to Create a Sustainable DeFi Ecosystem
Article by Siddhearta | Edited by Trewkat | Cover Art by Chameleon
Maximal Extractable Value (MEV) has become an increasingly important topic in the DeFi ecosystem due to its negative effects on decentralized applications (dApps) and users. MEV can be understood as a hidden tax on dApps and users because it increases transaction costs, reduces liquidity provider profitability, and can negatively impact the user experience.
MEV refers to the maximum amount of profit that can be captured by MEV bots — also known as “searchers” — through their ability to identify and exploit opportunities which arise from the ordering, inclusion, or exclusion of transactions within a block. Processing transactions and securing the blockchain is the role of validators. They have the authority to determine the order of transactions in the blocks they validate, which in turn creates opportunities for searchers to maximize their profits. By monitoring the mempool for opportunities, searchers can execute various strategies such as front-running transactions, capitalizing on arbitrage opportunities, or even prioritizing certain transactions with higher gas fees over others, which can delay or cancel execution of lower gas transactions.
MEV Based on Oracle Updates
A subset of MEV is related to oracle updates and involves the exploitation of oracle data to gain an unfair advantage and extract profit. Oracles are essential components of DeFi as they provide real-time data to smart contracts. These data points enable various functions, including loan collateralization, token swaps, and derivatives trading. Given the critical role of oracles in DeFi applications, they can become targets for MEV attacks.
Frontrunning
In this scenario, a MEV searcher monitors the pending transactions in the mempool and submits its own transaction with a higher gas fee to ’jump the queue’ ahead of the targeted transaction. This allows the searcher to capitalize on opportunities before the original user can execute their intended transaction.
For example, if an oracle is about to update the price feed of a certain token, a searcher could use this information asymmetry to execute a trade or adjust its collateralization ratio in a lending platform to either maximize profit or minimize losses. This exploitation of the temporary price discrepancy will often leave other users worse off than they would have been without the interference.
Arbitrage
Oracles also enable communication between various blockchains. Given that assets can be traded on separate networks in the form of derivatives, oracles are used to relay price information across multiple liquidity sources, which can lead to both minor and significant price discrepancies. These discrepancies offer arbitrage opportunities across different asset pools.
MEV searchers can detect price differences across markets before updates take place. They capitalize on this by purchasing assets on cheaper markets and subsequently selling them on more expensive ones.
The API3 OEV Litepaper highlights both Synthetix and GMX as examples of how a lack of granularity due to deviation threshold-based rules which determine when the feed will update creates arbitrage opportunities that negatively impact protocol performance and the user experience. If a data feed displays a stale price compared to another market, searchers will compete to trade against that price, knowing they can immediately sell the asset on the other market for profit. This situation leads to a continuous stream of unprofitable trades that liquidity providers must accept, leading to losses and decreased protocol performance. These issues forced Synthetix to implement Uniswap Time-Weighted Average Price (TWAP) oracles alongside Chainlink to determine asset pricing. However, this solution was not perfect, as TWAP oracles inherently provide stale prices and introduce a further obstacle for listing additional assets.
Source: An example of a successful arbitrage transaction.
Liquidations
Oracle updates also provide an opportunity for profitable liquidations. MEV searchers can identify undercollateralized loans in lending platforms and quickly submit transactions to liquidate the loans before other users or bots can do so. By being the first to liquidate, the searcher can capture the liquidation bonuses and other rewards.
These are just a few examples of the different types of MEV attacks that can occur based on oracle updates within the blockchain and DeFi ecosystems. It’s a fairly constant battle as developers continue to design solutions to these attacks to enhance the security, fairness, and resilience of the network. Currently, there are two primary methods proposed to mitigate the problems of MEV: MEV-Boost and Proposer-Builder Separation (PBS).
MEV-Boost is an iteration of the original Flashbots mechanism and introduces a series of measures and roles which are designed to reduce the adverse effects of MEV, including the Builder API, block builders, escrows, validators, searchers, and relayers. The Builder API is a tool that allows validators and block builders to interact efficiently and prevents validators from manipulating the block’s content for MEV gain. Block builders construct profitable blocks using strategies from searchers who find advantageous transactions. These transactions are checked by relayers for validity before they reach validators, and escrows ensure that all necessary data is available. Once a block is added to the Ethereum network by a validator, they receive transaction fees and MEV rewards.
MEV-Boost benefits the Ethereum network by protecting against centralization, lowering of gas fees, and enhancing privacy for users. The mechanism democratizes access to MEV opportunities, reducing the risk of centralization and enabling solo stakers to access MEV profits without needing to join large staking pools.
Proposer-Builder Separation (PBS) is part of the planned Danksharding upgrade to Ethereum’s consensus layer that will see block proposals and block production managed by different entities. MEV-Boost serves as a precursor to in-protocol PBS, providing insights into what PBS might look like after it is implemented. PBS intends to reduce the impact of MEV on consensus-layer security and inspire the development of consensus-layer logic necessary for implementing external block-building in Ethereum.
However, neither PBS nor MEV-Boost directly addresses the MEV opportunities that arise from oracle updates. Rather, these methods primarily focus on reducing the negative effects of MEV on the decentralization and security of Ethereum’s consensus layer.
To tackle MEV opportunities specifically arising from oracle updates, a different approach is necessary.
Understanding the Opportunity for OEV-Share to Create Sustainable and Efficient dApps
MEV poses significant challenges for users and dApps but also presents an opportunity to design new solutions that can make the ecosystem more efficient. One of the opportunities to improve the efficiency of DeFi protocols is by addressing the MEV issues associated with oracle updates, which creates opportunities to capture Oracle Extractable Value, or OEV.
In the API3 OEV Litepaper, API3 introduced an off-chain marketplace that allows dApps to auction off meta-transactions signed by first-party oracles to update data feeds. In this model, searchers bid for the right to make oracle updates and collect the MEV associated with the transaction. The winning bid is distributed to the dApp and the external oracle provider. This creates a much more efficient system where price feeds are updated when the dApp requires them instead of being subject to deviation thresholds. Overall, this system design can be compared to the Flashbots relay, but searchers bid for oracle updates, not block space.
API3 is working to redesign the oracle update process to minimize the impact of MEV. By implementing novel mechanisms that protect oracle data from exploitation, they aim to ensure that oracle updates are more secure and transparent. This can lead to a more robust and efficient DeFi ecosystem, ultimately benefiting both users and applications.
The benefit of OEV is that the value captured by searchers is shared with the protocol where it originated. This method minimizes the negative externalities caused by MEV extraction from dApps and leads to the creation of accurate and low-latency oracles. In cases where MEV extraction does not incentivize oracle updates, price feeds are updated according to the normal deviation thresholds and heartbeat times.
Rather than fighting against MEV opportunities and trying to eliminate lost value in the network, OEV-Share takes advantage of shared incentives to recapture and repurpose the value from MEV opportunities to create a more efficient and sustainable DeFi ecosystem.
OEV Benefits the Entire DeFi Ecosystem
One of the core challenges oracles face is how to bring real-world data onchain. With cost limitations preventing data feed updates for every block, oracles must strategically decide when to update so oracle architecture plays a pivotal role in managing this challenge. This challenge has a negative impact on the DeFi ecosystem, resulting in reduced margins and contributing to potential losses. OEV-Share presents an opportunity to transform these challenges into advantages for users, dApps, and the entire DeFi ecosystem.
By using API3’s Order Flow auctions to capture OEV, dApps can minimize the negative externalities caused by MEV extraction. This model allows MEV searchers to bid for the right to update an oracle, turning a problem into an opportunity. The winning bid benefits both the users and the dApp, while the successful MEV searcher updates the oracle and captures the associated value.
The long-tail benefit of OEV is it leads to the creation of accurate and low-latency oracles. More accurate data and value capture from the Order Flow auctions can be used to enhance the profitability and sustainability of liquidity provision, allowing for a more optimal market-making protocol for apps that rely on oracles. Improved market-making for the dApp’s liquidity providers creates a flywheel effect, drawing more liquidity to the application while enabling the reduction of fees and listing of more assets, which in turn attracts more users and volume.
Oracle Extractable Value addresses a key challenge in the DeFi space by enhancing the efficiency of oracles and creating value for all parties involved. By minimizing the negative effects of MEV and improving data accuracy, API3 is paving the way for a more sustainable and profitable DeFi ecosystem.
Author Bio
Siddhearta is a writer and editor at BanklessDAO, an Associate at Bankless Consulting, and a contributor at API3.
Editor Bio
Trewkat is a writer, editor, and designer at BanklessDAO. She’s interested in learning about crypto and NFTs, with a particular focus on how best to communicate this knowledge to others.
Designer Bio
Chameleon is a designer and creator in the web3 space.
BanklessDAO is an education and media engine dedicated to helping individuals achieve financial independence.
Bankless Publishing is always accepting submissions for publication. We’d love to read your work, so please submit your article here!
This post does not contain financial advice, only educational information. By reading this article, you agree and affirm the above, as well as that you are not being solicited to make a financial decision, and that you in no way are receiving any fiduciary projection, promise, or tacit inference of your ability to achieve financial gains.
More like this
Distributed Ledger Technology 101 by The Crypto Barista
Oracles and DeFi by Bruvton
ZK-Rollups Transform the Trilemma to Dilemma by tommasogualtieri.eth