> For the complete documentation index, see [llms.txt](https://docs.kyberswap.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kyberswap.com/~/changes/1kQEhDNzHMDf7SwOE6Yu/liquidity-solutions/classic-vs-elastic/draft-technical-comparison.md).

# Technical Comparison

Aggregated Amplified Price Curves

## Elastic vs Classic[​](https://docs.kyberswap.com/overview/motivation#comparison-with-kyberswap-classic): Price curve implementation <a href="#comparison-with-kyberswap-classic" id="comparison-with-kyberswap-classic"></a>

In general, KyberSwap Classic can be represented as follows:

$$
\alpha x\_0 \cdot  \alpha y\_0 = L^2
$$

Where:

* alpha is the amplification factor
* L is the liquidity
* p\_max, p\_min will be the price max, min that KyberSwap Classic can support.

The current price p\_r can be calculated as follows:

$$
p\_{max}=\frac{y'{max}}{x'{min}}=\frac{\alpha ^2}{(\alpha-1)^2} \cdot p\_{r}
$$

$$
p\_{min}=\frac{(\alpha-1)^2}{\alpha^2}\cdot p\_{r}
$$

$$
\Rightarrow p\_r=\sqrt{p\_{max} \cdot p\_{min}}
$$

From the price min, max and liquidity, we can represent the invariant equations of two reserves x,y in a KyberSwap Classic pool as follows:

$$
(x+\frac{L}{\sqrt{p\_{max}}})(y+L \cdot \sqrt{p\_{min}})=L^2
$$

Hence, the representation of KyberSwap Classic can be transformed from the original:

$$
(L,p\_r,\alpha) \Rightarrow \begin{cases}L : Liquidity \p\_{r} : Reference  \quad price \\\alpha : Amplification  \quad factor \\\end{cases}
$$

to a new one:

$$
(L,p\_{max},p\_{min}) \Rightarrow \begin{cases}L : Liquidity \p\_{max} : Max \quad price  \quad supported\p\_{min} : Min  \quad price  \quad supported \\\end{cases}
$$

The following figure illustrates an example of the KyberSwap Classic curve:

![KyberSwap Classic Curve](https://docs.kyberswap.com/assets/images/Kyber-Classic-Curve-5f78b007d617e3290dee6618cbad3cec.png)

### Aggregated KyberSwap Classic[​](https://docs.kyberswap.com/overview/motivation#aggregated-kyberswap-classic) <a href="#aggregated-kyberswap-classic" id="aggregated-kyberswap-classic"></a>

In the early version, KyberSwap Classic allows people to add liquidity in a specific price range. However, this approach has a drawback: the liquidity provider has to add liquidity to a pre-defined range in a pool or create a pool with high gas cost. In KyberSwap Elastic, we want to aggregate different KyberSwap Classic pools into one single pool. In general, two KyberSwap Classic pools can be represented as:

$$
(L\_1,p\_{r\_{1}},\alpha\_1);(L\_2,p\_{r\_{2}},\alpha\_2)
$$

If the two price ranges do not have any overlap range, the combined reserves curve includes two parts. Otherwise, in the overlap price range, the liquidity equal is the sum of liquidity in two positions. Let's take an example when we have:

$$
p\_{max\_1} \geq p\_{max\_2} > p\_{min\_2} \geq p\_{min\_1}
$$

The liquidity in different price ranges are:

$$
(L\_1,p\_{max\_{1}},p\_{max\_{2}})\\(L\_1+L2,p\_{max\_{2}},p\_{min\_{2}})\\(L\_1,p\_{min\_{2}},p\_{min\_{1}})
$$

The following figure illustrates how we aggregate liquidity in the three price ranges, where the blue line show the overlap price range, where the liquidity is the sum of liquidity in two positions.

![Aggregated Liquidity](https://docs.kyberswap.com/assets/images/Aggregated-Liquidity-25383b45f22d03aeb82dd724c90caf24.png)


---

# 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, and the optional `goal` query parameter:

```
GET https://docs.kyberswap.com/~/changes/1kQEhDNzHMDf7SwOE6Yu/liquidity-solutions/classic-vs-elastic/draft-technical-comparison.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
