Closed MerlinEgalite closed 11 months ago
testNotUnbounded
fails be cause of the issue mentioned above.
testBounded
passes because it uses the fix.
still to check @morpho-labs/onchain @morpho-labs/protocol
With a MAX_CURVE_STEEPNESS = 10_000 ether
we must cap WEXP_UPPER_VALUE
to 36516193261880035393743548115955503434
to avoid overflows in _curve
which is way stricter that the current max value: 115432178323118442717551238386899909037872776636038612254720
Closing it but we should adapt the doc perhaps
We could have made a special case for when the endRate touches the bounds:
if end = min: avg = min else if end = max: avg = max
could be a solution as well indeed!
Based on the following comment: https://github.com/morpho-labs/morpho-blue-irm/pull/54#discussion_r1390240289
endBorrowRate = startBorrowRate * exp(linearAdaptation)
is true mathematically but it's not in the code because of how we bound values in the computation. Here is an example of a failing test showcasing the issue: #77