# Background: AMM & IL

Automated Market Making (AMM) is one of the key mechanisms in the decentralized finance (DeFi) field. By serving as liquidity providers in decentralized exchanges (DEX), investors may earn protocol incentives: swap fees and liquidity mining rewards.

However, there will be no profit without risks. The nightmare of serving as a liquidity provider would be Impermanent Loss (IL). As its name, IL is the temporary loss because the price deviates from its entry price. IL is generally defined as the **capital discrepancy between serving as a liquidity provider and simply holding assets at hand**. IL is impermanent because IL will disappear when the price of paired assets returns to its entry price. Nevertheless, most of the cryptocurrencies fluctuate all the time, so there will be IL almost everywhen.

Furthermore, IL exists whether the price of assets rise or fall as we can see in the following chart:

![Source: https://tokentuesdays.substack.com/p/eliminating-impermanent-loss](https://lh4.googleusercontent.com/2Sevjx0VOVrYTkSqwhtcC8JpynEF_3rnMIK76G9LTaGQHswUr_erCsxOV-DmpfB_qLijRTlv52by_CpppeMJolNfdNvgvvUnJYM2LBx5BLkpH94jJmG-PvLsH8IUGFbCLXPkXfMS)

The impermanent loss would cause liquidity providers to lose more when the price falls, and gain less when the price rises.

![](https://4196414977-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MQNETCwx08rZueTzj3I%2F-MRPBOfCOpUdbWWoj5gb%2F-MRPCpkjSm-m2E5Tiy6H%2Fimage.png?alt=media\&token=0411a672-abb8-48a1-b350-dae7ee87b732)

IL is determined by **the degree of price change** as the formula below:

$$
IL=\frac{\sqrt{r}}{\frac{1}{2}r+\frac{1}{2}}-1
$$

r = rate of price change. r = 1 means there is no price change, which IL = 0.

## Hedge Against the Impermanent Loss

Given that IL being the biggest enemy of liquidity providers, scientists have been working on solving this issue for a long while. Potential solutions including longing or shorting the assets to hedging its fluctuation did not work perfectly by far.

Since we cannot predict future price change, the degree of IL would remain uncertain to us. Where there is uncertainty, there lies room for gambling. A potential hedging approach would be purchasing options with some premium in exchange for **a risk-controlled future**. The options are synthetic, tokenized hedge positions of impermanent loss. We call it impermanent gain.


---

# 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://hakkafinance.gitbook.io/igain/igain-universe/impermanent-loss/background-amm-and-il.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.
