Skip to content
Business logic Audit finding Intermediate

Potential huge arbitrage opportunities / MPL price decrease

When a borrower defaults, the protocol sells a large amount of pool tokens for a single asset at once, which can push the MPT token price down. This creates an arbitrage opportunity that a borrower could exploit by not repaying the loan.

Maple Finance contest

Originally disclosed on Code4rena

When the protocol suffers a default, the BPT stakers are the first line of defense and the protocol trades the BPT pool tokens for the single-sided liquidity asset of the Balancer LIQUIDITY <> MPT pool. (PoolLib.handleDefault)

Note that a pool token to single-asset trade is the same as burning the LP tokens to receive an equal amount of all underlying tokens, and then trading all other tokens received for the single asset.

It’s the reverse of this:

“Depositing a single asset A to a shared pool is equivalent to depositing all pool assets proportionally and then selling more of asset A to get back all the other tokens deposited.” (Balancer)

This means on each default MPT tokens are sold for the liquidity asset. As the default is potentially a huge amount that happens at once, this creates a huge arbitrage opportunity.

As the default suffered can be a huge amount and the “repayment” happens at once, this creates a huge arbitrage opportunity: The MPT token price goes down. The borrow could also be incentivised to not repay the loan and take advantage of the arbitrage opportunity, either competing themselves on-chain or through shorts/bets on the MPT price.

Hard to completely mitigate. Pool delegates should be especially careful when giving out high-value loans and demand high collateral lockup.

lucas-manuel (Maple) confirmed:

This is a valid concern, but not something that we are going to mitigate before launch. We are going to plan for PDs to atomically liquidate and burn.

Nick Johnson (Judge):

I think this a valid finding; whether or not it’s intended to be mitigated pre-launch, the Sponsor acknowledges it’s a valid concern, and not something that’s declared as part of the protocol’s intrinsic assumptions. These sort of findings are exactly what audits are intended to uncover and bring to the attention of users as caveats when using the system. I concur with the Warden’s assessment of Medium.

The original report as published on Code4rena. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the protocol performs a large single-asset trade of pool tokens in one transaction upon default, which can significantly move the market price.

Impact

A borrower could profit by defaulting and then buying the depressed MPT tokens, potentially undermining the protocol's first line of defence; the sponsor acknowledged the concern but did not mitigate it before launch.

What the attacker needed

A borrower with a loan; a default event; large loan relative to pool liquidity

The fix

The sponsor planned for pool delegates to atomically liquidate and burn, and to be careful with high-value loans and high collateral lockup, but no fix was implemented before launch.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

In this lending protocol, if a borrower fails to repay, the system automatically sells the borrower's pool tokens to recover funds. Because it sells a very large amount all at once, the price of those tokens can drop sharply. Someone who knows this could deliberately default and then buy the tokens back cheaply, making a profit at the protocol's expense.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

More from Maple Finance contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.