# Swap Slippage

The swap slippage is given by:

$$
S\_{i \rightarrow j} = S\_i + (-S\_j) = S\_i - S\_j
$$

and

$$
S\_i = \dfrac{g(r'\_i) - g(r\_i)}{r'\_i - r\_i}
$$

$$
r'\_i   +    r\_i
$$

where <img src="/files/Igz2KkE32RN1iOnxw8i4" alt="" data-size="line"> is the original coverage and<img src="/files/eWaJWBxt5MQaFRlRuZW3" alt="" data-size="line">  is the final coverage.

If the swap amount is small, the slippage can be give by

$$
S\_{i \rightarrow j} = g'(r\_i) - g'(r'\_i)
$$

###

### Practical example of slippage calculation

We take the coverage ratio of USDT at 0.909 and ETH at 1.033. Working this out, we’d get:

#### USDT:

$$
g'(0.909) = -\dfrac{0.00002\*7}{0.909^8} = 0.03%
$$

#### ETH:

$$
g'(1.033) = -\dfrac{0.00002\*7}{1.033^8} = 0.01%
$$

Hence we have

$$
S\_{USDT \rightarrow ETH} = 0.03% - 0.01% = 0.02%
$$

This represents the marginal slippage when someone is performing a small amount of swap at this coverage ratio. And yes, the slippage is positive and user can benefit from the swap!


---

# 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://hummus-exchange.gitbook.io/hummus-exchange/concepts/swap-slippage.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.
