# Automated Market Maker (AMM)

Cropper is an AMM that is built on the Solana blockchain and is completely permissionless.

Its Token Swap Program enables a seamless trading of tokens without a centralized limit order book. The program’s principles are mathematically defined by the following formula to calculate the prices of all executed trades:

$$
x + y = k
$$

Where $$x$$ and $$y$$ are the respective reserves of two assets $$X$$ and$$Y$$ and k is a constant. The price curve aims to mimic normal market dynamics. For example, as traders buy a lot of one token type, the value of the other token types increases.

Depositors in pools provide liquidity for token pairs. This liquidity enables trade execution at the spot price. In exchange for their liquidity, depositors receive liquidity pool (LP) tokens, representing their pro-rata share of the pool. During each trade, a program withholds a portion of the input token as a fee (0.3%). That fee increases the value of pool tokens by being stored in the pool and attributable to LPs.

![Liquidity pool functioning](/files/-Ml9sVaSNzxVvO_ODvbh)

It is important to reiterate that a liquidity pool simply comprises an autonomous smart contract deployed on the relevant blockchain network, operated directly by users calling functions on it (which allows them to interact with other users in a peer-to-peer manner), with no further control by or interaction with the original entity which had deployed the smart contract. Swapping tokens is calling "swap" on a pool contract instance, while providing liquidity is called a "deposit".


---

# 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.cropper.finance/cropperfinance/cropper-v1/automated-market-maker-amm.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.
