# Quickswap AMM

<figure><img src="https://2710965389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFGRRWa7HgtpySWlkSG6C%2Fuploads%2F0GmtxoCI03NkzweQLrGg%2Fimage.png?alt=media&#x26;token=9ffcd856-c9c7-4ae3-b4dd-a7024a41ad5c" alt=""><figcaption></figcaption></figure>

QuickSwap is an *automated liquidity protocol* powered by a [constant product formula](https://docs.quickswap.exchange/concepts/protocol-overview/04-glossary#constant-product-formula) and implemented in a system of non-upgradeable smart contracts on the [Ethereum](https://ethereum.org/) blockchain. It obviates the need for trusted intermediaries, prioritizing **decentralisation**, **censorship resistance**, and **security**. QuickSwap is **open-source software** licensed under the [GPL](https://en.wikipedia.org/wiki/GNU_General_Public_License).

Each Quickswap smart contract, or pair, manages a liquidity pool made up of reserves of two [ERC-20](https://eips.ethereum.org/EIPS/eip-20) tokens.

Anyone can become a liquidity provider (LP) for a pool by depositing an equivalent value of each underlying token in return for pool tokens. These tokens track pro-rata LP shares of the total reserves, and can be redeemed for the underlying assets at any time.

<figure><img src="https://2710965389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFGRRWa7HgtpySWlkSG6C%2Fuploads%2Fxx7wDDGu9iPMhtJeRqKD%2Fimage.png?alt=media&#x26;token=fd35dad6-87cf-4c3e-a55b-4da38d061e6f" alt=""><figcaption></figcaption></figure>

Pairs act as automated market makers, standing ready to accept one token for the other as long as the “constant product” formula is preserved. This formula, most simply expressed as `x * y = k`, states that trades must not change the product (`k`) of a pair’s reserve balances (`x` and `y`). Because `k` remains unchanged from the reference frame of a trade, it is often referred to as the invariant. This formula has the desirable property that larger trades (relative to reserves) execute at exponentially worse rates than smaller ones.

In practice, QuickSwap applies a 0.30% fee to trades, which is added to reserves. As a result, each trade actually increases `k`. This functions as a payout to LPs, which is realised when they burn their pool tokens to withdraw their portion of total reserves. In the future, this fee may be reduced to 0.25%, with the remaining 0.05% withheld as a protocol-wide charge.

<figure><img src="https://2710965389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFGRRWa7HgtpySWlkSG6C%2Fuploads%2Fa6BscmEWS2m64B39eUll%2Fimage.png?alt=media&#x26;token=fe9cc772-093e-4e20-a57f-6651c56ecac8" alt=""><figcaption></figcaption></figure>

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


---

# 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.quickswap.exchange/overview/quickswap-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.
