> For the complete documentation index, see [llms.txt](https://voyage.gitbook.io/voyage/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://voyage.gitbook.io/voyage/staking-and-tokenomics/formulas.md).

# Formulas

Curve Finance utilizes a **StableSwap invariant** to facilitate efficient stablecoin trading with low slippage. The invariant ensures that the pool remains balanced.

**Formula:**

$$
A \cdot n \cdot \sum\_{i=1}^{n} x\_i + D = A \cdot D + \frac{D^{n+1}}{n^n \cdot \prod\_{i=1}^{n} x\_i}
$$

**Components**

* ***A*****:** Amplification coefficient, controlling the sensitivity of the invariant to price changes.
* ***n*****:** Number of tokens in the pool.
* ***x\_i*****:** Balance of the iᵗʰ asset in the pool.
* ***D*****:** Total supply of liquidity tokens, representing the combined assets in the pool.

Uniswap V2 operates on the **Constant Product Market Maker (CPMM)** model, ensuring that the product of the reserves of the two assets remains constant.

**Formula:**

$$
x \cdot y = k
$$

**Components**

* ***x*****:** Reserve of Token X in the liquidity pool.
* ***y*****:** Reserve of Token Y in the liquidity pool.
* ***k*****:** Constant product, remains unchanged before and after any trade.

Uniswap V3 introduces **Concentrated Liquidity**, allowing liquidity providers to allocate their capital within specific price ranges, enhancing capital efficiency.

**Formula**

The core formula related to liquidity in a given price range is:

$$
L = \frac{\sqrt{P\_{\text{high}}} \cdot \sqrt{P\_{\text{low}}}}{P\_{\text{high}} - P\_{\text{low}}}
$$

**Components**

* ***L*****:** Liquidity provided within the specified price range.
* ***P*****\_*****high*****:** Upper price bound of the liquidity range.
* ***P*****\_*****low​*****:** Lower price bound of the liquidity range.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://voyage.gitbook.io/voyage/staking-and-tokenomics/formulas.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.
