Closed howlbot-integration[bot] closed 1 month ago
Expected behaviour, the interest rate is specifically described in documentation as updating after every non-static call.
In any event, it isn't as severe as you might imagine, we looked into this last year. Absent someone poking it every single block, this is effectively void.
Deliberate design choice with an accepted discrepancy between continuous and discrete compounding
3docSec marked the issue as unsatisfactory: Insufficient proof
Lines of code
https://github.com/code-423n4/2024-08-wildcat/blob/main/src/market/WildcatMarket.sol#L202
Vulnerability details
Vulnerability Detail
The Wildcat protocol design stipulates that borrowers should pay lenders an agreed-upon Annual Percentage Rate (APR). For instance, if a lender deposits 100,000 worth of an asset with a 10% APR and a protocol fee of 10% of the APR, the lender should receive 111,000 worth of the asset after one year (365 days).
This design assumes that the borrower repays the loan in a single transaction at the end of the loan period. However, if the borrower decides to repay the loan in multiple installments, they will pay more interest and fees than expected. This occurs because each time the borrower calls the
repay function
, the accrued interest and protocol fees are calculated. Therefore, subsequent repayments include interest on the previously accrued interest, resulting in the borrower paying a higher total than initially agreed upon.The more the number of repayments, the more the borrower will pay.
Tools
Manual Review
Impact
Overpayment by Borrowers: Borrowers will incur significantly more fees and interest if they repay the loan in multiple installments rather than in a single payment.
Unintended Debt Accumulation: The debt accrual mechanism results in interest compounding on already accrued interest, which is not part of the intended loan terms.
Proof of Concept
Recommended Mitigation Steps
The implementation should only be implemented such that making repayment multiple times does not lead to borrowers paying more fees and interest.
Assessed type
Other