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.

  • RUJI Money Market: The enshrined oracles are used by Credit Accountsarrow-up-right to price the collateral for all debt products.

  • RUJI Perps: The enshrined oracles are used by Ghost Mintarrow-up-right (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.htmlarrow-up-right

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 like Chainlink and Pyth often rely on predictable or observable data updates that can be exploited by bots monitoring mempools or oracle reports to front-run users.

Last updated