Themis V2 developer docs
Search…
⌃K
Links

M1PoolConfigurator

M1PoolConfigurator

M1Pool configuration contract, risk control and administrator operations.

Write Methods

setM1CollateralBorrowing

function setM1CollateralBorrowing(address collateralAddress, bool enabled) external override onlyRiskOrPoolAdmins
Set whether this type of collateral pool is available for re-borrowing in M1Pool

Call Params

Name
Type
Description
collateralAddress
address
the contract address of collateral
enabled
bool
true:allow borrowing, false:do not allow borrowing

setM1CollateralActive

function setM1CollateralActive(address collateralAddress, bool enabled) external override onlyRiskOrPoolAdmin
Set whether the collateral pool of this type can be active again in M1Pool

Call Params

Name
Type
Description
collateralAddress
address
the contract address of collateral
enabled
bool
true:activated, false:inactive

setM1CollateralActive

function setM1CollateralFrozen(address collateralAddress, bool enabled) external override onlyRiskOrPoolAdmins
Set whether the collateral pool of this type can be frozen in M1Pool or not

Call Params

Name
Type
Description
collateralAddress
address
the contract address of collateral
enabled
bool
true:frozen, false:unfrozen

setM1CollateralMaxBorrowLimitInBaseCurrency

function setM1CollateralMaxBorrowLimitInBaseCurrency(address collateralAddress, uint256 quantity) external override onlyRiskOrPoolAdmins
Set the maximum amount of USD value that can be borrowed for this type of asset.

Call Params

Name
Type
Description
collateralAddress
address
the contract address of collateral
quantity
uint256
Maximum number of USD values available for borrowing

setM1CollateralLiquidationThreshold

function setM1CollateralLiquidationThreshold(address collateralAddress, uint256 liquidationThreshold, uint256 liquidationBonus) external override onlyRiskOrPoolAdmins
Set the parameters of LiquidationThreshold for this type of collateral pool.

Call Params

Name
Type
Description
collateralAddress
address
contract address of the collateral asset
liquidationThreshold
uint256
Actual collateral value to the collateral value.
liquidationBonus
uint256
The bonus for the liquidators

setM1CollateralFactor

function setM1CollateralFactor(address collateralAddress, uint256 factor) external override onlyRiskOrPoolAdmins

Call Params

Name
Type
Description
collateralAddress
address
contract address of collateral asset
factor
uint256
the factor of loan to value

addM1CollateralAsset

function addM1CollateralAsset(address collateralAddress, address asset) external override onlyRiskOrPoolAdmins
Add a lendable asset to a particular collateral pool (the asset must be in Pool)

Call Params

Name
Type
Description
collateralAddress
address
contract address of collateral asset
asset
address
the available borrowing asset type for the collatral

setM1CollateralAssetBorrowing

function setM1CollateralAssetBorrowing(address collateralAddress, address asset, bool enabled) external override onlyRiskOrPoolAdmins
To set the available borrowing asset for a collateral asset

Call Params

Name
Type
Description
collateralAddress
address
contract address of the collateral
asset
address
available asset to borrow
enabled
bool
true: enable borrowing, false: disable borrowing

setM1CollateralAssetPaused

function setM1CollateralAssetPaused(address collateralAddress, address asset, bool enabled) external override onlyRiskOrPoolAdmins
To set collateral asset paused

Call Params

Name
Type
Description
collateralAddress
address
contract address of the collateral
asset
address
contract address of the collateral
enabled
bool
true: paused,false: on going

setM1CollateralAssetFrozen

function setM1CollateralAssetFrozen(address collateralAddress, address asset, bool enabled) external override onlyRiskOrPoolAdmins
When an asset is frozen, all function will be frozen

Call Params

Name
Type
Description
collateralAddress
address
contract address of collateral
asset
address
available borrwoing assset
enabled
bool
true: frozen,false: unfrozen

setM1EModeCategory

function setM1EModeCategory( uint8 categoryId, uint16 ltv, uint16 liquidationThreshold, uint16 liquidationBonus, address oracle, string calldata label ) external override onlyRiskOrPoolAdmins
Set the perameters for E-mode

Call Params

Name
Type
Description
categoryId
uint8
category id
ltv
uint16
ltv
liquidationThreshold
uint16
Liquidationthreshold
liquidationBonus
uint16
bonus for liquidators
oracle
oracle
smart contract address of Oracle
label
string
discription

setCollateralEModeCategory

function setCollateralEModeCategory(address collateralAddress, uint8 newCategoryId) external override onlyRiskOrPoolAdmins
set E-mode for a specifical collateral asset.

Call Params

Name
Type
Description
collateralAddress
address
Contract address of collateral
newCategoryId
uint8
Catagory ID of E-mode

View Methods

getM1Configuration

function getM1Configuration(address collateralAddress) external view virtual override returns (DataTypes.M1CollateralConfiguration memory)
Check the basic configuration of the collateral pool

Call Params

Name
Type
Description
collateralAddress
address
Contract address of collateral

Return value

Name
Type
Description
name
string
Name of collateral pool
m1CollateralTypeModel
M1CollateralTypeModel
Collateral pool types 0: unconfigured type, 1: UNISWAP V3 pool, 2: UNISWAP V2 pool, 3: single LP (ERC20) pool
isBorrowing
bool
Borrowable or not true:can be borrowed, false:cannot be borrowed
isActive
bool
Activated or not true:activated, false: not activated
isFrozen
bool
Whether to freeze or not true:frozen, false:not frozen
maxBorrowLimitInBaseCurrency
uint256
The total maximum number of USD that can be borrowed in this collateralized lending pool
ltv
uint256
loan to value
liquidationThreshold
uint256
liquidation threshold
liquidationBonus
uint256
bonus to value for liquidator
factor
uint256
factor
categoryId
uint8
catagory ID for E-mode

getM1AssetConfigruation

function getM1AssetConfigruation(address collateralAddress, address asset) external view override returns (DataTypes.M1AssetConfiguration memory)
Check the configuration of an asset in this collateral pool

Call Params

Name
Type
Description
collateralAddress
address
抵押物合约地址
collateralAddress
asset
可借资产配置

Return Value

Name
Type
Description
isBorrowing
bool
Borrowable or not true:can be borrowed, false:cannot be borrowed
isActive
bool
Activated or not true:activated, false:not activated
isFrozen
bool
Whether to freeze or not true:frozen, false:not frozen

getM1CollateralAssetsList

function getM1CollateralAssetsList(address collateralAddress) external view override returns (address[] memory)
Get a collection of lending asset addresses backed by this collateralized lending pool.

Call Params

Name
Type
Description
collateralAddress
address
contract address of collateral

Return Values

Type
Description
address[]
Available borrowing assets address

getM1CollateralList

function getM1CollateralList() external view returns (address[] memory)
Query contract addresses of all collateral pools supported by M1Pool

Return Values

Type
Description
address[]
supported lending pool address

getM1EModeCategoryData

function getM1EModeCategoryData(uint8 id) external view returns (DataTypes.EModeCategory memory)
Get the configuration information of E-mode according to E-mode id