> For the complete documentation index, see [llms.txt](https://docs.increment.fi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.increment.fi/protocols/decentralized-exchange/stableswap-dex/introduction.md).

# Introduction

Stableswap is a type of amm algorithm that offers low slippage trading for two assets that are **highly correlated** in nature. For exmaple, it is very suitable for pairs like `USDC<>FUSD` and `stFlow<>Flow`.&#x20;

The algorithm we're using is solidly stableswap algorithm, a CFMM with the invariant:

$$
x^3 y + x y^3 >= K
$$

It's simple and elegant, doesn't consume a lot of onchain computation units comparing with other complex stableswap algorithms, yet it provides a much smaller slippage than the cpamm dex, and  enables more capital efficiency with the same amount of liquidity.&#x20;

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

The original solidly stableswap curve works well for "hard" pegged assets, for example, stablecoins USDC/USDT/FUSD, or different version of bridged BTC like ceWBTC/whWBTC et al., but it's still subject to arbitrages for liquid staking assets (`stFlow`) - as stFlow's value (against flow) increases over time due to the auto-compounding of staking rewards.&#x20;

To make it more suitable for liquid staking pairs, we've extended the original solidly stableswap algorithm further, which we call it "weighted-solidly-stableswap-curve", i.e.:.

$$
(px)^3y +(px)y^3 >= K; s.t.: p = stFlow/Flow
$$

Where `p` is the weight and taken from Liquid Staking smart contracts directly. After each epoch advancement, it'll increase value and then the bonding curve will be adjusted a little bit automatically.

<figure><img src="/files/81CDRq3ZaKsH5Xs1cMaH" alt=""><figcaption></figcaption></figure>
