-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathInterestRateModel.sol
55 lines (48 loc) · 1.63 KB
/
InterestRateModel.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../LiquidityLogic.sol";
/**
* @title Interest Rate Model API
* @author MetaStreet Labs
*/
abstract contract InterestRateModel {
/**************************************************************************/
/* Errors */
/**************************************************************************/
/**
* @notice Invalid parameters
*/
error InvalidInterestRateModelParameters();
/**************************************************************************/
/* API */
/**************************************************************************/
/**
* @notice Get interest rate model name
* @return Interest rate model name
*/
function INTEREST_RATE_MODEL_NAME() external view virtual returns (string memory);
/**
* @notice Get interest rate model version
* @return Interest rate model version
*/
function INTEREST_RATE_MODEL_VERSION() external view virtual returns (string memory);
/**
* @notice Price interest for liquidity
* @param principal Principal
* @param duration Duration
* @param nodes Liquidity nodes
* @param count Liquidity node count
* @param rates Interest rates
* @param adminFeeRate Admin fee rate
* @return repayment Repayment
* @return adminFee Admin fee
*/
function _price(
uint256 principal,
uint64 duration,
LiquidityLogic.NodeSource[] memory nodes,
uint16 count,
uint64[] memory rates,
uint32 adminFeeRate
) internal view virtual returns (uint256 repayment, uint256 adminFee);
}