-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #110 from morpho-org/fix/constants-1
refactor irm constants
- Loading branch information
Showing
1 changed file
with
13 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,31 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import {WAD_INT} from "../MathLib.sol"; | ||
|
||
/// @title ConstantsLib | ||
/// @author Morpho Labs | ||
/// @custom:contact security@morpho.org | ||
library ConstantsLib { | ||
/// @notice 1 bps = 0.01% (scaled by WAD). | ||
int256 public constant ONE_BPS = 0.0001 ether; | ||
|
||
/// @notice Curve steepness (scaled by WAD). | ||
/// @dev Curve steepness = 4. | ||
int256 public constant CURVE_STEEPNESS = 4 ether; | ||
|
||
/// @notice Adjustment speed per second (scaled by WAD). | ||
int256 public constant ADJUSTMENT_SPEED = int256(50 ether) / 365 days; | ||
/// @dev Adjustment speed = 50/year. | ||
int256 public constant ADJUSTMENT_SPEED = 50 ether / int256(365 days); | ||
|
||
/// @notice Target utilization (scaled by WAD). | ||
/// @dev Target utilization = 90%. | ||
int256 public constant TARGET_UTILIZATION = 0.9 ether; | ||
|
||
/// @notice Initial rate at target per second (scaled by WAD) (1% min APR / 16% max APR). | ||
int256 public constant INITIAL_RATE_AT_TARGET = 4_00 * ONE_BPS / 365 days; | ||
/// @notice Initial rate at target per second (scaled by WAD). | ||
/// @dev Initial rate at target = 4% (rate between 1% and 16%). | ||
int256 public constant INITIAL_RATE_AT_TARGET = 0.04 ether / int256(365 days); | ||
|
||
/// @notice Minimum rate at target per second (scaled by WAD) (0.025% min APR). | ||
int256 public constant MIN_RATE_AT_TARGET = 10 * ONE_BPS / 365 days; | ||
/// @notice Minimum rate at target per second (scaled by WAD). | ||
/// @dev Minimum rate at target = 0.1% (minimum rate = 0.025%). | ||
int256 public constant MIN_RATE_AT_TARGET = 0.001 ether / int256(365 days); | ||
|
||
/// @notice Maximum rate at target per second (scaled by WAD) (800% max APR). | ||
int256 public constant MAX_RATE_AT_TARGET = 200_00 * ONE_BPS / 365 days; | ||
/// @notice Maximum rate at target per second (scaled by WAD). | ||
/// @dev Maximum rate at target = 200% (maximum rate = 800%). | ||
int256 public constant MAX_RATE_AT_TARGET = 2.0 ether / int256(365 days); | ||
} |