Maple Finance contest - cmichel's results

Maple Finance delivers capital-efficient borrowing for top tier institutions

General Information

Platform: Code4rena

Start Date: 08/04/2021

Pot Size: $100,000 USDC

Total HM: 3

Participants: 10

Period: 14 days

Judge: Nick Johnson

Total Solo HM: 3

Id: 4

League: ETH

Maple Finance

Findings Distribution

Researcher Performance

Rank: 1/10

Findings: 2

Award: $33,406.11

🌟 Selected for report: 7

🚀 Solo Findings: 1

Findings Information

🌟 Selected for report: cmichel

Labels

bug
2 (Med Risk)
sponsor acknowledged

Awards

11135.3712 USDC - $11,135.37

External Links

Handle

@cmichelio

Vulnerability details

Vulnerability Details

When the protocol suffers a default, the BPT stakers are the first line of defence 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.

Impact

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.

#0 - lucas-manuel

2021-04-23T19:53:54Z

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.

#1 - Arachnid

2021-04-27T02:08:35Z

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.

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter