The UpliftOnlyExample contract has a critical issue in its fee calculation logic where the lack of a scaling factor causes severe truncation of fees, resulting in significantly reduced or zero fees being charged even when profits are made. This impacts all fee recipients and the protocol's revenue model.
In the UpliftOnlyExample contract, when calculating fees based on profit, the code performs a division operation on the profit value. In any case where the profit is less then 100% the result will be 0. and in every case where it is above 100% the fee will be significantly less then the intended amount.
The issue arises because:
The calculation subtracts the initial deposit value from the current value
The result is used directly in division of the initial deposit value
For example:
When this happens the fee rate will be as if there was no profit which is significantly less then the intended fee rate.
The entire purpose of the uplift fee is to charge fees based on the profit of the LP position. This is undermined by the missing scaling factor which will cause the fee to be significantly less then the intended amount impacting all recipients of fees.
By following the below directions you will see 0 for lpTokenDepositValueChange while there was a 50% price increase.
If you put this log here:
And the this PoC in the UpliftExample.t.sol test file
Loss of yield
The vulnerability results in:
Fees being severely undercharged
Protocol and fee recipients losing significant revenue
Economic model of the protocol being undermined
All participants who should receive fees (admin, protocol, etc.) being affected
Manual Review
Modify the fee calculation to ensure that lpTokenDepositValueChange accurately reflects the profit of the LP position.
Likelihood: High, every call to the function (withdraw) Impact: Low/Medium, uplift fees will be applied only when the price of one asset is doubled but fixed fees will still be collected.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.