Controller
The Controller is the risk management portal of the dForce Lending & Synthetic Protocol, it determines how much collateral a user is required to maintain, whether (and how much) a user can be liquidated, and control the protocol risk by adjusting supply/borrow capacity and risk parameters.
Methods
enterMarkets()
Enter into a list of markets. In order to supply collateral or borrow in a market, it must be entered first.
exitMarkets()
Exit a market, exited markets will not count towards account liquidity calculations.
getAlliTokens()
Get all markets already added into the protocol.
hasiToken()
Return the status whether an iToken is listed in the controller.
getEnteredMarkets()
Get all markets already entered from one account.
getBorrowedAssets()
Get all assets already borrowed from one account.
calcAccountEquity()
Account liquidity represents the USD value with the specific asset/amount-continue-redeeming or amount-continue-borrowing before it reaches liquidation. Returns Tuple of values (equity, shortfall, collaterals, borrows). A non-zero equity value indicates the account has available borrowable value, a non-zero shortfall value indicates the account is currently below the collateral requirement and is subject to liquidation. At most one of equity or shortfall shall be non-zero. Collaterals and borrows represent the current collateral and borrow value is USD with 36 integer precision which for example, 360000000000000000000000000000000000000000 indicates 360000 in USD.
liquidateCalculateSeizeTokens()
Compute the amount of collateral iToken available to seize after repaying a specific amount of borrow asset.
Key Events
Event
Description
event MarketEntered
(address iToken, address account)
Emitted upon a successful Enter Market.
event MarketExited
(address iToken, address account)
Emitted upon a successful Exit Market.
event BorrowedAdded
(address iToken, address account)
Emitted upon a successful borrowing new asset(never borrowed before).
event BorrowedRemoved
(address iToken, address account)
Emitted upon a successful payoff an outstanding loan.
Last updated