ALEX Lab Docs
improvements-rebased
improvements-rebased
  • What is ALEX
  • Features
    • 🔄Token Swaps
      • 💡Key concepts
      • 🧑‍🏫How to swap
      • ❓FAQs
    • 🐋Liquidity Pools
      • 💡Key concepts
      • 🧑‍🏫How to add/remove liquidity
      • ❓FAQs
      • 📝Self-Service Listing
    • 🌾Farming
      • 💡Key concepts
      • 🧑‍🏫How to farm & harvest
      • ❓FAQs
      • 🧑‍🌾Self-Service Farming
    • ⚓Stake
      • 💡Key concepts
      • 🧑‍🏫How to stake
      • ❓FAQs
    • 🚀Launchpad
      • Join the ALEX Launchpad!
  • Resources
    • 🔗Official Links
    • 🪙Token List
    • 🔮ALEX Ecosystem Explorer
    • ✅Security Audit
    • 📃Whitepapers
      • 📃Whitepaper (1): Automated Market Making of the Yield Token Pool
      • 📃Whitepaper (2): Automated Market Making of the Collateral Rebalancing Pooltitled
      • 📃Whitepaper (3): Diving into Collateral Rebalancing Pools!
  • Detailed Information
    • 🪙Tokenomics
    • ALEX DAO
    • ALEX AMM
    • ALEX APower
Powered by GitBook
On this page
  • Adding Liquidity
  • Step 1: Go to the Pool Tab
  • Step 2: Select a Pool
  • Step 3: Add Liquidity
  • Step 4: Transaction Settings
  • Step 5: Confirm Add Liquidity
  • Step 6: Confirm Transaction
  • Step 7: Wait for Confirmation
  • Step 8: View Added LP Tokens
  • Removing liquidity
  • Step 1: Go to the Pool Tab
  • Step 2: Select Pool
  • Step 3: Go to Remove Liquidity
  • Step 4: Enter Amount to Remove
  • Step 5: Confirm Remove Liquidity
  • Step 6: Confirm Transaction
  • Step 7: Wait for Confirmation
  • Step 8: View Changes
  1. Features
  2. Liquidity Pools

How to add/remove liquidity

In these two guides, you'll find the required steps to provide liquidity and to withdraw liquidity from ALEX DEX pools.

PreviousKey conceptsNextFAQs

Last updated 5 months ago

When adding liquidity, you will deposit an equivalent value of both tokens into the pool. In return, you'll receive LP tokens, which represent your share of that specific liquidity pool.

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 .

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

Adding Liquidity

Step 1: Go to the Pool Tab

Go to and click on navbar's Swap -> Pool tab.

Step 2: Select a Pool

All available pools will be displayed including information such as:

  • Trading Pair: The token pair that constitute liquidity pools to which you can add liquidity.

  • Liquidity: The total liquidity in the pool, expressed in USD value.

  • Volume: The trading volume between the token pair over the last 7 days. By hovering on the trading volume for a specific row/pool, the 24-hour volume is also displayed.

  • Fee Rebate: Potential LP earnings from swap fees over a year, based on the last week's average. This metric, also known as Pool APR, reflects the potential profitability of participating in a pool over a year, assuming similar trading activity continues.

Select the token pair to which you want to add liquidity from the displayed list. Note you can sort by pool metrics.

When hovering over a pool, you might notice a +LP button. This serves as a visual indicator for the selected pool. Clicking it will take you to the same screen as clicking anywhere on the pool's row.

Step 3: Add Liquidity

After selecting a pool, you will be taken to a control panel for that specific liquidity pool, where you can add liquidity to the token pair and view more detailed .

When you set the amount for one token, the corresponding amount for the other token is automatically calculated, as liquidity must be provided in equal value for both tokens.

Clicking the "Max" button will automatically set the amount to your total available balance.

Step 4: Transaction Settings

If you want to adjust slippage, select the Settings icon to open the Transaction Settings panel and set your desired tolerance. The default slippage tolerance for non-stable swap token pairs is set to 4%, meaning your transaction will revert if the exchange rate changes unfavourably by more than this percentage. The displayed number of LP tokens you will receive is approximate due to this potential variation.

Step 5: Confirm Add Liquidity

Step 6: Confirm Transaction

After clicking Confirm, you will need to confirm the transaction in your wallet. Here, your Stacks wallet is interacting with the 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.

To be completely sure, you can check:

  • Transaction is requested by "Alex app" (app.alexlab.co)

Step 7: Wait for Confirmation

You may need to wait between 20-40 minutes for your balance to update in your wallet once it is confirmed on the network.

Recommended to track transaction status:

  • Check your address activity on the wallet.

Step 8: View Added LP Tokens

After successfully adding liquidity, you will be able to see your LP tokens and related details in My Liquidity panel.

  • My LP are your LP token holdings specific to the pool you contributed to. Each pool issues its own unique LP tokens.

  • The Pooled amount represents your total token holdings in the liquidity pool. Initially, reflects the amount you added and it increases over time due to accrued fees, showing your updated share of the pool's total liquidity.

  • The My Pool Share shows how much of the overall pool you own, as a percentage.

  • The Indicative Value reflects the value of your holdings in USD, which can change based on the price action of the underlying assets.

You can find the "My Liquidity" panel above the Liquidity Pool control panel (shown in Step 3). A summarized version is also available under the Swap -> Pool tab or at https://app.alexlab.co/pool.

Step 1: Go to the 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.

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.

Step 3: Go to Remove Liquidity

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

Step 4: Enter Amount to Remove

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 the 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.

Step 5: Confirm Remove Liquidity

Step 6: Confirm Transaction

After clicking Confirm, you will need to confirm the transaction in your wallet. Here, your Stacks wallet is interacting with the 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.

Step 7: Wait for Confirmation

You may need to wait between 20-40 minutes for your balance to update in your wallet once it is confirmed on the network.

Recommended to track transaction status:

  • Check your address activity on the wallet.

Step 8: View Changes

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.

Selected STX-ALEX liquidity pool as example.

Need tokens? Visit the docs section and to learn how to exchange tokens on ALEX Lab platform.

Control panel example for STX-ALEX liquidity pool. Amount is set to 4 STX and ALEX token amount is automatically determined.
Transaction Settings icon.
Transaction Settings panel example, with slippage tolerance set to 3%.

One you decide the amount, click the Add button. A confirmation panel will appear. Here, you can double check balances, slippage and LP tokens. If everything is okay, click Confirm

The amounts you will transfer to the smart contract, covered by . Note that one transfer amount is exactly determined (STX in the example) while the other is subject to a "less than or equal to" condition. This accounts the potential slippage variation, and here you can see the exact upper bound. If these conditions are not met, the transaction will abort.

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

Search for the transaction on the .

"My Liquidity" panel.

Removing liquidity

As when adding liquidity, go to and click on navbar's Swap -> Pool tab.

The pools where you are providing liquidity are displayed here. There is only one in this example.
STX-ALEX pool selection.
Example of removing all liquidity; the amount matches the LP token balance.

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

Function arguments and confirmation button.

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

Search for the transaction on the .

🐋
🧑‍🏫
😎
🫳
💰
😎
Token Swaps
Stacks post conditions
Telegram notifications
ALEX Explorer
https://app.alexlab.co/
Telegram notifications
ALEX Explorer
🫴
💰
Impermanent Loss
https://app.alexlab.co/
Amounts to transfer and post conditions.
Function arguments and confirmation button.
Telegram message with transaction pending status.
Telegram message with transaction success status.
Transaction pending displayed on Leather wallet.
Transaction completed, token transfers are visible.
Telegram message with transaction pending status.
Telegram message with transaction success status.
Transaction pending displayed on Leather wallet.
Transaction completed, token transfers are visible.