The setPrimeRate function imposes a hardcoded maximum change of 500 basis points (5%) from the old value. This restriction may be too limiting, preventing necessary adjustments in volatile market conditions or during significant economic shifts.
The primeRate can be changed when the admin request is fulfilled by Chainlink Functions. The response is processed in _processResponse hook, which calls lendingPool::setPrimeRate -> ReserveLibrary::setPrimeRate
In setPrimeRate, the new prime rate is compared to the old prime rate, and any change exceeding 5% from the previous value is reverted:
While this mechanism prevents drastic changes, it may also prevent the system from adjusting the prime rate when needed.
For example for an oldPrimeRate of 5% == 500bps the maxChange is:
maxChange = (500 * 500 + 5000) / 10_000 = 255_000 / 10_000 = 25bps
The new primeRate can't exceed 525pbs.
If we check the historycal prime rate, in most cases, the month over month change exceeds the 5% limit.
The protocol may be unable to update the prime rate, causing unfair lending/borrowing conditions or liquidity imbalances.
Consider the following changes:
Instead of a fixed 5% cap, consider basing the maximum change on historical volatility, market conditions.
Make the percentage cap configurable by admin/ governance.
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.