# Swap

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

Unchain X swap operates on an AMM-based protocol, utilizing the CPMM (Constant Product Market Makers) function.

CPMM(x\*y=k)

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

## Fee rewards

When a user swaps tokens through Unchain X, transaction fee rewards are distributed proportionally to all liquidity within the range at the time of the swap. Liquidity that falls outside the position range no longer remains active, and no fee rewards are incurred. If the spot price reverses and re-enters the position range, liquidity is reactivated, and fee rewards are incurred. Additionally, fees are not automatically reinvested.

## Slippage

Slippage is a term used to describe the potential change in a specific price while a submitted transaction is pending.

When transactions are submitted to the BSC, the order of execution is determined by the amount of "gas" provided as fees for each transaction execution. Transactions with higher provided fees are executed more quickly. Transactions with lower gas fees are kept pending for a certain period. During this period, the price environment for final execution of the transaction changes due to other swaps occurring.

Slippage tolerance sets the margin of change that users can accept beyond the price impact. If the execution price exceeds the allowed slippage range, the transaction fails, and the swap does not occur.


---

# 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.unchainx.io/product/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.
