ALEX Lab Foundation Docs
Go to App
  • ALEX Lab
  • What is New?
    • 🕺Permissionless Pool Creation
  • Getting Started
    • 👛Connect Your Wallet
    • 👥Join the Community
  • 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 Bitcoin Swap Panel
  • Step 2: Select Tokens and Amount
  • 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. Bitcoin 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 Bitcoin Swap Panel

Go to to see the Swap panel. You can also navigate to it by clicking the Swap tab on the top menu bar. By default, the Swap section will be set to the Stacks Native Swap. For the Bitcoin Native Swap, select Bitcoin on the slider in the top left corner.

Step 2: Select Tokens and Amount

Select the tokens you want to exchange and enter 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 example below, BTC 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. Bear in mind that some transactions may require intermediate swaps.

  • Swap Slippage: 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 by clicking on the edit button. If price movement exceeds the slippage tolerance, the transaction will be reverted.

  • Liquidity Provider Fee: The portion of the fee that is distributed between the Liquidity Providers (LPs) to incentivize them to continue providing liquidity.

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

  • Minimum Received: The minimum amount of target token you will receive considering the maximum slippage variation. For example, if the Swap Slippage is set to the default value of 4% and you expect to receive 100 target tokens, the Minimum Received will be 96 target tokens.

  • Swap Fee: The cost associated with performing a swap, excluding the Liquidity Provider Fee. It is deducted from the base token amount and it is distributed to the ALEX Lab Platform.

Transaction Settings

If you want to adjust the Swap Slippage, select the "Edit" button to the right of the Swap Slippage field to open the Transaction Settings pop up. This will show a Recommended Slippage Tolerance, set at 4%, and an option to Customize the tolerance. 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 Bitcoin 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 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.

You can find more information on the aforementioned fields on the .

Below the Details panel, you will see the Network Fee, which is the amount of tokens paid to the Bitcoin network to incentivize miners to continue validating transactions. You can set your preferred fee with the "edit" button.

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

Search for the transaction on the .

Thank you for successfully swapping on ALEX!

🔥
🧑‍🏫
📝
✅
Key Concepts Section
Telegram notifications
ALEX Explorer
💱
💰
https://app.alexlab.co/
Bitcoin Swap slider
Bitcoin Swap panel
Example of the Bitcoin Swap panel
Token search and selection panel.
Bitcoin Swap panel with Transaction Details panel expanded.
Edit Fee panel
Edit Swap Slippage button
Transaction Settings panel example, with slippage tolerance set to 2%.
Transfer amounts involved and expandable details.
Inputs and outputs and confirmation button.
Telegram message with transaction pending status.
Telegram message with transaction success status.