# Price Oracles

1001x utilizes a robust and decentralized oracle system to provide accurate and real-time price feeds for trading pairs. This system aggregates data from multiple reputable sources to ensure price integrity and protect users from anomalies.

### **Data Sources**

* **Primary source**: Pyth Oracle’s price feed serves as the anchor
* **Verification**: Prices are cross-verified with Chainlink’s price feed
* **Fallback**: For trading pairs not supported by Pyth Oracle, Binance Oracle is used as a backup

If Pyth Oracle’s price deviates by more than 1% from Chainlink’s price, a circuit breaker is triggered, causing the transaction to fail.

All trading pairs on 1001x use the oracle price of the listed assets as the index price.

### **How Prices are Fetched and Verified**

1. On-chain request: When a trader initiates a transaction, a request for the latest price is simultaneously triggered.
2. Off-chain aggregation: Pyth Oracle retrieves the latest price and updates the index-weighted average price feed.
3. On-chain verification: 1001x’s smart contracts compare Pyth’s price with Chainlink’s feed to verify data accuracy.
4. Transaction completion: Once verification is successful, the trader’s transaction is executed.

This decentralized validation process ensures there is no single point of failure and typically completes within two blocks. Additional safeguards are in place to mitigate issues arising from market disruptions or connectivity problems.

### **Protective Measures**

* Single source deviation: If an exchange’s last price deviates more than 5% from the median price of all sources, its weight is set to zero in calculations.
* Multiple sources deviation: If multiple exchanges show deviations greater than 5%, the median price of all sources is used as the index value instead of a weighted average.
* Connectivity issues:
  * If an exchange’s data feed is inaccessible but had trades updated in the last 10 seconds, the latest available price data is used for index calculation.
  * If no trade data has been updated for 10 seconds, the exchange’s weight is set to zero in the weighted average calculation.


---

# 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://docs.asterdex.com/trading/1001x/price-oracles.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.
