IndexesLens
Inherits: LensStorage
Author: Morpho Labs.
Intermediary layer exposing endpoints to query live data related to the Morpho Protocol market indexes & rates.
Functions
getCurrentP2PSupplyIndex
EXTERNAL ///
Returns the updated peer-to-peer supply index.
function getCurrentP2PSupplyIndex(address _poolToken) external view returns (uint256 p2pSupplyIndex);
Parameters
Name | Type | Description |
---|---|---|
_poolToken | address | The address of the market. |
Returns
Name | Type | Description |
---|---|---|
p2pSupplyIndex | uint256 | The updated peer-to-peer supply index. |
getCurrentP2PBorrowIndex
Returns the updated peer-to-peer borrow index.
function getCurrentP2PBorrowIndex(address _poolToken) external view returns (uint256 p2pBorrowIndex);
Parameters
Name | Type | Description |
---|---|---|
_poolToken | address | The address of the market. |
Returns
Name | Type | Description |
---|---|---|
p2pBorrowIndex | uint256 | The updated peer-to-peer borrow index. |
getIndexes
Returns the updated peer-to-peer and pool indexes.
function getIndexes(address _poolToken) external view returns (Types.Indexes memory indexes);
Parameters
Name | Type | Description |
---|---|---|
_poolToken | address | The address of the market. |
Returns
Name | Type | Description |
---|---|---|
indexes | Types.Indexes | The given market's updated indexes. |
_getIndexes
INTERNAL ///
Returns the updated peer-to-peer and pool indexes.
function _getIndexes(address _poolToken)
internal
view
returns (Types.Market memory market, Types.Delta memory delta, Types.Indexes memory indexes);
Parameters
Name | Type | Description |
---|---|---|
_poolToken | address | The address of the market. |
Returns
Name | Type | Description |
---|---|---|
market | Types.Market | The given market's market data. |
delta | Types.Delta | The given market's deltas. |
indexes | Types.Indexes | The given market's updated indexes. |
_getPoolIndexes
Returns the current pool indexes.
function _getPoolIndexes(address _underlyingToken)
internal
view
returns (uint256 poolSupplyIndex, uint256 poolBorrowIndex);
Parameters
Name | Type | Description |
---|---|---|
_underlyingToken | address | The address of the underlying token. |
Returns
Name | Type | Description |
---|---|---|
poolSupplyIndex | uint256 | The pool supply index. |
poolBorrowIndex | uint256 | The pool borrow index. |