The Auditor is the risk management layer of the protocol; it determines how much collateral a user is required to maintain, and whether (and by how much) a user can be liquidated. Each time a user borrows from a Market , the Auditor validates his account’s liquidity to determine his health factor.
Public State Variables
ASSETS_THRESHOLD
Copy function ASSETS_THRESHOLD () external view returns ( uint256 ) Maximum value the liquidator can send and still have granular control of max assets. Above this threshold, they should send type(uint256).max.
Copy function BASE_FEED () external view returns ( address ) Address that a market should have as price feed to consider as base price and avoid external price call.
Copy function TARGET_HEALTH () external view returns ( uint256 ) Target health factor that the account should have after it's liquidated to prevent cascade liquidations.
Copy function accountMarkets ( address ) external view returns ( uint256 ) Tracks the markets' indexes that an account has entered as collateral.
liquidationIncentive
Liquidation incentive factors for the liquidator and the lenders of the market where the debt is repaid.
Array of all enabled markets.
Stores market parameters per each enabled market.
Decimals that the answer of all price feeds should have.
accountLiquidity
Returns account's liquidity calculation.
Parameters
Returns
Retrieves all markets.
Returns
Gets the asset price of a price feed.
If Chainlink's asset price is <= 0 the call is reverted.
Parameters
Returns
Calculates the amount of collateral to be seized when a position is undercollateralized.
Parameters
Returns
checkLiquidation
Allows/rejects liquidation of assets.
This function can be called externally, but only will have effect when called from a market.
Parameters
Returns
Allow/rejects seizing of assets.
This function can be called externally, but only will have effect when called from a market.
Parameters
Checks if the account has liquidity shortfall.
Parameters
Validates that the current state of the position and system are valid.
To be called after adding the borrowed debt to the account position.
Parameters
Enables a certain market.
Enabling more than 256 markets will cause an overflow when casting market index to uint8.
Parameters
Allows assets of a certain market to be used as collateral for borrowing other assets.
Parameters
Removes market from sender's account liquidity calculation.
Sender must not have an outstanding borrow balance in the asset, or be providing necessary collateral for an outstanding borrow.
Parameters
Checks if account has debt with no collateral, if so then call clearBadDebt from each market.
Collateral is multiplied by price and adjust factor to be accurately evaluated as positive collateral asset.
Parameters