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

# Pricing Mechanism

In YFX V3, we introduced a mechanism for comparing on-chain oracle prices with ChainLink to prevent failures with our Oracle. In the product design of YFX V4, we have made further optimizations by introducing real-time prices from two leading oracle products in the market, [ChainLink](https://chain.link/) and [PYTH](https://pyth.network/), as the index price for YFX, ensuring the fairness and openness of the index price.

## ChainLink solution

We have adopted ChainLink's [DataStream](https://chain.link/data-streams) and [Automation](https://chain.link/automation) to execute market orders and judge whether limit orders, take-profit, stop-loss, and forced liquidation are triggered.

## PYTH solution

We accept real-time prices published by PYTH and use PYTH's official contract to verify signatures. [PYTH Price Feeds](https://pyth.network/price-feeds)

Through collaboration with ChainLink and PYTH, YFX has thoroughly resolved the issue of the openness and fairness of index prices, making trading more equitable. Anyone can verify that YFX's index price sources are from ChainLink or PYTH.


---

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