rebalanceLiquidity
is the function which maintain the 20:80 ratio of asset tokens in the RToken contract and curve vault. But this will get failed in most of the cases.
When user will try to deposit function using the function LendingPool::deposit
the execution will go as following deposit => ReserveLibrary::deposit
in the function ReserveLibrary::deposit
, the asset tokens will be transferred to the Rtoken address as we can see below.
Later in the execution _rebalanceLiquidity
function will be called to maintain the ratio. And in case of currentBuffer > desiredBuffer
the _depositIntoVault(excess);
function will be called, which will call the deposit function in the curve vault, but this will get failed, as the RToken contract hold the assets not the Lending Pool, so the deposit into the vault will get failed.
rebalanceLiquidity
will not work as intended and deposits will get failed.
Manual Review
First transfer the tokens to the LendingPool and after the liquidity balance the left amount should be transferred tot he RToken contract
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.