IndexesLens

Git Source

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

NameTypeDescription
_poolTokenaddressThe address of the market.

Returns

NameTypeDescription
p2pSupplyIndexuint256The 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

NameTypeDescription
_poolTokenaddressThe address of the market.

Returns

NameTypeDescription
p2pBorrowIndexuint256The 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

NameTypeDescription
_poolTokenaddressThe address of the market.

Returns

NameTypeDescription
indexesTypes.IndexesThe 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

NameTypeDescription
_poolTokenaddressThe address of the market.

Returns

NameTypeDescription
marketTypes.MarketThe given market's market data.
deltaTypes.DeltaThe given market's deltas.
indexesTypes.IndexesThe given market's updated indexes.

_getPoolIndexes

Returns the current pool indexes.

function _getPoolIndexes(address _underlyingToken)
    internal
    view
    returns (uint256 poolSupplyIndex, uint256 poolBorrowIndex);

Parameters

NameTypeDescription
_underlyingTokenaddressThe address of the underlying token.

Returns

NameTypeDescription
poolSupplyIndexuint256The pool supply index.
poolBorrowIndexuint256The pool borrow index.