Skip to main content

Implementation

Adaptive Curve IRM Github repository

The contract implements the Interest Rate Model interface to fit Morpho Blue's specifications.

Moreover, the implementation stores configuration variables and a market parameter updated at each borrowRate call for this market.

Variables

Constants

The values of the following constants are hardcoded into the code deployed on Ethereum

  • CURVE_STEEPNESS: Curve steepness (scaled by WAD), value = 4.
  • ADJUSTMENT_SPEED: Adjustment speed per second (scaled by WAD), value = 50/nb of seconds per year.
  • TARGET_UTILIZATION: Target utilization (scaled by WAD), value = 90%.
  • INITIAL_RATE_AT_TARGET: Initial rate at target per second (scaled by WAD), value = 4%/nb of seconds per year.
  • MIN_RATE_AT_TARGET: Minimum rate at target per second (scaled by WAD), value = 0.1%/nb of seconds per year.
  • MAX_RATE_AT_TARGET: Maximum rate at target per second (scaled by WAD), value = 200%/nb of seconds per year.

Immutables

  • MORPHO: Address of Morpho.

Mappings

Rate at target

mapping(Id => uint256) public rateAtTarget;

Rate at target utilization for each market. Tells the height of the curve.

Events

BorrowRateUpdate

event BorrowRateUpdate(Id indexed id, uint256 avgBorrowRate, uint256 rateAtTarget);

Emitted when the borrow rate is updated (called by Morpho).

Parameters:

NameTypeDescription
idIdThe id of the market.
avgBorrowRateuint256The average borrow rate of the market.
rateAtTargetuint256The stored rate at target of the market.