> For the complete documentation index, see [llms.txt](https://docs.trumpswap.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.trumpswap.io/introduction/how-trumpswap-works.md).

# How TrumpSwap works

**TrumpSwap** is an automated liquidity protocol built on the Uniswap V2 framework, utilizing a <mark style="color:blue;">constant product formula</mark>. Designed to eliminate the need for trusted intermediaries, TrumpSwap emphasizes decentralization, censorship resistance, and security.

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

{% hint style="info" %}

#### Constant product formula[​](https://docs.uniswap.org/contracts/v2/concepts/protocol-overview/glossary#constant-product-formula) <a href="#constant-product-formula" id="constant-product-formula"></a>

The automated market making algorithm used by Uniswap. See [x\*y=k](https://docs.uniswap.org/contracts/v2/concepts/protocol-overview/glossary#x--y--k).
{% endhint %}

Anyone can participate as a liquidity provider (LP) by depositing **Trump47 tokens** along with an equivalent value of another ERC-20 token (**ETH**) into liquidity pools. By doing so, they help facilitate trading and enhance liquidity on the platform. In return for their contributions, LPs receive pool tokens that represent their pro-rata share of the total reserves, allowing them to benefit from trading fees generated by the platform when they decide to redeem their pool tokens.

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

In **TrumpSwap**, liquidity pairs function as automated market makers (AMMs), continuously ready to accept one token in exchange for another while preserving the "<mark style="color:blue;">constant product</mark>" formula. This formula, expressed as <mark style="color:blue;">x×y=k</mark> , ensures that trades do not alter the product (<mark style="color:blue;">k</mark>) of the pair’s reserve balances (<mark style="color:blue;">x</mark> and <mark style="color:blue;">y</mark>). Since <mark style="color:blue;">k</mark> remains constant from the perspective of a trade, it is often referred to as the invariant. This property leads to larger trades (relative to reserves) executing at exponentially worse rates compared to smaller trades.

In practice, TrumpSwap applies a 0.30% fee to trades, which is added to the reserves. Consequently, each trade increases <mark style="color:blue;">k</mark>, functioning as a reward for liquidity providers (LPs). LPs can realize this reward when they burn their pool tokens to withdraw their share of the total reserves.

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

Because the relative price of the two pair assets can only be changed through trading, divergences between the TrumpSwap price and external prices create arbitrage opportunities. This mechanism ensures that TrumpSwap prices always trend toward the market-clearing price.
