Lens
Inherits: RewardsLens
Author: Morpho Labs.
This contract exposes an API to query on-chain data related to the Morpho Protocol, its markets and its users.
Functions
constructor
CONSTRUCTOR ///
Constructs the contract.
constructor(address _lensExtension) LensStorage(_lensExtension);
Parameters
Name | Type | Description |
---|---|---|
_lensExtension | address | The address of the Lens extension. |
getTotalSupply
EXTERNAL ///
Computes and returns the total distribution of supply through Morpho, using virtually updated indexes.
function getTotalSupply()
external
view
returns (uint256 p2pSupplyAmount, uint256 poolSupplyAmount, uint256 totalSupplyAmount);
Returns
Name | Type | Description |
---|---|---|
p2pSupplyAmount | uint256 | The total supplied amount matched peer-to-peer, subtracting the supply delta (in USD, 18 decimals). |
poolSupplyAmount | uint256 | The total supplied amount on the underlying pool, adding the supply delta (in USD, 18 decimals). |
totalSupplyAmount | uint256 | The total amount supplied through Morpho (in USD, 18 decimals). |
getTotalBorrow
Computes and returns the total distribution of borrows through Morpho, using virtually updated indexes.
function getTotalBorrow()
external
view
returns (uint256 p2pBorrowAmount, uint256 poolBorrowAmount, uint256 totalBorrowAmount);
Returns
Name | Type | Description |
---|---|---|
p2pBorrowAmount | uint256 | The total borrowed amount matched peer-to-peer, subtracting the borrow delta (in USD, 18 decimals). |
poolBorrowAmount | uint256 | The total borrowed amount on the underlying pool, adding the borrow delta (in USD, 18 decimals). |
totalBorrowAmount | uint256 | The total amount borrowed through Morpho (in USD, 18 decimals). |