The calculateUtilizationRate function is designed to calculate the utilization rate of a reserve based on its liquidity and debt values. However, it currently uses the raw values (reserve.totalLiquidity and reserve.totalUsage) instead of the normalized values (computedLiquidity and computedDebt). This discrepancy may lead to inaccurate calculations of the utilization rate, potentially undermining the integrity of the reserve’s financial metrics and calculations.
The calculateUtilizationRate function takes two parameters, totalLiquidity and totalDebt, which represent the total liquidity and total debt in the reserve. However, these parameters should reflect the normalized or compounded values (computedLiquidity and computedDebt) to account for changes over time, such as interest accumulation and liquidity adjustments. By using the raw values, the function does not properly consider the current state of the reserve, potentially leading to incorrect utilization rate calculations.
Incorrect Parameters: The function uses raw values (reserve.totalLiquidity and reserve.totalUsage) rather than normalized values.
Mismatch with Normalized Metrics: The function’s comment suggests that it should use normalized values, but the actual implementation does not align with this intent.
updateInterestRatesAndLiquidity
Using raw values instead of normalized values can result in inaccurate calculations of the utilization rate, which may affect:
Reserve Health: The reserve’s financial health may be miscalculated, potentially leading to suboptimal decisions related to liquidity and debt management.
Interest Rate Calculations: The incorrect utilization rate could impact the correct calculation of usage and liquidity rates, leading to suboptimal rates being applied to borrowers and liquidity providers.
Manual
Refactor the Function: Modify the calculateUtilizationRate function to take normalized liquidity and debt values (computedLiquidity and computedDebt) as parameters, rather than the raw reserve.totalLiquidity and reserve.totalUsage values.
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.