Any user who deposits and withdraws within the same price window will lose funds due to this price mismatch between deposit and withdrawal calculations. #107
Labels
invalid
This doesn't seem right
Github username: @0xbrett8571
Twitter username: 0xbrett8571
Submission hash (on-chain): 0xc901f42bbdef87cd0f58618bc21c318da98a5d18c3424b70e5096c24e0bc2c87
Severity: high
Description:
Description
The protocol's use of different price bases (
currentPrice
vspreviousPrice
) for deposit and withdraw operations creates an arbitrage opportunity. This allows users to profit from rapid deposit/withdraw cycles when price differentials exist.The vulnerability lies in the interaction between
InvestToken.sol
andYieldOracle.sol
. The price conversion between assets (USDE) and shares (EUI) uses two different prices for deposit and withdraw.YieldOracle
YieldOracle
InvestToken.sol#L243-L246, InvestToken.sol#L315-L319
YieldOracle.sol#L174-L185
The protocol uses inconsistent pricing between deposit and withdraw operations. This creates an arbitrage opportunity where users can profit from the price differential between
currentPrice
andpreviousPrice
in theYieldOracle
.Impact Details:
This vulnerability allows direct profit extraction through price manipulation, threatening the protocol's economic stability and sustainability.
Attack Scenario
Attachments
Here's a test case demonstrating the price arbitrage mechanism
The logs show:
Looking at the test results, we can see that when a user deposits 1000 USDE and immediately withdraws, they receive back only 826.45 USDE - representing a significant loss of ~17.4% of their funds.
This happens because:
This price difference creates an arbitrage opportunity for the protocol at the expense of users. Any user who deposits and withdraws within the same price window will lose funds due to this price mismatch between deposit and withdrawal calculations.
This is a serious design flaw that could be exploited by the protocol or privileged actors who know when price updates will occur.
The text was updated successfully, but these errors were encountered: