Capturing OEV in the Moonwell Protocol

Simple Summary

Moonwell contributors from Solidity Labs propose an innovative way to improve how liquidations occur on Moonwell, ensuring a more efficient capture of revenue from liquidation events. Currently, professional liquidators compete using bots to earn fees by liquidating risky underwater loans, which are vital to maintaining the health of Moonwell. With this proposal, Moonwell would introduce a “MEV tax,” charging liquidators for priority access to update price feeds and execute liquidations. This ensures that additional revenue remains within the protocol and not captured by offchain systems. Our approach ensures secure liquidations, maintains usage of trusted Chainlink oracles for price updates, and includes robust fallback mechanisms. We recommend starting with a phased rollout on a single market and expanding gradually to other markets. This initiative aims to enhance Moonwell’s revenue generation while maintaining our focus on safety, decentralization, and onchain innovation.

Key Terms

  1. Liquidations: The process of resolving underwater loans to maintain the health and stability of the Moonwell protocol.
  2. Chainlink Price Oracles: Trusted price feeds used for secure and accurate liquidation triggers.
  3. Oracle Extracted Value (OEV): The value or revenue captured when price updates from oracles trigger liquidations of undercollateralized loans.
  4. Mempool: A temporary storage area where pending transactions are held before being included in a blockchain block. It acts as a queue, allowing nodes to validate and broadcast transactions across the network. Miners or validators select transactions from the mempool, often prioritizing those with higher fees, for inclusion in the next block.
  5. MEV Relay: A service that captures and redistributes Maximum Extractable Value (MEV) by enabling searchers and validators to prioritize transactions in a block via off-chain auctions. These relays maximize value from opportunities like arbitrage, liquidation, or front-running, while often sharing a portion of the captured value with users or protocols.
  6. MEV Tax: A protocol-level fee charged to participants seeking to capture MEV, such as liquidators. This tax ensures that a portion of the MEV generated by prioritized transactions, like liquidations, is captured directly by the Moonwell protocol, rather than being retained by third parties or off-chain systems.

Introduction

Oracle extracted value, or OEV, is typically captured by professional liquidators, who run bots that immediately liquidate any underwater loans on Moonwell and earn a liquidation fee for doing so. These liquidators provide a vital function that keeps the Moonwell protocol healthy and minimizes the risk of the protocol taking on bad debt. Moonwell is a decentralized protocol, and anyone can perform this function onchain, so when a large position is liquidated, typically many bots compete to be first and capture the profit from doing so. The liquidation is triggered when the Chainlink price oracle is updated to reflect a new, lower price for collateral securing the loan, or a new, higher price for a borrowed asset, thus the term “Oracle extracted value” has emerged as an accurate description, as the liquidators attempt to be first to liquidate following the price update.

Liquidations on Ethereum Layer 2s

On Base and Optimism, there is no public mempool, so liquidators can’t participate in a MEV relay auction, such as Flashbots, by bidding to pay Ethereum block producers to re-order the oracle price update and make sure their liquidation lands in the same block directly after the update, so liquidators instead give their liquidation transaction a higher “priority fee” so the L2 sequencer run by Coinbase or Optimism Foundation will prioritize their liquidation before others, hoping to win the profit for the liquidation. This activity results in very high priority fees paid to the sequencer for large liquidations.

“MEV Tax” Research

Dan Robinson and Dave White at Paradigm recently released an impressive research paper titled Priority Is All You Need, which made us think deeply about how we might enable OEV on the Base and Optimism networks in a way that was superior to Ethereum mainnet. With this groundbreaking new concept of a “MEV Tax” we realized that we could create a simple, yet profound new smart contract system that captured MEV tax at the Moonwell protocol level as revenue, rather than letting an off-chain auction or MEV relay capture most of the value from liquidators. The simple idea is to have the Moonwell protocol charge liquidators a MEV tax which is $99 for every $1 of priority fee paid for the right to update the price 30 seconds early. Because this new smart contract system can read the priority fee from the transaction it is called by, it knows exactly how much tax to charge and will only successfully charge the tax for the highest priced transaction, which will also be bundled with the liquidation itself. If a liquidator wasn’t the highest “bidder” in the priority fee auction, their liquidation will simply revert, and the tax won’t be paid.

We realized that with this powerful, yet simple contract system, we could now perform priority fee auctions completely onchain, with no dependencies on offchain systems like expensive and costly MEV relays that might have downtime, and are ultimately private centralized systems antithetical to the ethos of decentralization and permissionless networks espoused by Ethereum. This is only possible on Layer 2 networks like Base and Optimism (and other Superchain-aligned networks such as Unichain, Worldchain, Zora, and Mode) where there is a trusted sequencer that follows fair competitive priority ordering. Enforcing these rules in a trustless network like Ethereum mainnet remains an unsolved problem.

Ensuring Safety and Security

Security is the highest priority in the Moonwell community, and liquidations play a vital role in ensuring that underwater loans are liquidated quickly. In order to maintain the safety and security of liquidations, even in the event there are no bidders in the auction, we designed this new system in such a way that liquidations can still happen after 30 seconds, as the price will be automatically updated and liquidations can happen in the same way they happen today, without any liquidator paying a priority fee. This new contract system also “wraps” the Chainlink price feeds that are currently used by Moonwell so there is no risk of taking on a new and less trusted oracle provider. Chainlink has proven to be very safe and secure through over half a decade of operation, so it was important to us that we keep that same level of safety and economic security that Chainlink currently provides. The contracts are also extremely lightweight and are undergoing a comprehensive audit by Halborn Security prior to an onchain proposal to upgrade to the new system.

Phased Rollout Plan

To thoroughly evaluate the new OEV system, we propose a phased rollout, starting with a test on the Ethereum market on Optimism.There is enough liquidation activity in this market to measure performance of the system over time. If that proves successful, we can further expand to the other markets on Optimism and Base over time. This will allow us to measure the performance and ensure that liquidators are adequately informed about the benefits of using this new onchain auction.

Next Steps

We’d love to hear feedback from the rest of the community, especially anyone running liquidation infrastructure, about this proposed upgrade. What do you like or dislike about it? You can read a formal specification in the Moonwell Github repository here, as well as take a look at our pull request with the contract source code that is currently undergoing audit by Halborn Security.

Once we’ve heard your feedback, we’ll proceed with a temperature check vote, then an onchain vote to upgrade the Ethereum market on Optimism if the temperature check vote is successful.

Frequently Asked Questions

Why capture OEV at the Moonwell protocol level?

There are now two competing proposals from Redstone and API3 to provide offchain auctions using private venues (Fastlane for Redstone and OEV Network for API3) that would capture OEV and share the revenue with the Moonwell protocol. While these proposals are welcome, they split the revenue OEV with 3rd parties (Redstone and API3), and are more centralized and brittle due to their offchain nature. Additionally, these systems introduce extra trust assumptions. This proposed system would capture 100% of OEV at the Moonwell protocol level and does not rely on any additional offchain infrastructure. It will be just as reliable as Chainlink is today, and won’t have downtime unless the L2 sequencer has downtime.

What happens if there are no bids in the OEV auction?

If there are no bidders, the liquidation can be performed by any liquidator permissionlessly after 30 seconds on the Base or Optimism network, in the same way that liquidations happen today.

What are the benefits to the Moonwell protocol for this proposed upgrade?

The Moonwell protocol can generate more revenue than its peer lending protocols on the Base network, which can be used to fund future upgrades and improvements to Moonwell. Moonwell can continue to be the category leader in fee and revenue generation by becoming more capital efficient and generating more revenue with the same TVL.

What are the potential downsides to this proposed upgrade?

In the event that there are no bidders, liquidations would be delayed by 30 seconds. Currently Chainlink’s minimum update frequencies are 0.15% deviation and 1200 seconds.

Who is making this proposal?

We are Moonwell contributors from Solidity Labs, the leading boutique smart contract development firm. We have been contributors to the Moonwell protocol for over 18 months, and have contributed key systems, such as the Moonwell v2 smart contract upgrades that enabled the Moonwell launch on Base and Optimism, Temporal Governance that enabled multichain governance, The multichain upgrade to the WELL token, and the multichain governance system that makes Moonwell the most advanced multichain protocol to have complete feature parity on all the networks it is deployed on.

9 Likes

According to Risk Labs (core team behind UMA), if Aave had implemented OEV capture mechanisms, it would have seen a major increase in its revenue. On DeFilama today, if you check the revenue for Aave (their revenue numbers may not be completely accurate) they have accrued $160M in revenue to date. Risk Labs’ dashboard claims that if Aave had implemented OEV capture mechanisms across all of its platforms, it would have made an extra $90M in revenue, and this would be a 56% increase.

Personally, I think this is a no brainer for Moonwell to pursue. Moonwell had two large liquidation events this past year, on August 5th, and July 5th. On August 5th, over $3.5M in liquidations occurred, and on July 5th, $2.7M worth of liquidations occurred. If we apply OEV capture to past liquidation events, Moonwell very possibly could have had a substantial increase to its current revenue.

I’m curious to know how this could possibly effect the decentralization of Moonwell (though this does not effect my current sentiment about this proposal). Perhaps I’m mistaken, but Chainlink has come out publicly against protocols like UMA, API3, or Redstone, not working with third-parties for OEV solutions, because their existing solutions provide “some centralization” as the solution.

4 Likes

Hey all Jacob from Fastlane here,

Moonwell adopting MEV taxes would prioritize value capture over protocol safety, user experience, and Base L2 scalability.

Increased Risk of Bad Debt:
Delaying data feeds by 30 seconds raises the likelihood of a bad-debt attack—similar to Compound’s February 2024 incident—by ~15x (a 30-second lag vs. Base’s 2-second block time). This added risk compromises Moonwell’s ability to protect lenders, list new assets, and offer higher LTVs, opening the door for competitors who can set risk parameters without accounting for delays.

Negative Impact on Base Scalability
The trend for chains with high demand is to adopt off chain auctions to mitigate MEV spam: Ethereum (PBS), Solana (Jito), Arbitrum (Timeboost), Unichain (Flashblocks). Base congestion (mostly due to MEV) is raising gas fees for regular users and impacting UX, resulting in the Base team actively asking apps to gas optimize. Moonwell implementing MEV taxes would negatively scale Base by forcing all auction bids to continue landing on-chain, contributing to increased gas fees for all Base users.

Delays to Liquidations During Volatility
Implementing MEV-taxes trades off liquidation speed for value capture. When blocks are full—usually precisely when liquidations are most critical—MEV taxes delay liquidations, heightening bad-debt risks. Governance cannot dynamically tune the MEV tax to optimize this tradeoff, and a beta phase likely won’t reveal the full scope of risks, making MEV tax parametrization very difficult for the DAO to reason about.

Not Future-Proof
MEV taxes are not necessarily future proof when Optimism and/or Base adopt off-chain auctions and/or decentralize the sequencer.

With regards to Redstone OEV:
Integrating Redstone OEV would enhance protocol safety for Moonwell without introducing risks of delays or bad debt. It also positively contributes to Base L2 scalability by reducing MEV spam, addressing a critical challenge as the network grows.

The proposal’s claim that Redstone OEV is “centralized and brittle due to its off-chain nature, introducing extra trust assumptions” is inaccurate. Redstone OEV does not add trust assumptions or compromise security. The existing Redstone oracle infrastructure is in control of propagating OEV transactions, ensuring no external interference or delays in data feed updates. The auction process, which takes ~300ms, seamlessly falls back to regular updates if needed, maintaining liquidations via current methods. Furthermore, Redstone reduces data feed latency by enabling updates between deviation thresholds, enhancing Moonwell’s resilience.

Off-chain auctions, like PBS, Jito, Timeboost, and Flashbots, have proven extremely beneficial to network scalability. Similarly, Redstone OEV would provide a significant advantage to the Base ecosystem, helping mitigate MEV spam while supporting Moonwell’s growth and the broader scalability of Base L2.

Here is an example of how MEV taxes can cause delayed liquidations even in the presence of many bidders. This example illustrates that the MEV tax mechanism introduces delays that are directly correlated to market volatility, in other words the mechanism breaks when you need it most:

Assume blocks are full and to be included in a block you must pay a priority fee of .01 ETH, and the MEV tax default set by the proposal is 99. If the liquidation bonus of a given liquidation is below 1 ETH, it will be impossible for a liquidator to profitably be included in the block by setting a priority fee of .01 ETH, because that priority fee forces them to pay .99 ETH in the MEV tax auction. Liquidators would have to wait for either priority fees to decrease, or for the 30 second window to expire to perform the liquidation on Moonwell. If there are 10 liquidations all paying 1 ETH to liquidators, then all 10 liquidations would be unprofitable to execute based on a priority fee of .01 ETH, so the issue can get cascadingly worse. As long as blocks remain full, this issue will continue to repeat itself and potentially cause more and more bad debt every 30 seconds.