morpho-org / morpho-blue-irm

Morpho Blue Interest Rate Models
https://morpho.org
MIT License
26 stars 17 forks source link

Not compound rate variation ? #7

Closed MathisGD closed 1 year ago

MathisGD commented 1 year ago
          I seriously wonder if it is not a bit overkill. This computation cost a non-negligible amount of gas, and it is complex: it requires to ensure that there are no overflow in a computation up to a power of 12 (and it has also a limit when the linear variation is < -3).

Something simpler like

        uint256 variationMultiplier = WAD_INT + linearVariation;

would not have those issues. I understand that we would lose the property that having multiple updates in an interval is the same as having one update at the end, but this is only a third order loss in the worst case:

It was already unclear for rates if it was worth the extra computation cost, it may be the case here that it's not worth at all

_Originally posted by @QGarchery in https://github.com/morpho-labs/morpho-blue-periphery/pull/1#discussion_r1311530246_

MathisGD commented 1 year ago

I think that the benefit of this is small now that we have #12