code-423n4 / 2021-09-wildcredit-findings

0 stars 0 forks source link

Simple interest formula is used #44

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

Handle

cmichel

Vulnerability details

The _accrueInterest function uses a simple interest formula to compute the accrued debt, instead of a compounding formula.

Impact

This means the actual borrow rate and interest for suppliers depend on how often updates are made. This difference should be negligible in highly active markets, but it could lead to a lower borrow rate in low-activity markets.

Recommendation

Ensure that the lending pairs is accrued regularly, or switch to a compound interest formula (which has a higher gas cost due to exponentiation, but can be approximated, see Aave).