# Understanding Enshrined Oracles

The Enshrined Oracles are THORChain in-house solution allowing Node Operators to provide robust price feeds for established crypto assets that can be consumed by applications on the App Layer.

The Enshrined Oracles are used as the source of true by several Rujira core products:

* **RUJI Trade:** The enshrined oracles are used to price [Tracking Orders](/core-products/ruji-trade.md#key-features).
* **RUJI Money Market:** The enshrined oracles are used by [Credit Accounts](https://gitlab.com/thorchain/rujira/-/blob/main/contracts/rujira-ghost-credit/README.md) to price the collateral for all debt products.
* **RUJI Perps:** The enshrined oracles are used by [Ghost Mint](https://gitlab.com/thorchain/rujira/-/blob/main/contracts/rujira-ghost-mint/README.md) (the primitive that power the upcoming Perps v2) to price the collateral for Perps trading.

### How it works

Each node runs an instance of the oracle and reports observed prices independently. Prices are sourced from multiple whitelisted price providers for different centralized exchanges. Each node query prices from a different subset of providers.

Every second, the oracle collects all rates of all configured trading pairs from all enabled providers. It then calculates the USD value of each base asset and filters them for outliers.

All remaining USD rates for every asset are averaged into a single value weighted by the 24h trading volume, reported by the provider.

Prices are valid only for a single block to enhance accuracy and reduce manipulation risks.

For more info, check THORChain docs: <https://dev.thorchain.org/bifrost/oracle.html>

### Key Benefits

* **Decentralized by design:** Every node runs its own oracle and reports prices independently, reducing reliance on any single operator or source.
* **More robust pricing:** Prices are sourced from multiple exchange providers, then filtered for outliers before aggregation, which helps remove bad or anomalous data. Remaining prices are combined using volume weighting to give deeper, more liquid markets a greater influence on the result.
* **Manipulation resistance:** Feeds are signed, timestamped, stale messages are discarded, and Thornode takes the median across node submissions, making the final on-chain price harder to forge or skew.
* **Reduced third-party dependencies and risks:** By embedding oracles into the core protocol, THORChain eliminates reliance on external providers, minimizing points of failure such as network outages, data delays, or compromises in third-party systems. Enshrined designs ensure data is always accessible as part of the chain's operations.
* **Better protection against front-running**: Price feeds are handled in a single batch transaction, all oracle prices are cleared at every `BeginBlock`, and any transaction that tries to execute before fresh oracle pricing is available fails. This ensure applications always get access to fresh pricing and cannot be front-run by node oeprators. In contrast, external oracles often rely on predictable or observable data updates that can be exploited by bots monitoring mempools or oracle reports to front-run users.


---

# 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.rujira.network/how-it-works/understanding-enshrined-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.
