# DEX(Swap/LP Pool)

<figure><img src="/files/rMwfm9yY5pjq6meL3Ryi" alt=""><figcaption></figcaption></figure>

## 🌊 The Liquidity Pool service is now live on Dexlab

Now, you can become a liquidity provider on Dexlab by depositing assets into a pool and facilitating SWAP trades on DEXs and AMMs.

<https://v3.dexlab.space/pools>

## Adding Liquidity on Pool

<figure><img src="/files/Mz5KFrR1PnL7ubjqEDQQ" alt=""><figcaption></figcaption></figure>

&#x20;\*Note that this pool is on the devnet and used for tutorial usage.

1. Enter the amount of Token A
2. Token B amount will be automatically calculated
3. Click Add liquidity
4. Check the transaction process on the left-down corner. It may show a checkmark after transaction success

{% hint style="info" %}
**Terminology**<br>

* LP token: $mockDXL/$mockUSDP
* Fee Tier: The percentage of the transaction goes to the pool as a transaction fee
* $mockDXL and $mockUSDP amount: current amount in the pool
* LP supply: LP token amount ($mockDXL/$mockUSDP)
* Address
  * Pool ID
  * $mockDXL mint address
  * $mockUSDP mint address
  * LP token mint address
* Current Price: Can switch pair by arrow
* mockUSDP Price: $mockDXL per $mockUSDP amount
* mockDXL Price: $mockUSDP per $mockDXL amount
* TVL: Total Valued Locked. Total Liquidity Value
  {% endhint %}

<br>

## Withdrawing Liquidity from Pool

<figure><img src="/files/ANSzhtnW7v8lOFolCNHe" alt=""><figcaption></figcaption></figure>

1. Click Withdraw
2. Type down the amount of LP token that you want to withdraw
3. Check the transaction process on the left-down corner. It may show a checkmark after transaction success

{% hint style="info" %}
**Terminology**<br>

* LP Address: LP token mint address
* Total LP supply: LP token amount ($mockDXL/$mockUSDP)
* My LP Amount: Amount of my LP token ($mockDXL/$mockUSDP)
* Mint A Amount: Current amount of $mockDXL in the pool
* Mint B Amount: Current amount of $mockUSDP in the pool
  {% endhint %}

<figure><img src="/files/CJPB4B1WLURO9G7zFZoP" alt=""><figcaption></figcaption></figure>

* If the withdrawal went successfully, click the refresh button and you may see the LP token details are gone

## Pool Driven SWAP

<figure><img src="/files/kpXhpZgEfm9I9b0fBebI" alt=""><figcaption></figcaption></figure>

1. Type down the amount of the token you want to swap
2. The paired token amount will automatically typed down
3. Click SWAP and check the wallet pop-up window
4. You may see the amount of the token differentiated after the SWAP

## Creating Pool

<figure><img src="/files/BQ21gxYzy3Ed9wYL1Gzx" alt=""><figcaption></figcaption></figure>

* Click 'Create Pool'

<figure><img src="/files/aSJP6uxIYZsxeGNkTrj5" alt=""><figcaption></figcaption></figure>

1. Select the Token A and Token B for the pool you want to make
2. Select the Fee Tier from 0.1% to 2%.

{% hint style="info" %}
**Fee Tier**

* The selected percentage from the transaction will be added to the pool as a transaction fee
  {% endhint %}

3. Type down the initial price for the token pair. I choose 1 $mockDXL = 1 $mockUSDP
4. Type down the deposit amount of the Token A on the right. Token B amount will be automatically typed down after calculation.
5. Click Create Pool to proceed

## Permanent LP Lock

<figure><img src="/files/gvzaYZxUHmTW34Qfn4Wl" alt=""><figcaption></figcaption></figure>

* After adding the liquidity to the pool, you may see the 'Permanent Lock' button after refreshing the page

<figure><img src="/files/6kdwBYrBBXKi2sQRclBs" alt=""><figcaption></figcaption></figure>

* Type down the amount of LP token that you want to lock
* Read the notice and click the checkbox to confirm
* Click the 'Permanent Lock' button to proceed

<figure><img src="/files/zIrfQBai9As0ssruBltu" alt=""><figcaption></figcaption></figure>

* After locking the LP, you may see the number changed on 'My LP Amount'


---

# 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.dexlab.space/products/dex-swap-lp-pool.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.
