> For the complete documentation index, see [llms.txt](https://artichoke.gitbook.io/abstract/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://artichoke.gitbook.io/abstract/single-sided-lp-mechanics/staking-and-impermanent-loss.md).

# Staking & Impermanent Loss

One of the main issues with liquidity providing on an LP is impermanent loss. IL is the loss incurred by a market making position vs. keeping the initially allocated amounts fixed. Another approach of IL could be referred as unrealized profit or loss (**uPNL**): this a more accurate way to call such profit or loss, as it only becomes realized if one chooses to sell out of a position which has changed in value.

Given an initial price $$P\_0$$, the value of $$P\_0$$ of a 2-asset portfolio is initially given by:

$$V = V\_0 + P\_0 \cdot y$$

On the other hand, a new value $$V\_1$$ after the first transactions $$P\_1$$ is given by:

$$V\_1 = x' + P\_1 \cdot y'$$

Given a new value and new prices, the equation will still be the following:

$$x+ P\_1 \cdot y$$

The **IL** or **uIL** is the delta between the portfolio change of the market making portfolio and the change in value of a portfolio of assets with fixed quantities. This is the loss on top of a mark to market move of an equivalent fixed-quantity portfolio:

$$x' + P\_1 \cdot y' - (x + P\_0 \cdot y) - (x + P\_1 \cdot y - (x + P\_0 \cdot y))$$

Which simplifies to:

$$x' - x + P\_1 \cdot y' - P\_0 \cdot y - (P\_1 - P\_0) \cdot y$$

Also, we will call $$R$$ the ratio between the current and previous price given a fixed-period of time $$t$$:&#x20;

$$R = \frac{P\_1}{P\_0}$$

Hence, unrealized impermanent loss $$\epsilon$$ will be given by the following equation:

$$\epsilon = \frac{uPNL}{V\_0} = \sqrt{R} - \frac{1}{2} \cdot (R+1)$$


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://artichoke.gitbook.io/abstract/single-sided-lp-mechanics/staking-and-impermanent-loss.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
