# Trade

![Swap tokens in an instant 🔄](/files/tuYS1MfYcSjYwgjOcZhl)

### Grabity AMM

Trading is the core feature of Grabity that enables decentralized, non-custodial trades of BEP-20 tokens for everyone. As an automated market maker (AMM), Grabity DEX provides a seamless trading experience based on the constant exchange function:

> For each liquidity pool containing tokenA and tokenB,
>
> *x* \* *y* = *k*
>
> where,
>
> *x* = tokenA balance
>
> *y* = tokenB balance
>
> *k* = constant

Based on the formula above, whenever tokenA is purchased, the price of tokenA increases as the balance of tokenA within the liquidity pool decreases. Conversely, when tokenA is sold, the price of tokenA decreases as the balance of tokenA within the liquidity pool increases. Based on this mechanism, the total value of each token within a pool remains the same. We recommend [this article by Gemini ](https://www.gemini.com/cryptopedia/amm-what-are-automated-market-makers#section-automated-market-maker-variations)for an in-depth analysis of AMMs.

![Add liquidity to receive LP tokens 💧](/files/9B9FcBQswC8pFKA61qOz)

### Liquidity Pools

Trading is only available for token pairs with sufficient liquidity in liquidity pools. Naturally, minimizing slippage for traders relies heavily on maintaining deep liquidity in liquidity pools. To incentivize liquidity providers, a portion of trading fees on Grabity DEX will be directly rewarded to liquidity providers who receive Liquidity Provider (LP) tokens by supplying BEP-20 to liquidity pools. The amount of LP tokens minted to the liquidity provider is proportional to the provider's share of the pool. Out of a trading fee of 0.3% charged to all trades executed on Grabity DEX (excluding the network fee charged by BSC), 0.18% will be rewarded to liquidity providers upon burning their LP tokens to remove their tokens from liquidity pools, and the remaining 0.12% will be sent to the GBT Buy-back Fund. The trading fee and its distribution can be changed in the future through governance votes.


---

# 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.grabity.org/products/trade.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.
