MarketFacet
MarketFacet
This facet contract contains functions regarding markets
Solidity API
isComptroller
Indicator that this is a Comptroller contract (for inspection)
getAssetsIn
Returns the assets an account has entered
Parameters
account
address
The address of the account to pull assets for
Return Values
[0]
contract VToken[]
A dynamic list with the assets the account has entered
getAllMarkets
Return all of the markets
Return Values
[0]
contract VToken[]
The list of market addresses
liquidateCalculateSeizeTokens
Calculate number of tokens of collateral asset to seize given an underlying amount
Parameters
vTokenBorrowed
address
The address of the borrowed vToken
vTokenCollateral
address
The address of the collateral vToken
actualRepayAmount
uint256
The amount of vTokenBorrowed underlying to convert into vTokenCollateral tokens
Return Values
[0]
uint256
(errorCode, number of vTokenCollateral tokens to be seized in a liquidation)
[1]
uint256
liquidateVAICalculateSeizeTokens
Calculate number of tokens of collateral asset to seize given an underlying amount
Parameters
vTokenCollateral
address
The address of the collateral vToken
actualRepayAmount
uint256
The amount of vTokenBorrowed underlying to convert into vTokenCollateral tokens
Return Values
[0]
uint256
(errorCode, number of vTokenCollateral tokens to be seized in a liquidation)
[1]
uint256
checkMembership
Returns whether the given account is entered in the given asset
Parameters
account
address
The address of the account to check
vToken
contract VToken
The vToken to check
Return Values
[0]
bool
True if the account is in the asset, otherwise false
enterMarkets
Add assets to be included in account liquidity calculation
Parameters
vTokens
address[]
The list of addresses of the vToken markets to be enabled
Return Values
[0]
uint256[]
Success indicator for whether each corresponding market was entered
exitMarket
Removes asset from sender's account liquidity calculation
Parameters
vTokenAddress
address
The address of the asset to be removed
Return Values
[0]
uint256
Whether or not the account successfully exited the market
_supportMarket
Add the market to the markets mapping and set it as listed
Parameters
vToken
contract VToken
The address of the market (token) to list
Return Values
[0]
uint256
uint256 0=success, otherwise a failure. (See enum Error for details)
updateDelegate
Grants or revokes the borrowing delegate rights to / from an account If allowed, the delegate will be able to borrow funds on behalf of the sender Upon a delegated borrow, the delegate will receive the funds, and the borrower will see the debt on their account
Parameters
delegate
address
The address to update the rights for
allowBorrows
bool
Whether to grant (true) or revoke (false) the rights
Last updated