# Price Impact and Slippage

## Price Impact and Slippage

When swapping tokens in DeFi,\
the **expected output** and **actual received amount** can differ.

This difference is caused by **Price Impact** and **Slippage** —\
two critical concepts you must understand to **minimize losses and trade efficiently**.

### 1️⃣ What Is Price Impact?

#### Definition

**Price Impact** refers to the **change in token price** during a swap,\
which causes you to receive **fewer tokens** than expected.

#### Why It Happens

In a **Decentralized Exchange (DEX)**, trades follow the\
**Automated Market Maker (AMM)** formula:

> A\_token\_amount × B\_token\_amount = Constant (k)

When someone trades, the pool ratio shifts,\
and the **price automatically adjusts**, affecting subsequent trades.

#### Example

Imagine a pool with A = 10 tokens and B = 100 tokens.\
Initially, 1 A = 10 B.

If you swap 5 A for B, you might expect 50 B —\
but in reality, you’ll get **around 33 B**.

As you add A into the pool, its price relative to B changes upward,\
reducing the amount of B you can receive.

> This difference is known as **Price Impact** —\
> the loss due to pool ratio adjustment.

#### More Liquidity = Less Impact

If another DEX has a much larger pool (A = 1,000 / B = 10,000),\
swapping the same 5 A will yield **nearly 50 B**,\
since the ratio shift is minimal.

> ✅ **Conclusion:**
>
> * Larger liquidity = smaller price movement
> * Trading large amounts in small pools increases loss

***

### 2️⃣ What Is Slippage?

#### Definition

**Slippage** is the **difference between the expected and actual execution price** of a trade.

For example, you click “Swap” expecting to receive **33 B**,\
but before your transaction confirms, another user trades,\
and the pool price shifts — now you only get **16 B**.

That difference is **Slippage**.

#### Why Set Slippage Tolerance?

DEXs allow users to set **slippage tolerance (%)** —\
the maximum deviation you’re willing to accept.

| Situation              | Recommended Setting           |
| ---------------------- | ----------------------------- |
| Highly volatile trades | Higher (to ensure execution)  |
| Regular swaps          | Lower (to prevent overpaying) |

If price movement exceeds your slippage setting,\
the swap **automatically fails** (you only lose a small gas fee).

> ⚠️ **Tip:**
>
> * Too low = failed transactions
> * Too high = risk of poor trade execution

***

### 3️⃣ Price Impact vs Slippage

| Term             | Description                                                      |
| ---------------- | ---------------------------------------------------------------- |
| **Price Impact** | Loss due to **pool ratio change** during the swap                |
| **Slippage**     | Loss due to **market movement between submission and execution** |

### Practical Tips

* Swap in **high-liquidity pools** → less price impact
* Compare **multiple DEXs** → better output rates
* Always check your **slippage tolerance** → prevent failed or costly trades
* Even **0.1% differences compound** over time — pay attention to details

> DeFi swapping seems simple — but small differences create major outcomes.\
> Understanding **Price Impact** and **Slippage** lets you trade **smarter and safer**.


---

# 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://aquabank.gitbook.io/aquabank/en/hello/price-impact-and-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.
