# Swap

## **1. Swap Buy/Sell - Miniapp version**

### **Accessing the Swap Tab**

1. Open the [**FlashX Miniapp Bot**](https://t.me/@FlashXAIBot) in Telegram.
2. Navigate to the **Market** tab to browse trending tokens.
3. Search for a token by **symbol or contract address** to find specific assets.
4. Select a token to swap instantly.

### **Entering the Trade Amount**

* Input the amount of tokens you wish to **buy or sell** in the **Amount** box.
* Quick selection options (e.g., **0.01, 0.02, 0.05**) allow fast trading.
* You can customize the **Buy amount preset** in the **Settings** menu.

<figure><img src="https://255202137-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGrKCsbwHY7eBHNpSiC%2Fuploads%2FXVYy3UK8Xfya0S9yH8WZ%2FIMG_2649.jpg?alt=media&#x26;token=1e7e410c-8c53-48c2-8cf8-e428c6b1e5b1" alt="" width="375"><figcaption></figcaption></figure>

### **Selecting Buy/Sell Mode**

* Toggle between **Buy Mode** and **Sell Mode** using the buttons on the right:
  * **Buy Mode** → Purchase tokens.
  * **Sell Mode** → Sell your tokens.

### **Trading Fee**

* **Without a referral:** 1% fee per trade by trading volume.
* **With a referral:** 0.85% fee per trade by trading volume.

### **Adjusting Trade Settings**

<figure><img src="https://255202137-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGrKCsbwHY7eBHNpSiC%2Fuploads%2FHUYdsVL3T9jPwtOGVWO9%2FScreenshot%202025-02-14%20at%2016.22.28.jpeg?alt=media&#x26;token=f92eb579-94b0-4508-84db-f4c1c86e83f0" alt="" width="375"><figcaption></figcaption></figure>

#### **Priority Fee**

* The **Priority Fee** determines the **transaction speed** by prioritizing your trade on the blockchain.
* Set an appropriate fee to ensure fast processing.

#### **Slippage Control**

* Define a **slippage percentage** to limit the maximum price variation between expected and executed prices.
* FlashX automatically adjusts for the best possible slippage within your limit.

#### **Transaction Fees**

* **Gas Fee** is displayed before confirming the transaction.
* You can adjust gas settings to optimize transaction costs.

### **Executing the Trade**

* After configuring all settings and entering the desired amount:
  * Tap **"BUY "** to purchase.
  * Tap **"SELL"** to sell.

## **2. Swap Buy/Sell - Extension version**

### Buy/Sell

The **Buy/Sell** feature in the **Swap** tab of FlashX enables users to easily purchase or sell tokens.&#x20;

#### **How to Use the Buy/Sell Feature in Swap Tab**

<figure><img src="https://255202137-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGrKCsbwHY7eBHNpSiC%2Fuploads%2FLDhmV1HEuiszQYRSaKqf%2FScreenshot%202025-01-10%20at%2014.20.09.png?alt=media&#x26;token=152573f0-3525-4858-9a2b-31520e0051d9" alt="" width="375"><figcaption></figcaption></figure>

1. **Access the Swap Tab**:
   * Open FlashX and navigate to the **Swap** tab where you will find the **Buy/Sell** option.
2. **Select the Token**:
   * In the **Buy Mode** section, the **token** you want to purchase (or sell) will be displayed. You can search for a token by typing its name or address into the **Search token address/name** field.
3. **Enter the Amount**:
   * To buy or sell tokens, enter the amount you want to trade in the **Amount** box.
   * You will also see quick options like **0.01**, **0.02**, **0.05**, etc., allowing you to easily select predefined amounts.
4. **Select Buy/Sell Mode**:
   * You can toggle between **Buy Mode** and **Sell Mode** using the buttons at the top of the panel.
     * **Buy Mode**: Allows you to purchase tokens.
     * **Sell Mode**: Allows you to sell tokens.
5. **Priority Fee**:
   * The **Priority Fee** is displayed under the **Total Fund**. It determines the transaction speed by prioritizing your trade in the blockchain network. Set an appropriate fee to ensure that your transaction is processed quickly.
6. **Slippage**:
   * You can set the **slippage** percentage to control the maximum price difference you’re willing to accept between the expected and final execution price. FlashX will automatically adjust to optimize the best slippage within your set limit.
7. **Transaction Fees**:
   * **Gas Fee**: The **gas fee** is shown, which is required for the transaction to be processed on the blockchain. You can adjust settings to manage this.
8. **Execute Trade**:
   * Once all settings are configured and the **amount** is entered, click the **"BUY \[Token]"** button to purchase the token.
   * For selling tokens, the **"SELL \[Token]"** button will be available.

### Limit order

The **Limit Order** feature on FlashX allows users to set buy or sell orders at a specific price, which will only be executed once the market reaches that price.&#x20;

#### **How to Use Limit Order on FlashX**

<figure><img src="https://255202137-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGrKCsbwHY7eBHNpSiC%2Fuploads%2FqrxU3CheextrALW6cscd%2FScreenshot%202024-11-23%20at%2023.21.21.png?alt=media&#x26;token=6d208ac5-6a86-4b29-986d-1039a56ecc98" alt="" width="375"><figcaption></figcaption></figure>

1. **Access the Limit Order Tab**:
   * In the **Swap** section, click on the **Limit Order** button to switch to the Limit Order mode.
2. **Select Buy or Sell Mode**:
   * You can toggle between **Buy Mode** and **Sell Mode** depending on whether you want to buy or sell the token.
   * **Buy Mode**: Enter the amount of tokens you want to buy.
   * **Sell Mode**: Enter the amount of tokens you want to sell.
3. **Set the Amount**:
   * In the **Amount** field, input the number of tokens you want to trade. You can use the predefined quick selection options (**0.01**, **0.02**, **0.05**, etc.) or manually input a custom amount.
4. **Set the Price**:
   * Under the **Price** field, set the price at which you wish to buy or sell the token. This is the limit price for your order. The order will only be executed when the token reaches this price.
   * You can refresh the price using the **refresh icon** next to the price to get the latest price before setting your limit order.
5. **Set Slippage**:
   * Adjust the **Slippage** slider to determine the maximum price deviation you're willing to accept when executing your order. A higher slippage tolerance may result in faster execution, but could also lead to higher costs if the market moves unfavorably.
6. **Expiration**:
   * **Expire**: Set the expiration time for your order. For example, you can choose 1 day or a custom timeframe. The order will be canceled if it is not executed within the specified time.
7. **Gas Fee**:
   * The **Gas Fee** required for processing the order will be displayed. Ensure that you have enough funds in your wallet to cover the transaction fees.
8. **Place the Order**:
   * Once you've set the amount, price, slippage, and expiration time, click the **"BUY \[Token]"** or **"SELL \[Token]"** button to place your limit order.

### **Dollar-Cost Averaging (DCA)**&#x20;

Dollar-Cost Averaging (DCA) is a strategy that allows users to invest a fixed amount in a token at regular intervals, regardless of the token's price.&#x20;

#### **How to Use DCA on FlashX**

<figure><img src="https://255202137-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0tGrKCsbwHY7eBHNpSiC%2Fuploads%2FGvfRtiHoBkHdszZflAyj%2FScreenshot%202024-11-23%20at%2023.23.09.png?alt=media&#x26;token=15d125f2-94f4-4e46-b0d3-b3bf47f9a946" alt="" width="375"><figcaption></figcaption></figure>

1. **Access the DCA Tab**:
   * In the **Swap** section, click on the **DCA** button to switch to the **Dollar-Cost Averaging** mode.
2. **Choose Buy Mode**:
   * Select **Buy Mode** to set up your DCA strategy and purchase the token at regular intervals.
3. **Set the Minimum and Maximum Price**:
   * **Min Price**: Enter the minimum price at which you want to buy the token. The DCA system will only buy when the token price reaches or falls below this amount.
   * **Max Price**: Enter the maximum price at which you are willing to purchase the token. The DCA system will not buy if the token price exceeds this value.
4. **Set the Interval**:
   * Choose the interval at which the DCA system will execute your buy orders. You can select the interval in **days (D)**, weeks (**W**), or months (**M**).
   * For example, you can choose **1 day** if you want to buy the token every day at the specified price range.
5. **Set the Duration**:
   * **Duration**: This is the total length of time the DCA strategy will run. Choose the duration in days, weeks, or months depending on your investment plan.
   * For example, you can set the duration to **1 week** to run the DCA strategy for a week.
6. **Set the Buy Amount for Each Interval**:
   * In the **Buy Amount Each Interval** field, enter the amount of tokens you want to buy at each interval. This amount will be automatically invested at the price range you’ve set.
7. **Execute the DCA Strategy**:
   * Once you’ve configured all the settings, click the **"BUY \[Token]"** button to start your DCA strategy.
   * Your purchases will be automatically executed based on the price fluctuations and intervals you've set.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.flashx.ai/swap.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
