ALEX Lab Foundation Docs
Go to App
  • ALEX Lab
  • What is New?
    • 🕺Permissionless Pool Creation
  • Getting Started
    • 👛Connect Your Wallet
    • 👥Join the Community
    • 🪙Buy ALEX Tokens
  • What Can You Do?
    • 🔥Bitcoin Swaps
      • 💡Key Concepts
      • 🧑‍🏫How to Swap
      • ❓FAQs
    • 🔄Stacks Swaps
      • 💡Key Concepts
      • 📖How to Swap
      • ❓FAQs
    • 🐋Liquidity Pools
      • 💡Key Concepts
      • ↘️How to Add Liquidity
      • ↖️How to Remove Liquidity
      • ❓FAQs
    • 🌾Farming
      • 💡Key Concepts
      • ↘️How to Farm
      • ↖️How to Harvest
      • ❓FAQs
    • ⚓Stake
      • 💡Key Concepts
      • ↘️How to Stake
      • ↖️How to Harvest
      • 💧How to Liquid Stake
      • ❓FAQs
    • 🚀Launchpad
      • 🚀Join the ALEX Launchpad!
    • ⚡Surge
      • 💡Key concepts
      • 🧑‍🏫How to participate
      • ❓FAQs
  • What Can You Do as a Project Owner?
    • 🚀Launch Your Project
    • 📝Create Your Own Pool
    • 🧑‍🌾Add Farming to Your Pool
  • Security
    • ✅Audits
    • 🐛Bug Bounties
  • Helpful Concepts
    • 💰Tokenomics
    • 👥ALEX DAO
    • 💱ALEX AMM
    • 🏋️ALEX APower
  • Resources
    • 🔗Official Links
    • 📃Whitepapers
      • 📃Automated Market Making of the Yield Token Pool
      • 📃Automated Market Making of the Collateral Rebalancing Pool
      • 📃Diving into Collateral Rebalancing Pools!
Powered by GitBook
On this page
  • Trade One Token for Another
  • Step 1: Head to the Stacks Swap Page
  • Step 2: Select Token Pair
  • Step 3: Check Transaction Details
  • Step 4: Confirm the Swap
  • Step 5: Confirm the Transaction in Your Wallet
  • Step 6: Wait for Transaction Confirmation
  • Step 7: Check the Updated Balance

Was this helpful?

Edit on GitHub
  1. What Can You Do?
  2. Stacks Swaps

How to Swap

This guide will showcase how to swap two tokens on ALEX Lab App.

PreviousKey ConceptsNextFAQs

Last updated 2 months ago

Was this helpful?

When performing a token swap, you transfer an amount of the token you want to exchange (base token) to the ALEX smart contract. In return, you receive a pre-agreed amount of the desired token (target token) from the ALEX smart contract, all within a single swap transaction. The resulting balance changes will be reflected in your wallet.

That said, let's get hands-on!

Trade One Token for Another

Step 1: Head to the Stacks Swap Page

Go to to see the Swap panel. You can also navigate to it by clicking the "Swap" tab on the top menu bar.

Step 2: Select Token Pair

Select the tokens you want to exchange and the amount.

  • The token at the top is the base token, the token you currently hold and want to exchange.

  • The token below is the quoted or target token, the token you will receive in the trade.

  • The dropdown arrow next to the token symbol will open the token search and selection panel.

  • Below the amounts, you will find the current exchange rate, as well as the USD equivalent.

  • The central down-pointing arrow shows the direction of the transaction. In the below example, STX will be exchanged for ALEX. By clicking the arrow, you can quickly invert the order of the transaction: the base token becomes the quoted token and vice versa.

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

Step 3: Check Transaction Details

Transaction Details

Check the transaction details by clicking the dropdown "Details" arrow below the amounts. This will expand a Details panel with relevant trading information.

  • Route: The exchange route to convert from the base token into the target token. In the example we see STX -> ALEX, indicating it is a one-step or direct swap.

  • Liquidity Provider Fee: The swap fee, which is shared between the Liquidity Providers (LPs) and the ALEX Lab Platform.

  • Price Impact: How much your swap affects the exchange rate.

  • Slippage Tolerance: The maximum percentage of price movement you'll accept between the time you submit the transaction and its execution. The default slippage tolerance setting is 4%, but you can select a custom percentage. If price movement exceeds the slippage tolerance, the transaction will be reverted.

  • Minimum Received: The minimum amount of target token you will receive considering the maximum slippage variation.

Transaction Settings

If you want to adjust slippage tolerance, select the "Settings" icon to open the Transaction Settings panel. Set your desired tolerance and click "Confirm". This will determine your allowed range for price movement. Your transaction will revert if the price changes unfavourably by more than this percentage.

Step 4: Confirm the Swap

Once you're ready to move ahead, select the Swap button which will bring up the Confirmation panel. This panel provides a final overview of your transaction details, allowing you to double-check price, route, fees and slippage. If everything looks good, click "Confirm" 😎.

Step 5: 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.

To be completely sure, you can check:

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

    • The amount you transfer to the smart contract is exactly determined (STX in the example).

    • The amount the smart contract transfers to you (ALEX in the example) is subject to an "equal to or greater than" condition. This accounts the potential slippage variation, and here you can see the exact lower bound.

Step 6: Wait for Transaction Confirmation

Wait for the transaction to be confirmed on the network.

Recommended to track transaction status:

  • Check your address activity on the wallet.

Step 7: Check the Updated Balance

Once the transaction is completed, you will see the balance updated in your wallet.

The transfer amounts, covered by . If these conditions are not met, the transaction will abort. Note:

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

Search for the transaction on the .

Thank you for successfully swapping on ALEX!

🔄
📖
✅
Stacks post conditions
Telegram notifications
ALEX Explorer
💱
💰
https://app.alexlab.co/
Example of the Swap panel displaying exchange of 5 STX into ALEX governance tokens.
Token search and selection panel.
Swap panel with Transaction Details panel expanded.
Transaction Settings icon.
Transaction Settings panel example, with slippage tolerance set to 2%.
Transfer amounts involved 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.