The functions getUserDebt, getNormalizedIncome, and getNormalizedDebt rely on reserve indices (liquidityIndex and usageIndex) to calculate user balances and income. However, these indices accrue interest over time, and if they are not updated before querying, users receive outdated values. This can lead to incorrect calculations of user debt, interest earned, and overall financial metrics. The issue can be resolved by ensuring the reserve state is updated before retrieving these values.
The functions getUserDebt, getNormalizedIncome, and getNormalizedDebt fetch values based on reserve.liquidityIndex and reserve.usageIndex.
These indices change over time due to interest accrual. If they are not refreshed before being used, the calculations return outdated values.
The contract provides an updateReserveState function to refresh the indices, but this function is not called before querying user-related data.
The affected functions (getUserDebt, getNormalizedIncome, getNormalizedDebt) use outdated indices, leading to incorrect outputs.
Example of stale data retrieval:
Since reserve.usageIndex may not be up to date, the returned debt value may not accurately reflect accrued interest.
Users may receive misleading data when checking their outstanding debt or earned interest.
This could result in miscalculations for liquidation thresholds, repayment amounts, and overall financial tracking.
Manual code inspection to evaluate how reserve indices are updated and accessed.
Before calling getUserDebt, getNormalizedIncome, or getNormalizedDebt, invoke updateReserveState to ensure the latest values are used.
Any function relying on liquidityIndex and usageIndex should always call updateReserveState before returning data.
This ensures that users and other contract functions always work with accurate and up-to-date financial data.
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.