Withdraw Liquidity
This guide explains how to withdraw liquidity using the Torch Finance SDK, covering multiple scenarios and pools. The guide assumes the following setup:
Base Pools: Liquidity pools composed of specific assets, represented by their respective LP tokens.
Examples:
TON, tsTON, and stTON → LP Token: TriTon
USDT, USDC, and crvUSD → LP Token: TriUSD
Meta Pools: Liquidity pools built on top of Base Pools, combining Base Pool LP tokens with additional assets.
Examples:
TriTon + hTON → Meta Pool
TriUSD + scrvUSD → Meta Pool
Modes of Withdrawal
Single Mode
Withdraw only one specific asset from the pool.
May involve slippage depending on liquidity conditions.
Balanced Mode
Withdraw all assets in proportion to their pool balance.
Ensures minimal slippage and avoids disrupting pool balance.
Cannot specify a particular asset to withdraw in this mode.
Example 1: Withdraw Only One Liquidity from the Base Pool
If you want to withdraw only TON liquidity from the Base Pool, you must specify the asset (TON
) in Single Mode:
Use Case: This is ideal if you only need TON and want to avoid receiving other pool assets (e.g., tsTON or stTON).
Caution: May result in slippage depending on pool liquidity.
Example 2: Withdraw Liquidity in a Balanced Proportion from the Base Pool
If you want to withdraw liquidity proportionally across all assets in the Base Pool (TON, tsTON, and stTON), use Balanced Mode:
Use Case: Use this mode to receive all assets (TON, tsTON, stTON) in equal proportion.
Note: Balanced Mode ensures minimal slippage and avoids skewing the pool’s balance.
Example 3: Withdraw Liquidity from Both the Meta Pool and the Base Pool
If you want to withdraw liquidity from the Meta Pool, followed by a withdrawal from the Base Pool, remember:
You cannot specify an asset for the Meta Pool withdrawal under this scenario. Meta Pool withdrawals will only return TriTon tokens (LP tokens of the Base Pool) .
Use Case: Withdraw Meta Pool liquidity, and then proportionally withdraw Base Pool liquidity to receive TON, tsTON, and stTON.
Note: Meta Pool withdrawals output TriTon tokens, which can then be used for Base Pool withdrawals.
Example 4: Withdraw from the Meta Pool and Retrieve Only One Asset at the end
If you want to withdraw from the Meta Pool and receive only TON as the final output, specify Single Mode in the Base Pool withdrawal step:
Use Case: Withdraw liquidity from the Meta Pool and directly convert it to TON without receiving other Base Pool assets.
Caution: This process involves two steps, and slippage may apply in the Base Pool withdrawal.
Last updated