Closed grandizzy closed 1 year ago
I agree that the proposed change matches how we are performing an increase. Am curious to know the reason behind this change or the why.
Is it because this code was not inline with the spec?
this was changed in order to allow greater values / avoid overflow for the if clause with https://github.com/ajna-finance/contracts/commit/23e74852ffde8e32d2f490d5787bf7f899fc6966#diff-f180a783f7f398e0540bb5a9fee461cbec2f970bdd423c904b5e12c6ec69c325R286 but not for the else clause
I agree that the proposed change matches how we are performing an increase. Am curious to know the reason behind this change or the why.
Is it because this code was not inline with the spec?
updated
Description of change
High level
PoolCommons._calculateInterestRate
the condition formula for decreasing interest rate is implemented differently than condition for increasing rate. Condition for increasing rate was changed with https://github.com/ajna-finance/contracts/commit/23e74852ffde8e32d2f490d5787bf7f899fc6966#diff-f180a783f7f398e0540bb5a9fee461cbec2f970bdd423c904b5e12c6ec69c325R286 to fix an overflow while condition for decreasing wasn't, hence same error can manifestPoolCommons._calculateInterestRate
at par with increase rate condition, that is fromchange to
Contract size
Pre Change
Post Change
Gas usage
Pre Change
Post Change