Configurator

This module is used to adding, removing and setting the assets in the custom pools.

Write Methods

addAssetERC20

function addAssetERC20(uint32 poolId, address asset) public

Adding a new ERC20 asset into the pool.

Parameter NameTypeDescription

poolId

uint32

The id of the pool

asset

address

The address of the underlying asset, E.g. WETH, USDT

removeAssetERC20

function removeAssetERC20(uint32 poolId, address asset) public

Removing a ERC20 asset from the pool. The liquidity (supply & borrow) of the to be deleted asset MUST be empty.

Parameter NameTypeDescription

poolId

uint32

The id of the pool

asset

address

The address of the underlying asset, E.g. WETH, USDT

addAssetERC721

function addAssetERC721(uint32 poolId, address asset) public

Adding a new ERC721 asset into the pool.

Parameter NameTypeDescription

poolId

uint32

The id of the pool

asset

address

The address of the underlying asset, E.g. WETH, USDT

removeAssetERC721

function removeAssetERC721(uint32 poolId, address asset) public

Removing a ERC20 asset from the pool. The liquidity (supply & borrow) of the to be deleted asset MUST be empty.

Parameter NameTypeDescription

poolId

uint32

The id of the pool

asset

address

The address of the underlying asset, E.g. WETH, USDT

addAssetGroup

function addAssetGroup(uint32 poolId, address asset, uint8 groupId, address rateModel_)

Adding a new group into asset. The asset MUST be ERC20 and the group MUST already added into the pool.

Parameter NameTypeDescription

poolId

uint32

The id of the pool

asset

address

The address of the underlying asset, E.g. WETH, USDT

groupId

uint8

The id of the group

rateModel_

address

The address of interest rate model contract

removeAssetGroup

function removeAssetGroup(uint32 poolId, address asset, uint8 groupId, address rateModel_)

Removing a group from asset. The liquidity (borrow) of the to be deleted group MUST be empty.

Parameter NameTypeDescription

poolId

uint32

The id of the pool

asset

address

The address of the underlying asset, E.g. WETH, USDT

groupId

uint8

The id of the group.

setAssetActive

function setAssetActive(uint32 poolId, address asset, bool isActive) public

Activate or deactivate a asset in the pool. Deactivated asset can not be operated at all.

Parameter NameTypeDescription

poolId

uint32

The id of the pool

asset

address

The address of the underlying asset, E.g. WETH, USDT

isActive

bool

The active flag

setAssetFrozen

function setAssetFrozen(uint32 poolId, address asset, bool isFrozen) public

Freeze or unfreeze a asset in the pool. Fronzen asset can not be withdrawn or borrowed.

Parameter NameTypeDescription

poolId

uint32

The id of the pool

asset

address

The address of the underlying asset, E.g. WETH, USDT

isFrozen

bool

The freeze flag

setAssetPause

function setAssetPause(uint32 poolId, address asset, bool isPause) public

Pause or unpause a asset in the pool. Paused asset can not be operated at all.

Parameter NameTypeDescription

poolId

uint32

The id of the pool

asset

address

The address of the underlying asset, E.g. WETH, USDT

isPause

bool

The pause flag

setAssetBorrowing

function setAssetBorrowing(uint32 poolId, address asset, bool isEnable) public

Enable or disable the borrowing flag of a asset in the pool. Only borrowing enabled asset can be borrowed by the user.

Parameter NameTypeDescription

poolId

uint32

The id of the pool

asset

address

The address of the underlying asset, E.g. WETH, USDT

isEnable

bool

The enable flag

setAssetFlashLoan

function setAssetFlashLoan(uint32 poolId, address asset, bool isEnable) public

Enable or disable the flash loan flag of a asset in the pool.

Parameter NameTypeDescription

poolId

uint32

The id of the pool

asset

address

The address of the underlying asset, E.g. WETH, USDT

isEnable

bool

The enable flag

setAssetSupplyCap

function setAssetSupplyCap(uint32 poolId, address asset, uint256 newCap) public

Setting the maximum supply capacity of a asset in the pool.

Parameter NameTypeDescription

poolId

uint32

The id of the pool

asset

address

The address of the underlying asset, E.g. WETH, USDT

newCap

bool

The new capacity value which must be decimals

setAssetBorrowCap

function setAssetBorrowCap(uint32 poolId, address asset, uint256 newCap) public

Setting the maximum borrow capacity of a asset in the pool.

Parameter NameTypeDescription

poolId

uint32

The id of the pool

asset

address

The address of the underlying asset, E.g. WETH, USDT

newCap

bool

The new capacity value which must be decimals

setAssetClassGroup

function setAssetClassGroup(uint32 poolId, address asset, uint8 classGroup) public

Setting the class group of a asset in the pool.

Parameter NameTypeDescription

poolId

uint32

The id of the pool

asset

address

The address of the underlying asset, E.g. WETH, USDT

classGroup

uint8

The group id which MUST be in [1, 2, 3]

setAssetCollateralParams

function setAssetCollateralParams(
    uint32 poolId,
    address asset,
    uint16 collateralFactor,
    uint16 liquidationThreshold,
    uint16 liquidationBonus
  ) public

Setting the collateral parameters of a asset in the pool.

Parameter NameTypeDescription

poolId

uint32

The id of the pool

asset

address

The address of the underlying asset, E.g. WETH, USDT

collateralFactor

uint16

The LTV (loan to value) of the asset in percentage which has 2 decimals. E.g. 5000 is 50%.

liquidationThreshold

uint16

The liquidation threshold of the asset in percentage which has 2 decimals. E.g. 8000 is 80%.

liquidationBonus

uint16

The liquidation bonus of the asset in percentage which has 2 decimals. E.g. 1000 is 10%.

setAssetAuctionParams

function setAssetAuctionParams(
    uint32 poolId,
    address asset,
    uint16 redeemThreshold,
    uint16 bidFineFactor,
    uint16 minBidFineFactor,
    uint40 auctionDuration
  ) public

Setting the auction parameters of a asset in the pool. The asset MUST be ERC721.

Parameter NameTypeDescription

poolId

uint32

The id of the pool

asset

address

The address of the underlying asset, E.g. WETH, USDT

redeemThreshold

uint16

The redeem threshold of the asset in percentage which has 2 decimals. E.g. 5000 is 50%.

bidFineFactor

uint16

The bid fine factor of the asset in percentage which has 2 decimals. E.g. 1000 is 10%.

minBidFineFactor

uint16

The minimum bid fine factor of the asset in percentage which has 2 decimals. E.g. 2000 is 20%.

auctionDuration

uint40

The auction duration of the asset in seconds.

setAssetProtocolFee

function setAssetProtocolFee(uint32 poolId, address asset, uint16 feeFactor)

Setting the protocol fee factor a asset in the pool.

Parameter NameTypeDescription

poolId

uint32

The id of the pool

asset

address

The address of the underlying asset, E.g. WETH, USDT

feeFactor

uint16

The protocol fee factor of the asset in percentage which has 2 decimals. E.g. 1000 is 10%.

Last updated