Fliquidator
The Fliquidator contract facilitates the liquidation of users across the vault-pair-type contracts.
Liquidation is the event-process of selling a portion of a user’s collateral to repay the user’s debt. This occurs when the value of their crypto-collateral-asset falls below a predefine threshold to back-up a percentage level of their debt value.
Liquidations are an important key operation job for the safety and protection of the pooled funds in a vault-pair contract.

FUNCTIONS

batchLiquidate()

Liquidate a user or set of users when their position is undercollateralized and get a bonus (defined in parameter bonusL in Vault). Calling user require to own and approve (ERC20) the Fliquidator contract to spend the debt crypto asset of the positions to be liquidated.
1
function batchLiquidate(address[] calldata _addrs, address _vault)
2
external
3
payable
4
nonReentrant
5
isValidVault(_vault) {
Copied!

flashbatchLiquidate()

Liquidate a user or set of users when their position is undercollateralized and get a bonus (defined in parameter bonusL in Vault) by using a flashloan. Calling user does not require to own the debt crypto asset amount position to be liquidated. However, the bonus for a caller of flashbatchLiquidate is less than batchLiquidate() due to flashloan fees involved at flashloan provider.
1
function flashBatchLiquidate(
2
address[] calldata _addrs,
3
address _vault,
4
uint8 _flashnum
5
) external isValidVault(_vault) nonReentrant {
Copied!

executeFlashbatchLiquidation()

This function is the callback of flashloan providers. This call is restricted to the flasher contract and it executes the operations of a flashbatchLiquidation().
1
function executeFlashBatchLiquidation(
2
address[] calldata _addrs,
3
uint256[] calldata _borrowBals,
4
address _liquidator,
5
address _vault,
6
uint256 _amount,
7
uint256 _flashloanFee
8
) external payable onlyFlash {
Copied!

flashClose()

Initiates a flashloan used to repay partially or fully the debt position of the caller (msg.sender). Caller can pass (-1) to fully close a debt position, otherwise the specific amount of debt to be repaid. Passing a number above msg.sender debt position will revert transaction.
1
function flashClose(
2
int256 _amount,
3
address _vault,
4
uint8 _flashnum
5
) external nonReentrant isValidVault(_vault) {
Copied!

executeflashClose()

This function is the callback of flashloan providers. This call is restricted to the flasher contract and it executes the operations of a flashClose().
1
function executeFlashClose(
2
address payable _userAddr,
3
address _vault,
4
uint256 _amount,
5
uint256 _flashloanFee
6
) external payable onlyFlash {
Copied!
Last modified 1mo ago
Copy link
Contents
FUNCTIONS