BorrowLiquidation
The liquidation of borrower's positions are achieved in this contract.
Write Functions
liquidateBorrowPosition
function liquidateBorrowPosition(
address user,
uint64 index,
uint64 currentEthPrice,
IBorrowing.LiquidationType liquidationType,
uint256 _lastCumulativeRate
) external payable
user
address
Address of the borrower.
index
uint64
Index of the borrower's position.
currentEthPrice
uint64
Current ETH price.
liquidationType
LiquidationType
How to liquidate the psoition.
lastCumulativeRate
uint256
Cumulative rate.
Liquidate the the borrower's position, if the current ETH price is below or equal to deposited LTV of deposited ETH price. Here the borrowed amount of USDa is burned, 10% of protected amount is going to ABOND USDa pool if the liquidated collateral is ETH. This function can only be called by borrowing contract.
liquidationType1
function liquidationType1(
address user,
uint64 index,
uint64 currentEthPrice,
uint256 lastCumulativeRate
) internal
user
address
Address of the borrower.
index
uint64
Index of the borrower's position.
currentEthPrice
uint64
Current ETH price.
lastCumulativeRate
uint256
Cumulative rate.
Here the borrowed amount of USDa is burned, 10% of protected amount is going to ABOND USDa pool if the liquidated collateral is ETH.
liquidationType2
function liquidationType1(
address user,
uint64 index,
uint64 currentEthPrice
) internal
user
address
Address of the borrower.
index
uint64
Index of the borrower's position.
currentEthPrice
uint64
Current ETH price.
Here the 50% of the deposited amount is transfer to synthetix for taking short position with 1X leverage.
closeThePositionInSynthetix
function closeThePositionInSynthetix() external
Submit the order to close the above opened short position in synthetix.
executeOrdersInSynthetix
function executeOrdersInSynthetix(
bytes[] calldata priceUpdateData
) external
Execute the submitted orders in synthetix.
setTreasury
function setTreasury(address _treasury)
_treasury
address
Treasury contract addess.
Sets treasury contract interface.
setAdmin
function setTreasury(address adminAddress)
adminAddress
address
Admin's address.
Sets admin's address.
Last updated