Upgrade Moonwell’s Liquidation Incentive Recapture on Optimism’s ETH/USD Market by Switching to Api3

Proposal: Upgrade Moonwell’s Liquidation Incentive Recapture on Optimism’s ETH/USD Market

Replace Solidity Labs’ Flat-Fee Wrapper with Api3’s Auction-Based OEV Network


Author: Dave Connor, API3

Related Discussions: Switching Moonwell's GLMR Market to using API3's OEV Enabled Data Feed for GLMR

Moonwell Governance Call: December 2024

Submission Date: 16/07/2025

Summary

Moonwell currently operates two distinct Oracle Extractable Value (OEV) recapture systems. On Moonbeam, Api3’s auction-based OEV Network is live and consistently returns significant revenue to the protocol. On Base and Optimism, Moonwell relies on a Solidity Labs-designed wrapper that charges a fixed, gas-derived tax to unlock oracle updates early.

After running both systems in parallel for several months, Api3 has significantly outperformed the Solidity Labs feed wrapper, both in terms of protocol revenue and systemic design. The flat-fee wrapper has recaptured surprisingly little value, while Api3 has returned over 70% of liquidation MEV from a single low-TVL, low-liquidity market.

This proposal recommends migrating the ETH/USD price feed on Optimism to Api3, to act as a proof of concept for Api3’s OEV solution in a larger TVL Moonwell market, and allow for a comparison to the current implementation of the Solidity Labs wrapper and any upcoming changes suggested (i.e. to fix the current underperformance).


Background: Two Systems in Parallel

In February 2025, Moonwell integrated Solidity Labs’ OEV wrapper on Base and Optimism. This system delays oracle updates for a configured period, currently 10 seconds, unless a liquidator pays to “unlock” the price early. The fee required is calculated as (tx.gasprice - block.basefee) * feeMultiplier, meaning it is tied entirely to gas volatility, not liquidation value.

In April 2025, Moonwell adopted Api3’s auction-based OEV Network on Moonbeam. Api3’s design enables searchers to bid competitively for the right to trigger a fresh price update and execute a liquidation with real-time data. Api3 then returns 80% of the bid revenue back to the protocol.

A more detailed description of how API3’s OEV solution works can be found in the previous proposal, and in Api3’s docs. There is also a video which looks into the differing approaches to OEV design between Solidity Labs and API3 in more detail.


Issues with the Flat Fee Model for Onchain OEV

  1. Raising the unlock fee doesn’t solve the problem

Moonwell could try to improve value recapture by simply raising the unlock fee. But this overlooks the core flaw: the fee is calculated based on gas volatility, not the economic value of the liquidation it enables.

This disconnect could lead to unintended outcomes when the fee is simply raised, for example, requiring a $1,000 payment to unlock a price that only allows for a $500 incentive. In these situations, no rational liquidator engages, and the protocol gains nothing. The liquidation still happens, just after a delay, and with no value returned to Moonwell.

The problem isn’t that the fee is too low, it’s that the pricing logic is fundamentally misaligned with the opportunity it’s meant to capture. No adjustment to the fee multiplier can fix a mechanism that’s priced on the wrong variable.

2. Pegging fees to opportunity value doesn’t reliably work either

You might wonder: why not solve the problem by simply tying the flat fee to the value of the liquidation? For example, the protocol could charge a fixed percentage of the incentive (e.g. 99%) and retain nearly all of the upside.

But this approach breaks down under real-world execution.

Imagine a liquidation that, on paper, yields a $1,000 reward. A 99% fee would leave the liquidator with $10. In theory, that’s still profitable.

But in practice, performing the liquidation means the liquidator must swap the seized collateral, which can incur slippage. If that slippage is large enough the $1,000 opportunity might actually only be worth $900. That means the liquidator is paying $990 to earn $900, which is a guaranteed loss. As a result, the liquidation won’t happen through early access; it will simply occur later, after the delay period and with no value returned to the protocol.

The root issue is that the wrapper has no awareness of what actually happens onchain. It can’t account for execution costs like slippage, so it misprices the opportunity. The fee ends up being disconnected from the value it’s trying to capture.

This disconnect becomes more pronounced with larger liquidations, where execution costs scale with position size. Even setting the fee to something more conservative (like 50% of the estimated incentive) might ensure the liquidation is profitable, but would still leave significant value on the table.

By contrast, Api3’s system lets liquidators bid based on what they expect to realize after costs. This ensures the protocol captures value that actually exists and isn’t just theoretical upside, thus avoiding pricing itself out of its own opportunities.

3. Auctions are the prevailing design

Across the MEV ecosystem, there is a clear trend toward auction-based mechanisms as the preferred way to allocate value and prioritize transactions. Different systems apply this principle in different ways:

  • Flashbots uses auctions to bundle and prioritize transactions during block building

  • Arbitrum uses Timeboost, an auction-based ordering mechanism

  • Api3’s OEV Network uses auctions to determine who can trigger a prioritized oracle update

While the implementations vary, the underlying principle is consistent: letting participants compete based on what they can actually realize leads to better outcomes, for protocols, searchers, and end users alike.


Comparative Performance: Solidity Labs vs Api3

Solidity Labs (Feb 25 – Jul 7, 2025)

Base - Base Dune dashboard:bar_chart:

  • Total MEV: $537,634.77

  • Protocol revenue: $7.00

  • Capture rate: 0.0013%

  • Total liquidations: 7,515

  • OEV-enabled (early unlocks): 223

  • Over 97% of liquidations were executed with a delay (not using OEV)

Optimism - Optimism Dune dashboard:bar_chart:

  • Total MEV: $97,121.80

  • Protocol revenue: $0.55

  • Capture rate: 0.0005%

  • Total liquidations: 448

  • OEV-enabled: 75

  • ~83% of liquidations were executed with a delay (not using OEV)

Api3 (Apr 18 – Jul 7, 2025, GLMR/USD only on Moonbeam) - OEV dashboard for Moonbeam GLMR/USD market :bar_chart:

  • Total MEV: $4,829.57

  • Processed via OEV auctions: $3,568.42

  • Protocol revenue: $2,556.16

  • Capture rate: ~70%

Value returned per $ TVL secured
Solidity Labs: $0.000000025
Api3: $0.005

Despite operating on a single feed with significantly lower TVL, in a liquidity-constrained environment, Api3 returned thousands of times more value than the Solidity Labs system.


What the Protocol Missed

The cost of continuing with the current system is not abstract, it’s measurable. If Api3’s auction-based OEV Network had been live on Base and Optimism during the same time period, Moonwell could have recaptured an estimated $400,000 in additional protocol revenue. That revenue wouldn’t just have gone unclaimed, it would have translated directly into stronger protocol economics.

Based on historical token pricing and acquisition patterns, this additional value could have enabled Moonwell to acquire approximately 13 million more WELL tokens through reverse auctions. During the same period, 31 million WELL was acquired under the existing setup. With Api3’s system in place, that number could have risen to 44 million WELL, representing a 42% increase.

This isn’t a hypothetical improvement. It reflects a tangible, quantifiable opportunity lost due to the limitations of the current fee model. Limiting the initial switch to Optimism, and to a single market is designed to allow continued comparisons to be made with the Solidity Labs designed OEV solution in production, and prove to the Moonwell community the benefits of switching more feeds in future.


Why Api3?

Api3’s OEV Network has been live with Moonwell on Moonbeam since April, where it has consistently delivered strong value recapture, despite initially operating on a single feed in an environment with thin liquidity, high slippage, and poor routing. These conditions are suboptimal for MEV searchers, yet the system has still performed well. An integration on a single feed on Optimism would provide a risk-minimized approach to demonstrating the potential returns that swapping more feeds to Api3 would bring.

Api3 has already distributed nearly $300,000 in OEV revenue to integrated protocols, including Yei Finance, a lending market with over $400M in TVL on the Sei Network, and Compound Finance on Mantle.

Api3 supports hybrid feeds (like wstETH/USD) that are currently unsupported by the Solidity Labs wrapper. It also operates across more than 40 EVM chains, giving Moonwell flexibility to expand its markets without needing new infrastructure.

The system has already proven that it works under pressure. On chains like Base and Optimism, where liquidity is deeper, routing is better, and searcher activity is higher, the system is expected to perform more successfully.


Implementation Plan

  1. Replace current ETH price feed on Optimism with Api3’s price feed

  2. Api3 will manage feed deployments and updates

  3. Monthly OEV revenue (80%) is returned to Moonwell (e.g., via addReserves)

  4. A monthly report will be published and shared on the forum with complete liquidation and revenue data

  5. A public dashboard for Api3’s performance on Optimism will go live shortly after proposal execution, and will be shared on the forum (a similar dashboard for Moonwell on Moonbeam is here OEV Dashboard)

This upgrade requires no changes to the core protocol and can be executed with minimal coordination.


Conclusion

The Solidity Labs wrapper was an interesting attempt to build an onchain-only OEV solution, but the data and logic show it has not performed as intended:

  • It fails to price liquidations accurately

  • It leaves most value on the table

  • It does not support hybrid feeds

By contrast, Api3’s auction-based system has already outperformed in difficult environments, including the extreme volatility seen during February 2025, not only operating flawlessly but successfully returning value to users.

Api3 has already been shown to work without issues and return value to Moonwell through the Moonbeam deployment. Switching the ETH/USD feed on Optimism to Api3 will allow for more direct comparisons to be made between the Solidity Labs solution and Api3, and show the Moonwell community the benefits of a wider switch to Api3.

Improving protocol revenue will further help increase security by improving yield paid to safety module stakers, encouraging more WELL to be staked. Using Api3 also gives Moonwell the ability to scale cross chain easily to any Api3 supported chain, regardless of MEV presence, and without having to wait for any additional infrastructure to be deployed.


Vote Options

  • Yay – Replace the Solidity Labs wrapper with Api3’s data feed address for the ETH/USD feed on Optimism, enabling Api3 to recapture OEV

  • Nay – Retain the current system and continue with negligible OEV recapture

  • Abstain – No opinion

1 Like

We’ve put the Snapshot vote live for this here https://snapshot.moonwell.fi/#/proposal/0x61a0278313f4637a45f1018e6ca37d05ac3c2f2ac4715d6b1b94bd6fbe25e92c. I think it’s important for the Moonwell community to be able to compare different OEV solutions directly, especially as Moonwell has a great narrative as a revenue generating protocol already.

Api3 already secures lending protocols with a larger TVL than Moonwell, has never had a misreport, and has proven success recapturing OEV on Moonbeam. For anyone wanting a deep dive how Api3’s feeds work, how secure they are and how OEV works, as well as the previous links we prepared a document for Compound’s oracle provider proposals. As Moonwell is a Compound fork I’ll link it here - https://www.dropbox.com/scl/fi/papr8bdy4y0q0wlxuz15t/Api3-Beyond-Data-Feeds.pdf?rlkey=kkv8b980bbz1c5izu60q8ritf&e=1&dl=0. Happy to answer questions about everything below

Let me try to put this in clear language and tell everyone what happened. The API3 team approached me last week on Telegram while a lot of Moonwell contributors were having our annual onsite meetings and many of us had flown to California to meet in person for the first time this year.

They presented me with a Dune dashboard that shows lost liquidation opportunities on Base, which totaled around $640K, and evidence that the current OEV solution from Solidity Labs only captured ~$10. They also presented me with data showing the logic issue is that the OEV wrapper contract only captures a 99% tax on the gas fee and not the liquidation value. I thank them for presenting this data to us and ask if they can please give us a few weeks to remediate the logic issue.

The next day I spoke with the lead Solidity engineer who used to work for Solidity Labs earlier this year, but is now a fulltime contractor on Moonwell. They indicated this issue can easily be remediated and the OEV solution can be re-audited, however after the onsite meetings last week they had planned a short 2 week vacation months in advance and won’t return until August 4th.

I mentioned this to the API3 team, and expressed that Chainlink price feeds are the only feeds that are secure enough to protect the $40-50M TVL on OP mainnet and the 9 figures of TVL on Base. It’s not that API3 is insecure, they just don’t have as many data sources and don’t have a fully decentralized node operator network for each L2/L1 like Chainlink does.

I expressed my desire that they hold off on moving forward until after August 4th when our lead solidity engineer gets back from a well deserved, planned months in advance vacation, and remediates the issue and it gets audited, at which point the protocol can begin earning the revenue it will when the OEV solution is complete.

API3 ignored my requests and put this snapshot proposal up yesterday, while this engineer is attempting to enjoy time off for the first time this year. We have been working extremely hard on the Mamo agent and Moonwell improvements and every contributor has been ruthlessly focused on this.

Now I need to alert the community of things because API3 is not as secure as Chainlink, and it isn’t appropriate to replace Chainlink with API3 just because there is a logic issue that is resulting in less efficient OEV capture than might have been.

Here are the facts:

  • Funds in the protocol on Base and OP mainnet are safe and still using Chainlink through an OEV wrapper. No funds are at risk. The only thing we are discussing here is how much extra value is captured from liquidations.
  • Moonwell is the only protocol that has an OEV solution that uses an onchain auction where all OEV flows to the protocol and isn’t shared with any 3rd party on Base and OP mainnet.
  • This solution allows Moonwell to continue using Chainlink price feeds, which have kept the protocol safe for 3.5 years from stale prices and have never had any downtime or data availability issues.
  • This solution is only possible on fair ordering L2s built on OP stack
  • Because this solution is not viable on Moonbeam, API3 bid for and won that opportunity
  • Their solution requires a private auction and they keep half the profit, so they have a significant profit motive to implement that solution on OP mainnet and Base
  • The logic issue in the current OEV solution created by Solidity Labs for Base and OP mainnet only captures a 99x MEV tax on the gas fee, not the liquidation value
  • This can be easily remediated so that the 99x MEV tax will apply to the liquidation value, allowing it to scale appropriately and perform a complete onchain auction. For example if a liquidation value was $1,000, the liquidator might add $9 priority fee, which would result in a $899 cost=(9 + (99*9)) which means the liquidator still earns almost $100 but the protocol earns the rest, and doesn’t have to give 50% to API3
  • This is also completely visible onchain, doesn’t require any infrastructure to be running except the Base sequencer itself, and lets Moonwell continue to use Chainlink price feeds, the industry standard for safety and security

I would recommend that people vote accordingly. On the one hand, Chainlink is safe, battle-tested, has operated for over 5 years, and is the gold standard used exclusively by the largest protocols in the space such as Aave and Morpho, on the other hand, API3, while innovative, has not yet proven it has the level of safety required to secure tens of millions of $ on OP mainnet or hundreds of millions of $ on Base.

When the lead Solidity engineer returns to the office on August 4th, I’ll ask if they can remediate the logic issue, the remediated OEV wrapper will get audited, and we can work as a DAO to upgrade the markets that use the current solution.

Thanks for considering my message when voting.

3 Likes

[deleted, more comprehensive answer being written]

1 Like

Hi everyone. Posting this on behalf of another long time Api3 contributor - @foreverlaura (on this forum) / @u61u61u (on Twitter), as his account was new and the post was flagged.

I’m writing this as a contributor at Api3 and, until recently, a significant WELL holder. I had hoped for a productive engagement between Api3 and Moonwell, grounded in shared values of transparency, innovation, and protocol profitability. Unfortunately, recent developments, both in public messaging and in governance processes, have compelled me to speak up and set the record straight.

Clarifying the OEV Implementation on Base and Optimism

Let’s begin with a core factual error that has circulated:

  • Moonwell is the only protocol that has an OEV solution that uses an onchain auction where all OEV flows to the protocol and isn’t shared with any 3rd party on Base and OP mainnet.

This is incorrect.

The current system is not an onchain auction. It is a flat tax on gas fees that grants early access to price data. Here’s why that matters:

  • It is not based on liquidation value, so high-value liquidations are treated the same as low-value ones.

  • It involves no bidding or competitive discovery, so calling it an “auction” is misleading.

  • It has recaptured less than $10 in MEV across Base and OP, despite over $600K in liquidation opportunities.

This design fundamentally misses the point of Oracle Extractable Value (OEV): to allow protocols to reclaim some of the value that is otherwise arbitraged away by liquidators.

Governance and Performance: A Disconnect

They presented me with a Dune dashboard that shows lost liquidation opportunities on Base, which totaled around $640K, and evidence that the current OEV solution from Solidity Labs only captured ~$10. They also presented me with data showing the logic issue is that the OEV wrapper contract only captures a 99% tax on the gas fee and not the liquidation value. I thank them for presenting this data to us and ask if they can please give us a few weeks to remediate the logic issue.

I think it is important to also highlight to the community that the Solidity Labs solution was firstly introduced with MIP-O12 in January, and then later on adopted on all Base and Optimism markets because “initial results are very promising” (quote) with MIP-X14 in February.

We fail to see how the proposal for expanded rollout could have passed because a simple look into the performance of MIP-O12, would have revealed that that the solution is heavily underperforming. This underperformance later also translated into the underperformance on all other Moonwell markets.

Chainlink Isn’t Immune to Failures

  • This solution allows Moonwell to continue using Chainlink price feeds, which have kept the protocol safe for 3.5 years from stale prices and have never had any downtime or data availability issues.

Chainlink misreports the price of wstETH/ETH on Arbitrum, causing over 2 Million in false liquidations on Silo Finance.

500K lost on an Euler market because of a spike.

There are occasions like this happening frequently and Chainlink refusal to publicly acknowledge them or make statements around these doesn’t make them non-existent.

We can proudly say that to this date, there hasn’t been a single incident of misreporting caused by our oracles that have led to bad debt or anything of the sort.

If the relationship with Chainlink and the trust was so valued, we also fail to see why the responsibility of Moonbeam was shifted to Api3.

We’d also request that the responsibility of securing those markets is shifted back to the party that is being trusted more, as our intentions are apparently being interpreted as malicious.

Addressing Mischaracterizations of Api3’s OEV Network

  • Their solution requires a private auction and they keep half the profit, so they have a significant profit motive to implement that solution on OP mainnet and Base

Several deeply inaccurate claims have been made about our architecture and intentions. To clarify:

:cross_mark: Myth: “Api3 runs a private auction and keeps 50% of profits.”

  • :white_check_mark: All auctions are public and onchain, verifiable on our dedicated L2 (OEV Network).

  • :white_check_mark: Api3’s protocol fee is 20%, not 50%. This rate is applied uniformly across all partner dApps.

  • :white_check_mark: This fee structure was disclosed transparently in every Moonwell governance proposal.

We’re specifically outraged by these statements as they depict our solution as well as our intentions as something they are simply not.

Why “Fixing” the Wrapper Still Doesn’t Work

A recurring claim is that the current Solidity Labs implementation can be easily “fixed”:

  • The logic issue in the current OEV solution created by Solidity Labs for Base and OP mainnet only captures a 99x MEV tax on the gas fee, not the liquidation value.

This can be easily remediated so that the 99x MEV tax will apply to the liquidation value, allowing it to scale appropriately and perform a complete onchain auction. For example if a liquidation value was $1,000, the liquidator might add $9 priority fee, which would result in a $899 cost=(9 + (99*9)) which means the liquidator still earns almost $100 but the protocol earns the rest, and doesn’t have to give 50% to API3

At first glance, this may sound reasonable. But in practice, this “fix” completely ignores how onchain liquidations actually work.

Let’s break it down with a real example:

In this transaction a user had a USDC debt of approx. $62.7K that was backed by $70.5K worth of AERO at the time of liquidation. The available liquidation incentive for this liquidation was ~$7.8K.

So, how do liquidations actually work?

The liquidator repays the debt of the underwater position and gets the collateral at a discount, which is then typically sold to realize the profit.

Theoretically that “profit” is ~$7.8K in this example.

The proposed fix to the current OEV wrapper is to slap a 99% fee onto those $7.8K, meaning forcing the liquidator to pay Moonwell a $7.7K fee leaving $100 in “profit”.

All good in theory, right? Profit is profit.

One problem though. Slippage.

The liquidator needs to swap the collateral, incurring costs.

How large are the costs?

For a swap of ~70.5K worth of AERO, the liquidator loses approx $160 to slippage.

Because onchain realities are being ignored (i.e. expecting the theoretical incentive is fully realizable without cost), it creates a system that expects liquidators to perform liquidations at a guaranteed loss (-$60). The reality of things is that they simply won’t pay and perform liquidations after the delay period, which is exactly what is also happening currently.

You might respond, “Then just charge 80% instead of 99%.”

But that entirely misses the point.

Slippage isn’t a constant . It spikes during volatile market conditions, which is when most OEV arises. A 1% slippage today might become 3% or 5% tomorrow. Trying to pre-price that risk through a static multiplier is futile.

You’re trying to put a static price on a dynamic market.

Only an open, competitive auction can adapt in real-time to market conditions. That’s exactly what Api3’s OEV Network does — and it’s why it will always outperform static wrappers, no matter how many times they’re “fixed.”

And just to correct the record one more time:

API3 DOES NOT CHARGE 50%.

Our fee is 20%, and it’s clearly documented in every proposal passed.


A Final Word on Integrity and Recent Events

Throughout this entire process, we’ve acted in good faith.

We engaged with Moonwell transparently, contributed data and technical insight, acquired WELL, and participated in governance. All with the goal of helping the protocol reclaim meaningful OEV revenue.

Had the outcome been a community-driven decision to not expand Api3’s solution beyond Moonbeam we would have respected that.

But what we didn’t expect was:

  1. The project’s founder publicly describing our system as off-chain and unverifiable despite the opposite being true and fully auditable.

  2. Repeated false claims that we “take 50%”, despite our fee split being 20%, consistently and publicly disclosed.

  3. Dismissive comments suggesting we were wasting time, being “less secure” than Chainlink, and not worth serious consideration.

After reflecting on the tone and content of the most recent forum post and the broader handling of this discussion I made the decision to divest my WELL holdings.

In total, I sold ~50 million WELL in the last 24 hours, as a direct response to how this matter was handled publicly.

From Governance Debate to Conspiracy Theory

As many of you know, Aave recently launched a liquidity mining campaign targeting Base, offering incentives to users who migrate from competitors like Morpho and Moonwell. Separately, someone in the Moonwell community noticed my WELL sale and, after seeing that my wallet also holds AAVE, began speculating that the sale was part of a coordinated “attack” tied to Aave’s campaign.

At first, I didn’t take it seriously until I saw Luke actively amplifying the narrative.

There’s just one problem:

The Moonwell team knows exactly whose wallet this is.

They know it’s mine. They know I’m not affiliated with Aave in any way. They know this was a personal decision made in response to how we were treated and yet, the rumor was allowed to spread and supported.

https://x.com/u61u61u/status/1948310973409870068

Closing Thoughts

DAO governance is messy. I’ve seen enough for this cycle.

I wanted to share all of this publicly, not to reopen wounds, but because I believe transparency matters especially when misinformation is used to paint honest actors as adversaries.

To those continuing to build: I sincerely wish you the best.

To those still navigating this conversation: let the data speak louder than the drama. We would still suggest it’s in the Moonwell community’s best interest to test our solution side-by-side with any proposed fixes to the Solidity Labs onchain solution. Comparing performance transparently with the only proven OEV solution, and letting the results speak for themselves, should be how to demonstrate one approach is superior. You know where to find us.

cheers.

2 Likes

Childish reaction… but good luck to you.

1 Like

Hi everyone, wanted to share an update to demonstrate the ongoing underperformance of Moonwell’s current OEV solution (Solidity Labs) on Optimism and Base. The above dashboard is for the Base markets, where since the API3 proposal was voted against, Moonwell recaptured only $43.24 out of almost $2M potential OEV.

API3’s solution is still working flawlessly, and still available for Moonwell to use should the community wish to dramatically improve the funds available for $WELL buybacks, without compromising security. Thank you for your attention to this matter.

I am firmly against using API3 for any new services due to the past history of dumping $well tokens. I agree that the liquidation recapture on OP needs to be addressed.