InterestRatesManager
Inherits: IInterestRatesManager, MorphoStorage
Author: Morpho Labs.
Smart contract handling the computation of indexes used for peer-to-peer interactions.
This contract inherits from MorphoStorage so that Morpho can delegate calls to this contract.
Functions
updateP2PIndexes
EXTERNAL ///
Updates the peer-to-peer indexes.
function updateP2PIndexes(address _poolToken) external;
Parameters
Name | Type | Description |
---|---|---|
_poolToken | address | The address of the market to update. |
_computeP2PIndexes
INTERNAL ///
Computes and returns new peer-to-peer indexes.
function _computeP2PIndexes(Params memory _params)
internal
pure
returns (uint256 newP2PSupplyIndex, uint256 newP2PBorrowIndex);
Parameters
Name | Type | Description |
---|---|---|
_params | Params | Computation parameters. |
Returns
Name | Type | Description |
---|---|---|
newP2PSupplyIndex | uint256 | The updated p2pSupplyIndex. |
newP2PBorrowIndex | uint256 | The updated p2pBorrowIndex. |
Events
P2PIndexesUpdated
EVENTS ///
Emitted when the peer-to-peer indexes of a market are updated.
event P2PIndexesUpdated(
address indexed _poolToken,
uint256 _p2pSupplyIndex,
uint256 _p2pBorrowIndex,
uint256 _poolSupplyIndex,
uint256 _poolBorrowIndex
);
Structs
Params
STRUCTS ///
struct Params {
uint256 lastP2PSupplyIndex;
uint256 lastP2PBorrowIndex;
uint256 poolSupplyIndex;
uint256 poolBorrowIndex;
Types.LastPoolIndexes lastPoolIndexes;
uint256 reserveFactor;
uint256 p2pIndexCursor;
Types.Delta delta;
}