AdaptiveCurveIrm
Inherits: IAdaptiveCurveIrm
State Variables
MORPHO
Address of Morpho.
address public immutable MORPHOrateAtTarget
mapping(Id => int256) public rateAtTargetFunctions
constructor
Constructor.
constructor(address morpho) ;Parameters
| Name | Type | Description |
|---|---|---|
morpho | address | The address of Morpho. |
borrowRateView
Returns the borrow rate per second (scaled by WAD) of the market marketParams without modifying any storage.
Assumes that market corresponds to marketParams.
function borrowRateView(MarketParams memory marketParams, Market memory market) external view returns (uint256);borrowRate
Returns the borrow rate per second (scaled by WAD) of the market marketParams.
Assumes that market corresponds to marketParams.
function borrowRate(MarketParams memory marketParams, Market memory market) external returns (uint256);_borrowRate
Returns avgRate and endRateAtTarget.
Assumes that the inputs marketParams and id match.
function _borrowRate(Id id, Market memory market) private view returns (uint256, int256);_curve
Returns the rate for a given _rateAtTarget and an err. The formula of the curve is the following: r = ((1-1/C)_err + 1) _ rateAtTarget if err < 0 ((C-1)_err + 1) _ rateAtTarget else.
function _curve(int256 _rateAtTarget, int256 err) private pure returns (int256);_newRateAtTarget
Returns the new rate at target, for a given startRateAtTarget and a given linearAdaptation. The formula is: max(min(startRateAtTarget * exp(linearAdaptation), maxRateAtTarget), minRateAtTarget).
function _newRateAtTarget(int256 startRateAtTarget, int256 linearAdaptation) private pure returns (int256);Events
BorrowRateUpdate
Emitted when a borrow rate is updated.
event BorrowRateUpdate(Id indexed id, uint256 avgBorrowRate, uint256 rateAtTarget);