MarketLens
MarketLens is a contract that is primarily used by dApps and frontends to fetch data from Market.xyz pools. It is non-essential to the protocol, and its existence doesn't impact the protocol in any meaningful way.
It has methods that might not have the view
modifier, hence it is suggested that all methods be called using the eth_call
rpc-method.
Structs
PoolAsset
The PoolAsset
struct contains a lot of highly detailed metadata for a given asset in a pool.
PoolUser
The PoolUser
struct contains details about the participation of a user / account in a pool.
Methods
getPoolSummary(address) -> (uint, uint, address[], string[])
Aggregates multiple read calls and returns the summary of a given pool
comptroller - the comptroller address of a pool
returns -
totalBorrow (total value of funds borrowed denominated in ETH)
totalSupply (total value of funds supplied denominated in ETH)
underlying token addresses
underlying token symbols
getPoolAssetsWithData(address) -> PoolAsset[]
Fetches all the supported assets in a given pool with highly detailed metadata for it
comptroller - the comptroller address of a pool
returns - a list containing
PoolAsset
struct that contains the asset details
getPoolUsersWithData(address, uint) -> (PoolUser[], uint, uint)
Fetches all the users that have positions in a given pool below a certain maxHealth
threshold, where health implies totalCollateral/totalBorrow
comptroller - the comptroller address of a pool
returns -
PoolUser[] (list of the filtered users)
close factor of the pool
liquidation incentive of the pool
getPoolUserSummary(address, address) -> (uint, uint)
Fetches summary of a user account in a given pool
comptroller - the comptroller address of a pool
returns -
supplyBalance (the value of funds supplied by the user denominated in ETH)
borrowBalance (the value of funds borrowed by the user denominated in ETH)
Last updated