Provides utility functions to view the state of LendingPools
struct PoolStats {
address pool;
address asset;
uint8 decimals;
string characterization;
uint256 supplied;
uint256 suppliedValue;
uint256 borrowed;
uint256 borrowedValue;
uint256 baseSupplyAPY;
uint256 maxSupplyAPY;
uint256 baseBorrowAPY;
uint256 maxBorrowAPY;
uint256 dailyRewards;
uint256 rewardsAPY;
uint256 utilization;
uint256 totalReserveShares;
uint256 tvl;
address[] collaterals;
}struct AggregateStats {
uint256 totalSuppliedValue;
uint256 totalBorrowedValue;
uint256 totalAvailableValue;
uint256 totalFeesPaid;
uint256 numberOfVaults;
uint256 tvl;
}struct PoolCollateralInfo {
address collateral;
uint8 decimals;
uint256 amountDeposited;
uint256 value;
uint256 ltv;
uint256 lltv;
uint256 liqPenalty;
uint256 liqBonus;
}struct LendingPoolInfo {
uint256 assetOraclePrice;
uint256 interestFeePercentage;
uint256 liquidationThreshold;
uint256 liquidationPenalty;
}struct AccountCollateralDeposited {
address token;
uint8 decimals;
uint256 amount;
uint256 value;
}struct AccountInfo {
uint256 walletAssetBalance;
uint256 supplied;
uint256 borrowed;
uint8 decimals;
uint256 healthFactor;
uint256 totalCollateralValue;
struct LendingPoolLens.AccountCollateralDeposited[] collateralDeposited;
}struct MarketInfo {
int256 oraclePrice;
uint256 oraclePriceDecimals;
uint256 interestFee;
uint256 supplyCap;
uint256 liquidity;
uint256 utilization;
uint256 liquidationThreshold;
uint256 liquidationPenalty;
}event PoolRegistered(address pool, address caller)event PoolUnregistered(address pool, address caller)error NotRegistered(address pool)Revert is unregistering pool that is not registered.
error ZeroAddress()Reverts if zero addrss provided
contract IAddressRegistry registryconstructor(address _registry) publicfunction registeredPools() external view returns (address[])Returns a list of all the registered pools
| Name | Type | Description |
|---|---|---|
| [0] | address[] | pools The addresses of all registered pools |
function activePools() external view returns (address[])Returns a list of all the active pools
| Name | Type | Description |
|---|---|---|
| [0] | address[] | pools The addresses of all active pools |
function getAggregateStats(bool onlyActive) external view returns (struct LendingPoolLens.AggregateStats)Returns the combined stats for all pools monitored by lens.
| Name | Type | Description |
|---|---|---|
| [0] | struct LendingPoolLens.AggregateStats | aggregateStats The aggregated stats of the all registred pools |
function getPoolStatsList(address[] pools) external view returns (struct LendingPoolLens.PoolStats[])Returns various metrics of specified pools.
Returns an array of PoolStats objects.
Reverts with NotRegistered(pool) error if a pool in the list is not registered.
| Name | Type | Description |
|---|---|---|
| pools | address[] | The list of pools to return stats for. |
| Name | Type | Description |
|---|---|---|
| [0] | struct LendingPoolLens.PoolStats[] | poolStats An array of PoolStats objects, containing the stats for specified pools. |
function getPoolStats(address poolAddress) public view returns (struct LendingPoolLens.PoolStats)Regturns the metrics of a specified pool.
Reverts with `NotRegistered(address) error if the pool address is not registered.
| Name | Type | Description |
|---|---|---|
| poolAddress | address | The address of the pool to return stats for |
| Name | Type | Description |
|---|---|---|
| [0] | struct LendingPoolLens.PoolStats | poolStats The PoolStats object containing the stats for specified pool. |
function getPoolAccountInfo(address poolAddress, address account) external view returns (struct LendingPoolLens.AccountInfo)Returns information about a given account in a specified pool.
| Name | Type | Description |
|---|---|---|
| poolAddress | address | The pool to return account info for. |
| account | address | The account to return info about. |
| Name | Type | Description |
|---|---|---|
| [0] | struct LendingPoolLens.AccountInfo | info An AccountInfo obect about account position in the pool. |
function getAccountFreeCollateralInPool(address poolAddress, address account, address token) external view returns (uint256)Returns the free collateral in pool
| Name | Type | Description |
|---|---|---|
| poolAddress | address | address of pool |
| account | address | The account to check for. |
| token | address | The collateral token to check. |
| Name | Type | Description |
|---|---|---|
| [0] | uint256 | The amount of specified collateral token that is free for withdrawal. |
function getPoolCollateral(address poolAddress) external view returns (struct LendingPoolLens.PoolCollateralInfo[])Returns information about colalteral in the pool
| Name | Type | Description |
|---|---|---|
| poolAddress | address | The pool to return collateral info for. |
| Name | Type | Description |
|---|---|---|
| [0] | struct LendingPoolLens.PoolCollateralInfo[] | info The PoolCollateralInfo about collateral in the specified pool. |
function getMarketInfo(address poolAddress) external view returns (struct LendingPoolLens.MarketInfo)Returns market information about the pool
| Name | Type | Description |
|---|---|---|
| poolAddress | address | The pool to return market info for. |
| Name | Type | Description |
|---|---|---|
| [0] | struct LendingPoolLens.MarketInfo | info The MarketInfo about collateral in the specified pool. |
function poolDailyRewards(address) public pure returns (uint256)Returns the amount of token emissions a given pool receives daily. //
| Name | Type | Description |
|---|---|---|
| [0] | uint256 | rewards pool receives in a day. |
function poolRewardRate(address) public pure returns (uint256)Returns the reward rate (APY) a pool receives. //
| Name | Type | Description |
|---|---|---|
| [0] | uint256 | The reward rate a pool receives. |
function getPrice(address pool, address asset) public view returns (int256)function version() external pure returns (uint16)returns the version of the lens