Liquidate Position

  • Function liquidatePosition

  • After determine that the liquidation conditions are met, calls into the same underlying _closePosition.

  • Liquidation Condition: (1) premium is not enough to pay for the swap fees that the borrowed liquidity would have earned, OR (2) current time exceed the 3 days loan term after LP calls for seizing liquidity. Revert with LiquidationNotMet if none of the conditions hold.

  • Note: anyone can be a liquidator when the liquidation condition is met. A liquidationReward is paid to the liquidator.

Last updated