# Smooth Swap

Smoothy implements a simple and efficient swap that supports a long list of assets in the pool. For each token in the pool, it has two swap parameters

* Soft weight - the highest percentage of the token until it becomes unbalanced (imposing penalty);
* Hard weight - the percentage of a token should never exceed, which should be equal to or greater than soft weight.

For any swap that results in percentage changes of the tokens in the pool, as long as the percentages fall into the range of soft weights of the swapped tokens, then 1:1 ratio swap is guaranteed.  Otherwise, a penalty will be imposed for the swap.

**Example A (Swap without Penalty)**: Suppose the pool has 120M USDC / 80M USDT and the soft weights of USDC and USDT are 60%, 60% respectively.  A user can swap 10M USDT for 10M USDC as the resulting percentages of USDC/USDT are \[55%, 45%], which fall into the soft weight range.

**Example B (Swap with Penalty)**:  Suppose the pool has 120M USDC / 80M USDT and the soft weights of USDC and USDT are 60%, 60% respectively.  A user wants to swap 10M USDC for USDT.  However, since the resulting percentage of USDC > 60%, the user will get < 10M USDT.

Note that the penalty fee will be evenly distributed to LPs, in order to compensate them for the risk of holding the excess asset in the (post-swap) pool.

## **Penalty Calculation**

The penalty is using a bonding curve, where the penalty increases (and thus the price of returned token increases) as the percentage of a token increases.

![An example of price increase as the percentage of the token in the pool increases.   ](https://lh4.googleusercontent.com/0KRSbN_ckUFhPj0fSS3ikkHEJp83ol57AtKwRFbF1WSdBjw8X4GOeZgn8JVlgIeBIaEPBJ1VMLcjtkNTfBcqTg_6EiiqyJAqGBOCArZlPRUQ97gXqW8Y-cvKnV83hI5j)

&#x20;The detailed idea behind the bonding curve can be found [here](https://smoothy-finance.medium.com/boding-curve-for-swapping-stablecoins-ec9586b903f2).


---

# 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.smoothy.finance/introduction/simple-swap.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.
