The read only functions on the VenusLens contract provide a view into: - metadata of vToken - daily XVS rewards for an account - account balance for a single vToken - account balances for all vTokens in an account - underlying price of a vToken - underlying prices for a set of vTokens - get liquidity and shortfall of an account - get user's vote history - get proposal details for a set of proposals - get account XVS balance, total votes, and delegated votes - get historical voting balance for a user - get pending XVS Rewards for an account
Blocks Per Day
Copy uint256 BLOCKS_PER_DAY Total actions available on VToken
Copy uint256 VTOKEN_ACTIONS
Copy struct VenusMarketState {
uint224 index;
uint32 block;
} Holds full market information for a single vToken within a specific pool (excluding the Core Pool)
PoolWithMarkets
Struct representing a pool (excluding the Core Pool) and its associated markets
Query the metadata of a vToken by its address
Parameters
The address of the vToken to fetch VTokenMetadata
Return Values
struct VenusLens.VTokenMetadata
VTokenMetadata struct with vToken supply and borrow information.
Get VTokenMetadata for an array of vToken addresses
Parameters
Array of vToken addresses to fetch VTokenMetadata
Return Values
struct VenusLens.VTokenMetadata[]
Array of structs with vToken supply and borrow information.
Get amount of XVS distributed daily to an account
Parameters
Address of account to fetch the daily XVS distribution
Address of the comptroller proxy
Return Values
Amount of XVS distributed daily to an account
Get the current vToken balance (outstanding borrows) for an account
Parameters
Address of the token to check the balance of
Account address to fetch the balance of
Return Values
struct VenusLens.VTokenBalances
VTokenBalances with token balance information
vTokenBalancesAll
Get the current vToken balances (outstanding borrows) for all vTokens on an account
Parameters
Addresses of the tokens to check the balance of
Account address to fetch the balance of
Return Values
struct VenusLens.VTokenBalances[]
VTokenBalances Array with token balance information
vTokenUnderlyingPrice
Get the price for the underlying asset of a vToken
Parameters
Return Values
struct VenusLens.VTokenUnderlyingPrice
response struct with underlyingPrice info of vToken
vTokenUnderlyingPriceAll
Query the underlyingPrice of an array of vTokens
Parameters
Array of vToken addresses
Return Values
struct VenusLens.VTokenUnderlyingPrice[]
array of response structs with underlying price information of vTokens
getAccountLimits
Query the account liquidity and shortfall of an account
Parameters
contract ComptrollerInterface
Address of comptroller proxy
Address of the account to query
Return Values
struct VenusLens.AccountLimits
Struct with markets user has entered, liquidity, and shortfall of the account
Query the XVSBalance info of an account
Parameters
Return Values
struct VenusLens.XVSBalanceMetadata
Struct with XVS balance and voter details
Query the XVSBalance extended info of an account
Parameters
contract ComptrollerInterface
Comptroller proxy contract address
Return Values
struct VenusLens.XVSBalanceMetadataExt
Struct with XVS balance and voter details and XVS allocation
Query the voting power for an account at a specific list of block numbers
Parameters
Return Values
struct VenusLens.VenusVotes[]
Array of VenusVotes structs with block number and vote count
Calculate the total XVS tokens pending and accrued by a user account
Parameters
Account to query pending XVS
contract ComptrollerInterface
Address of the comptroller
Return Values
struct VenusLens.RewardSummary
Reward object contraining the totalRewards and pending rewards for each market
getAllPoolsData
Returns all pools (excluding the Core Pool) along with their associated market data
Parameters
contract ComptrollerInterface
The Comptroller contract to query
Return Values
struct VenusLens.PoolWithMarkets[]
An array of PoolWithMarkets structs, each containing pool info and its markets
getMarketsDataByPool
Retrieves full market data for all vTokens in a specific pool (excluding the Core Pool)
Parameters
The pool ID to fetch data for
contract ComptrollerInterface
The address of the Comptroller contract
Return Values
struct VenusLens.MarketData[]
An array of MarketData structs containing detailed market info for the given pool
❌ Errors
PoolDoesNotExist Reverts if the given pool ID does not exist
InvalidOperationForCorePool Reverts if called on the Core Pool (poolId = 0)
Last updated 4 months ago