M1Pool.solcontract is the main user facing contract of the protocol. It exposes the liquidity management methods that can be invoked using either Solidity or Web3 libraries.
function borrowM1( address collateralAddress, uint256 collateralAmount, address asset, uint256 amount, uint256 interestRateMode, uint16 referralCode, address onBehalfOf ) external
User can borrow the
assetby collateral the
collateralAddressasset to M1Pool
function addCollateral(uint256 userRecordId, uint256 collateralAmount) external
function reduceCollateral(uint256 userRecordId, uint256 collateralAmount) external
function extraBorrowM1(uint256 userRecordId, uint256 amount,address onBehalfOf) external
function repayM1( address collateralAddress, uint256 userRecordId, address asset, uint256 amount, address onBehalfOf ) external
function liquidationCallM1( uint256 recordId ) external
Liquidation operation based on the record ID generated by the collateral, anyone can call this interface when the collateral record triggers the liquidation.
function checkCanLiquidation(uint256 recordId) external view returns ( uint256 currentCollateralValueInBaseCurrency, uint256 collateralDebt, uint256 collateralDebtInBaseCurrency, uint256 liquidationThreshold, uint256 collateralCurrentRatio)
Check if the collateral record has been liquidated against the record ID
function getUserRecordIds(address user) external view returns (uint256 memory)
Get information about how many collateral records the user has based on the user's address
function getRecordDetails(uint256 recordId) external view returns (DataTypes.M1LoadAssetDetails memory)
Get the collateral details based on the collateral record ID.
function getM1UserTotalLoadAssetInfo(address user, address asset) external view returns (DataTypes.M1UserLoadAssetInfo memory)
Get the total number of debts for which the user borrowed a certain asset