> For the complete documentation index, see [llms.txt](https://docs.yfx.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.yfx.com/yfx-v4/trading/trading-mechanism.md).

# Trading Mechanism

> **PvPool (PvP)** trading mechanism was first introduced by YFX V1 in 2021, allowing traders and liquidity pools to trade directly. Now, it has been widely adopted by most major perpetual protocols. In YFX V4, liquidity pools are still holding single assets but divided to multiple pools depending on trading pairs.  &#x20;

&#x20;All traders' orders are settled with fund pools. A trader's profit from perpetual contract trading is a fund pool's loss, and vice versa. If a trader makes a profit trading perpetual contracts, the profit will be taken from an LP fund pool; if a trader suffers a loss trading perpetual contracts, the loss will be given to an LP fund pool.&#x20;

A liquidity provider only needs to buy YLP (w/ or w/o leverage) to participate in market making. When a liquidity provider wants to withdraw funds from a fund pool, if the net value of the fund pool is greater than the net value of the fund pool when they deposit funds to the fund pool, they will make a profit. Otherwise, they will suffer a loss. A liquidity provider suffers no impermanent loss for adding or removing funds to or from a fund pool.&#x20;


---

# 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://docs.yfx.com/yfx-v4/trading/trading-mechanism.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.
