> For the complete documentation index, see [llms.txt](https://fluxswap.gitbook.io/home/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fluxswap.gitbook.io/home/features/swap.md).

# Swap

FluxSwap provides users a simple way to swap tokens on Fuse network via automated liquidity pools. In a swap, one token is sold to buy another token. The rate of the swap is determined by the AMM with the equation:

$$
x \* y = k
$$

Where *x* = the number of $AAA tokens, *y* = the number of $BBB tokens, and *k* is a constant. The trader is charged a 0.3% fee to make a swap.

![Figure 1. Example of a swap on FluxSwap.](https://4154754380-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FM2p8rAkJ6cN4hCyXKifY%2Fuploads%2FkL62eR18zHXwQ18UEMxF%2FUntitled%20Document.png?alt=media\&token=ceab4fc3-72dc-472b-9b30-95436b5cb77b)

In Figure 1, a trader is swapping $AAA token for $BBB tokens. The trader sends 100 $AAA tokens to the AMM. A 0.3% fee is applied and 0.3 $AAA tokens are not included in the swap. The remaining 99.7 $AAA tokens are swapped in the AMM to $BBB tokens. Since the AMM will be losing $BBB tokens, it must gain $AAA tokens to keep *k* constant. The equation:

$$
(1,000+99.7) ∗ (10−y)=10,000
$$

Can be solved for *y* to give the number of $BBB tokens that the trader will receive. The 0.3% fee of 0.3 $AAA tokens is directly added to the liquidity pool reserves, slightly increasing the value of *k.*
