The PoolLens contract is designed to retrieve important information for each registered pool. A list of essential information for all pools within the lending protocol can be acquired through the function getAllPools(). Additionally, the following records can be looked up for specific pools and markets:
the vToken balance of a given user;
the pool data (oracle address, associated vToken, liquidation incentive, etc) of a pool via its associated comptroller address;
the vToken address in a pool for a given asset;
a list of all pools that support an asset;
the underlying asset price of a vToken;
the metadata (exchange/borrow/supply rate, total supply, collateral factor, etc) of any vToken.
Copy struct PoolData {
string name;
address creator;
address comptroller;
uint256 blockPosted;
uint256 timestampPosted;
string category;
string logoURL;
string description;
address priceOracle;
uint256 closeFactor;
uint256 liquidationIncentive;
uint256 minLiquidatableCollateral;
struct PoolLens .VTokenMetadata[] vTokens;
} vTokenBalancesAll
Queries the user's supply/borrow balances in vTokens
Parameters
The list of vToken addresses
Return Values
struct PoolLens.VTokenBalances[]
A list of structs containing balances data
Queries all pools with addtional details for each of them
Parameters
The address of the PoolRegistry contract
Return Values
struct PoolLens.PoolData[]
Arrays of all Venus pools' data
getPoolByComptroller
Queries the details of a pool identified by Comptroller address
Parameters
The address of the PoolRegistry contract
The Comptroller implementation address
Return Values
PoolData structure containing the details of the pool
getVTokenForAsset
Returns vToken holding the specified underlying asset in the specified pool
Parameters
The address of the PoolRegistry contract
The underlyingAsset of VToken
Return Values
getPoolsSupportedByAsset
Returns all pools that support the specified underlying asset
Parameters
The address of the PoolRegistry contract
The underlying asset of vToken
Return Values
A list of Comptroller contracts
vTokenUnderlyingPriceAll
Returns the price data for the underlying assets of the specified vTokens
Parameters
The list of vToken addresses
Return Values
struct PoolLens.VTokenUnderlyingPrice[]
An array containing the price data for each asset
getPendingRewards
Returns the pending rewards for a user for a given pool.
Parameters
Return Values
struct PoolLens.RewardSummary[]
Returns a summary of a pool's bad debt broken down by market
Parameters
Address of the comptroller
Return Values
struct PoolLens.BadDebtSummary
badDebtSummary A struct with comptroller address, total bad debut denominated in usd, and a break down of bad debt by market
Queries the user's supply/borrow balances in the specified vToken
Parameters
Return Values
struct PoolLens.VTokenBalances
A struct containing the balances data
getPoolDataFromVenusPool
Queries additional information for the pool
Parameters
Address of the PoolRegistry
struct PoolRegistryInterface.VenusPool
The VenusPool Object from PoolRegistry
Return Values
Returns the metadata of VToken
Parameters
Return Values
struct PoolLens.VTokenMetadata
Returns the metadata of all VTokens
Parameters
The list of vToken addresses
Return Values
struct PoolLens.VTokenMetadata[]
An array of VTokenMetadata structs
vTokenUnderlyingPrice
Returns the price data for the underlying asset of the specified vToken
Parameters
Return Values
struct PoolLens.VTokenUnderlyingPrice
The price data for each asset