The Risk Engine contract provides a set of functions that enable market management, risk assessment, and user position tracking across multiple pToken markets. These methods allow users to interact with the risk framework
Add the market to the markets mapping and set it as listed
Copy function supportMarket ( IPToken pToken ) external ; Parameters
The address of the market (token) to list
Add the e-mode and configure its status with admin access
Copy function supportEMode (
uint8 categoryId ,
bool isAllowed ,
address [] calldata pTokens ,
bool [] calldata collateralPermissions ,
bool [] calldata borrowPermissions
) external ; Parameters
Id representing e-mode identifier
The identifier to active or deactivate e-mode
The array of addresses to add to e-mode
The array of collateral status for pTokens in e-mode
The array of borrowable status for pTokens in e-mode
Switch caller E-Mode category
0 is the initial and default category for all markets
Parameters
The new e-mode category that caller wants to switch
Add assets to be included in account liquidity calculation
Parameters
The list of addresses of the pToken markets to be enabled
Returns
Success indicator for whether each corresponding market was entered
Removes asset from sender's account liquidity calculation
Parameters
The address of the asset to be removed
Sets the oracle engine for a the risk engine
Admin function to set oracle
Parameters
The address of the new oracle
setReserveShares
Updates the reserve share percentages for the owner and configurator that applies to all ptokens.
needs protocol owner access to update
Parameters
The new share of reserve percentage for the owner (scaled by 1e18).
newConfiguratorShareMantissa
The new share of reserve percentage for the configurator (scaled by 1e18).
Sets the closeFactor for a market used when liquidating borrows
Admin function to set closeFactor
Parameters
address of ptoken set close factor for
New close factor, scaled by 1e18
Sets the collateralFactor and liquidation threshold for a market
Admin function to set per-market collateralFactor
Parameters
The collateralFactor, liqThreshold and liqIncentive of market
Add the market to the markets mapping and set it as listed
Admin function to set isListed and add support for the market
Parameters
The address of the market (token) to list
Add the e-mode and configure its status with amdin access
Parameters
Id representing e-mode identifier
The identifier to active or deactivate e-mode
The array of addresses to add to e-mode
The array of collateral status for pTokens in e-mode
The array of borrowable status for pTokens in e-mode
setMarketBorrowCaps
Set the given borrow caps for the given pToken markets. Borrowing that brings total borrows to or above borrow cap will revert.
borrowCapGuardian function to set the borrow caps. A borrow cap of type(uint256).max corresponds to unlimited borrowing.
Parameters
The addresses of the markets (tokens) to change the borrow caps for
The new borrow cap values in underlying to be set. A value of type(uint256).max corresponds to unlimited borrowing.
setMarketSupplyCaps
Set the given supply caps for the given pToken markets. Supplying that brings total supply to or above supply cap will revert.
supplyCapGuardian function to set the supply caps. A supply cap of type(uint256).max corresponds to unlimited supplying.
Parameters
The addresses of the markets (tokens) to change the supply caps for
The new supply cap values in underlying to be set. A value of type(uint256).max corresponds to unlimited supplying.
Admin function to pause mint
setBorrowPaused
Admin function to pause borrow
setTransferPaused
Admin function to pause transfer
Admin function to pause sieze
Last updated 7 months ago