↖️How to Remove Liquidity

In this guide, you'll find the required steps to withdraw liquidity from ALEX DEX pools.

When removing liquidity, you will transfer your LP tokens back to the ALEX smart contract and withdraw an equivalent value of the token pair plus any fees accrued while holding those LP tokens. Since the relative balance of the tokens in the liquidity pool may have changed since your initial deposit, you could experience what's known as Impermanent Loss.

Ready to start? Let's get hands-on!

Step 1: Go to the Pool Page

As when adding liquidity, go to https://app.alexlab.co/ and click on navbar's Swap -> Pool tab.

Once you're on the Pool page, you'll find the "My Liquidity" panel at the top of the pool list. This panel provides a summary of all your pool contributions.

The pools where you are providing liquidity are displayed here. There is only one in this example.

Step 2: Select Pool

Select the pool you would like to remove liquidity from, either through the "My Liquidity" panel or directly from the pool list.

STX-ALEX pool selection.

Step 3: Open the Remove Liquidity Tab

Once in the panel of the pool, select the "Remove Liquidity" tab.

Step 4: Enter Amount to Withdraw

For this step, it's important to have in mind that the LP tokens you hold represent your share of the pool's funds. By entering the LP token amount, you're specifying the portion of the pooled funds you want to withdraw. Clicking the Max button sets your entire LP token balance, indicating you want to remove all liquidity from the pool.

When you enter the amount of LP tokens, you are specifiyng amount you will transfer to ALEX smart contract in order to receive your funds and any accrued fees in return. These fees are the ones accrued while holding those LP tokens.

Once you have decided the LP token amount, click the "Remove" button.

Example of removing all liquidity; the amount matches the LP token balance.

Step 5: Confirm Liquidity Removal

A confirmation panel will appear where you can double check the amount. If everything looks correct, click "Confirm" 😎

Step 6: Confirm the Transaction in Your Wallet

After clicking "Confirm", you will need to confirm the transaction in your wallet. Here, your Stacks wallet is interacting with ALEX smart contract and is asking you for approval. Scroll through the wallet transaction window, review it and confirm the transaction. By doing this, you are allowing the wallet to sign and broadcast the transaction.

Function arguments and confirmation button.

Step 7: Wait for Transaction Confirmation

Wait for the transaction to be confirmed on the network.

Recommended to track transaction status:

  • Turn on Telegram notifications, you will get notified when the transaction is confirmed.

  • Search for the transaction on the ALEX Explorer.

  • Check your address activity on the wallet.

Telegram message with transaction pending status.
Telegram message with transaction success status.
Transaction pending displayed on Leather wallet.
Transaction completed, token transfers are visible.

Step 8: Check the Updated Liquidity

Once the transaction is completed, you will see the changes reflected in the "My Liquidity" panel, and the updated token balances should appear in your wallet.

Last updated

Was this helpful?