How To Remove Liquidity
In order to remove liquidity, you will need to pass as inputs to the contract the percentage of the exposition on the options side and the token side you want to withdraw.
But how are you going to know how much real assets you will get in exchange for that initial exposure? First of all, you can call the function getRemoveLiquidityAmounts
passing the same percentages. This function will return the withdrawal amounts of options and tokens. If you want to understand deeper the topic about exposure and position, check this section.
Keep in mind that the withdrawal amounts between calling the getRemoveLiquidityAmounts
and removeLiquidity
may change due to market changes.
Example 1 - Full Liquidity Remove
Imagine you have added some amount of liquidity of options
and some liquidity of tokenB.
Now you want to remove 100% of your exposition of both tokens. The steps you should do are:
1) Call getRemoveLiquidityAmounts
first in order to estimate the withdrawal amounts
2) Call removeLiquidty
on OptionAMMPool
with the percents that you want to remove your exposition.
Last updated
Was this helpful?