The protocol relies on a dynamically updating liquidity index to calculate user balances and accrued interest. However, if no user actions trigger a state update, the liquidity index remains stale, leading to incorrect balance calculations. This creates a scenario where users may believe they have not accrued interest when they actually have, potentially impacting their financial decisions and trust in the system.
rToken::balanceOf contains the following code:
This function scales the normalized debt into the actual debt by multiplying it by the current liquidity index. LendingPool::getNormalizedIncome is what returns the liquidity index. See below:
The combination of these 2 functions allow for dynamic balance updates of every user's rtokens which reflect the amount of interest gained by any user at any particular time. The issue is that the liquidity index returned by LendingPool::getNormalizedIncome can be stale. The liquidity index is updated in a time based format where interest accrues every period and this is updated in almost every function in the protocol including depositing, withdrawals, liquidations, etc. The state can also be upodated by any user by calling LendingPool::updateState. The issue lies when none of these actions have been called and a user decides to make an action based on their current rtoken balance, the balance reflected will not be accurate as no action to update the state has occured which leads users to believe that their position has not accumulated the required amount of interest.
This test was run in LendingPool.test.js in the "Borrow and Repay" describe block
Incorrect Balance Display: Users checking their balanceOf may believe they have not accrued interest due to the stale liquidity index.
Misleading Financial Decisions: Users might make incorrect decisions regarding withdrawals, additional deposits, or interest expectations.
Trust and Transparency Issues: Users may lose confidence in the protocol if their balance does not update accurately over time.
Manual Review, Hardhat
Auto-Update Liquidity Index on balanceOf Calls
Modify balanceOf to first update the liquidity index before returning a balance.
Force Periodic Updates
Introduce a heartbeat function that updates the liquidity index automatically at set intervals.
Example: A keeper bot calls updateState() every few blocks.
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.