Submitted by MiloTruck, also found by T1MOH, elprofesor, trachev, t0x1c, ast3ros, joaovwfreire, CaeraDenoir, and rvierdiiev
If a borrower calls setAnnualInterestBips() to reduce a markets annual interest rate, its reserve ratio will be set to 90% for 2 weeks:
WildcatMarketController.sol#L472-L485
This is meant to give lenders the option to withdraw from the market should they disagree with the decrease in annual interest rate.
However, such an implementation can be abused by a borrower in a market where the reserve ratio above 90%:
In the scenario above, the 5% reduction in reserve ratio works in favor of the borrower since they do not have to keep as much assets in the market. The amount of assets that all lenders can withdraw at any given time will also be 5% less than what it should be.
Note that it is possible for a market to be deployed with a reserve ratio above 90% if the protocols MaximumReserveRatioBips permits. For example, MaximumReserveRatioBips is set to 100% in current tests:
TestConstants.sol#L21
In a market where the reserve ratio is above 90%, a borrower can repeatedly call setAnnualInterestBips() every two weeks to keep the reserve ratio at 90%.
This is problematic, as a markets reserve ratio is not meant to be adjustable post-deployment, since the borrower and their lenders must agree to a fixed reserve ratio beforehand.
In setAnnualInterestBips(), consider setting the markets reserve ratio to 90% only if it is lower:
WildcatMarketController.sol#L472-L485
laurenceday (Wildcat) commented:
For images provided, refer to the original comment.
0xTheC0der (judge) commented:
laurenceday (Wildcat) confirmed
