Add and Remove Collateral
Adding & Removing collaterals to/from an existing position.
Add Collateral
To add collateral to a position, users must already create the position and specify the position ID. The collateral token must be an inToken from lending pools.
The position must be in a mode that allows the collateral to be used.
The above 2 steps must be performed in a single transaction (atomically) to avoid potential front-run attack.
Remove Collateral
To remove collateral, specify the position ID to remove from, shares of collateral to remove, and also the receiver address. The caller must be the position owner or approved party to modify the position.
Always check that the position's health is over 1 after removing collateral to avoid transaction revert.
Last updated