> 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/related-pricing.md).

# Related Pricing

As every economic system, the price will be determined by supply and demand. In our particular case scenario, prices of tokens in an LP are determined by the supply of the tokens, i.e., the amounts of reserves of the tokens that the pool is holding. Token prices are simply relations of reserves:

$$P\_x = \frac{y}{x} ; P\_y = \frac{x}{y}$$

Where $$P\_x$$ and $$P\_y$$ are prices of tokens in terms of the other token. Such prices are called spot prices and they only reflect current market prices. Howe- ver, the actual price of a trade is calculated differently as high demand increases price. We want the price to be high when demand is high, and we can use pool reserves to measure the demand: the more tokens you want to remove from an LP, the higher the impact of demand is. Mathematically:

$$\Delta y = \frac{(y \cdot \Delta x)}{(x + \Delta x)}$$

$$\Delta x = \frac{x \cdot y}{y - \Delta y)}$$


---

# 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/related-pricing.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.
