Liquidate Vault

This contract is responsible for managing the liquidation of positions in a trading context. It includes several functions and events for registering and executing liquidations, as well as validating

Initialize

This function is used to initialize the contract and set up the necessary interfaces.

liquidateVault.initialize();

Register Liquidate Position

This function allows an address to register a position for liquidation.

liquidateVault.registerLiquidatePosition(
    uint256 _posId
);

Liquidate Position

This function allows an address to liquidate a position if it meets certain conditions.

liquidateVault.liquidatePosition(
    uint256 _posId
);

Validate Liquidation With Posid

This function is used to check if a position is eligible for liquidation.

Example Input:

Example Output:

Validate Liquidation With Posid And Price

This function is used to check if a position is eligible for liquidation, given a specific price.

Example Input:

Example Output:

Validate Liquidation

This function calculates the profit and loss (PnL), funding fee, and borrow fee for a position and checks if the position is eligible for liquidation.

Example Input:

Example Output:

Last updated