The LendingPool contract incorrectly tracks the liquidity deposited into the Curve Vault using the totalVaultDeposits
variable, which does not account for rebasing or negative yield adjustments. This results in potential underestimation or overestimation of available liquidity, leading to unexpected reverts or inefficient liquidity management.
The LendingPool contract attempts to track deposits into the Curve Vault with totalVaultDeposits
, which is incremented when liquidity is added and decremented when liquidity is withdrawn:
Inaccurate Accounting Due to Rebasing`
The Curve Vault rebases balances based on yield and potential losses, meaning the actual balance can be higher or lower than totalVaultDeposits
.
If totalVaultDeposits
overestimates available liquidity, withdrawals can fail when attempting to withdraw more than the rebased amount. This incurs DoS to deposit()
, withdraw()
and borrow()
that internally trigger _withdrawFromVault()
via _rebalanceLiquidity()
or _ensureLiquidity()
, provided partial withdrawal from the Curve vault has been implemented as I have reported separately.
If totalVaultDeposits
underestimates, funds remain idle instead of being used efficiently. The idling funds could have been used to prevent DoS aforementioned.
Essential functions, i.e. deposit()
, withdraw()
and borrow()
run into unneeded revert risk especially when underestimation is entailed.
Such reverts deprive interest rate calculations, indirectly incurring cascading effects relating to reserve liquidity and utilization rates. Hence, any miscalculations foster a delay that propagates to borrow rates, liquidity rates, and user interest rewards, destabilizing the protocol’s core mechanics.
Manual
Eliminate totalVaultDeposits
, ensuring withdrawals are based on real available liquidity.
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.