Submitted by cmichel
The ThreePieceWiseLinearPriceCurve.adjustParams function uses three functions f1, f2, f3 where y_i = f_i(x_i).
It computes the y-axis intersect (b2 = f_2(0), b3 = f_3(0)) for each of these but uses unsigned integers for this, which means these values cannot become negative.
This rules out a whole class of functions, usually the ones that are desirable.
Check out this two-piece linear interest curve of Aave:

The intersection of the second steep straight line with the y-axis b_2 = f_2(0) would be negative.
Example:
Imagine a curve that is flat at 10% on the first 50% utilization but shoots up to 110% at 100% utilization.
This function would revert in the b2 computation as it underflows due to being a negative value.
Most curves that are actually desired for a lending platform (becoming steeper at higher utilization) cannot be used.
Evaluate the piecewise linear function in a different way that does not require computing the y-axis intersection value.
For example, for cutoff2 >= x > cutoff1, use f(x) = f_1(cutoff) + f_2(x - cutoff).
See Compound.
kingyetifinance (Yeti finance) confirmed:
0xtruco (Yeti finance) commented:
