Close Position

  • Function: closePosition

  • The actual position closing steps are in _closePosition, which implements: swap back the needed amount to repay LP (Base.swap), repay LP (increaseLiquidity), send gains to trader (refundWithCheck), pays for fees (addTokensOwed).

  • Note: caller is authorized by checking the liens[msg.sender, lienId] belonging to the caller is non empty.

Last updated