Lens

Git Source

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

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

NameTypeDescription
p2pSupplyAmountuint256The total supplied amount matched peer-to-peer, subtracting the supply delta (in USD, 18 decimals).
poolSupplyAmountuint256The total supplied amount on the underlying pool, adding the supply delta (in USD, 18 decimals).
totalSupplyAmountuint256The 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

NameTypeDescription
p2pBorrowAmountuint256The total borrowed amount matched peer-to-peer, subtracting the borrow delta (in USD, 18 decimals).
poolBorrowAmountuint256The total borrowed amount on the underlying pool, adding the borrow delta (in USD, 18 decimals).
totalBorrowAmountuint256The total amount borrowed through Morpho (in USD, 18 decimals).