# StableSwap

Macaron supports StableSwap of various trading pairs such as stBTC/BTC.&#x20;

* stBTC is the official Liquid Principal Token (LPT) issued by staking BTC in Lorenzo Protocol, pegged to the value of BTC. It represents the right to claim staked BTC when staking is over. It allows Bitcoin stakers to maintain liquidity while staking, avoiding fragmentation by standardizing stBTC for all low-risk staking plans.

The StableSwap is an implementation of Curve Finance’s AMM on Macaron. It adds linear invariant constant sum curve (x+y=k) on top of the constant product formula (x\*y=k) to keep prices more equal as long as the liquidity pool is not extremely unbalanced. As a result, since StableSwaps are restricted to similarly priced assets, impermanent loss is not as much of a concern (except in extreme depeg cases) and the slippage is lower than normal AMM which just uses the constant product formula.

## How to trade StableSwap?

Trading on the StableSwap is very similar to using the existing MacaronDEX AMM. Before we start, it also requires a Bitlayer mainnet wallet and BNB for gas fees. Please check our [wallet guide](https://docs.bitlayer.org/docs/Build/QuickStart/) for more details.

1 - Go to the Swap page [here](https://www.macaron.xyz/#/stable/swap)

2 - Choose the token pairs you would like to trade. eg, stBTC/BTC

3 - Your all set! The following Swap process is the same as usual! If it’s your first time trading please check the guide [here](https://macaron.gitbook.io/macaron-bitlayers-native-dex/user-tutorial-general).

**Adding & Removing Liquidity**

Adding and removing liquidity for the StableSwap is also very important and similar to the normal MacaronDEX AMM.&#x20;


---

# 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://macaron.gitbook.io/macaron-bitlayers-native-dex/stableswap.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.
