Remove Liquidity
Calculating what proportion of each token users are eligible to withdraw based on the liquidity they provided initially.
Last updated
Calculating what proportion of each token users are eligible to withdraw based on the liquidity they provided initially.
Last updated
Disclaimer: with the current UI, users can only provide or remove liquidity equally on both sides
Single-sided liquidity provision Quick recap: it is possible to add liquidity on one side of the pool. The pool will track the user's initial exposure, and by the time the user removes liquidity, the withdrawal position will reflect the initial exposure within a new distribution of assets. It means that it is possible (and likely) to withdraw percentages of both assets. The remove liquidity function allows users to choose what percentage of the amount provided they wish to withdraw at a given instant . The only user who can remove liquidity is a user who provided liquidity before and still has funds in the pool. is the proportion of the user's initial deposit that it wishes to withdraw now. Removing "1" corresponds to remove 100% of the funds previously added.
and
The event of removing liquidity requires the following information: 1. Proportion of initial exposure of token A that wants to withdraw. 2. Proportion of initial exposure of token B that wants to withdraw.
For simplicity, let's acknowledge that the option price is a function that required a and an internal vector () as input.
For more details about the pricing formula and its contract implementation, check this section.
The pool's opening factor works as a factor that will update the pool's amortization as time passes.
The redemption multipliers are defined as:
After the withdraw, the contract calculates the updated user balance for each token.
The contract will calculate the new total balance for each token considering the recent withdrawal.
At the contract level, an ERC20 transfer is happening. Total balance (TB) is just a mathematical representation. The Total balance is checked by consulting the balanceOf()
of the pool contract of the respective token (tokenA or tokenB)
Remove Liquidity ✅