一、接口
先来看看 InterestRateModel.sol 合约代码:
pragma solidity ^0.5.16;
/**
* @title Compound's InterestRateModel Interface
* @author Compound
*/
contract InterestRateModel {
/// @notice Indicator that this is an InterestRateModel contract (for inspection)
bool public constant isInterestRateModel = true;
/**
* @notice Calculates the current borrow interest rate per block
* @param cash The total amount of cash the market has
* @param borrows The total amount of borrows the market has outstanding
* @param reserves The total amount of reserves the market has
* @return The borrow rate per block (as a percentage, and scaled by 1e18)
*/
function getBorrowRate(uint cash, uint borrows, uint reserves) external vie
Compound 利率模型详解
本文深入剖析 Compound 中的 InterestRateModel,包括直线型和拐点型利率模型的原理、计算公式及图示。讨论了资金使用率、借款利率、存款利率的计算,并解释了利息的产生和汇率增加的机制。
订阅专栏 解锁全文
2696

被折叠的 条评论
为什么被折叠?



