Flash Loan Manipulation
Attackers borrow large sums in a single transaction to temporarily distort spot prices used by on-chain oracles, triggering liquidations or draining protocols.
Enshrined Oracles
Rujira uses multiple price sources and filters them before every trade. This system, called Enshrined Oracles, keeps pricing fair and protects you from manipulation.
The Problem
Most DeFi protocols rely on external oracle networks, which introduce additional trust assumptions, latency, and attack surface between price data and protocol execution.
Attackers borrow large sums in a single transaction to temporarily distort spot prices used by on-chain oracles, triggering liquidations or draining protocols.
External oracle networks update on their own schedule. Between updates, prices can drift significantly, creating arbitrage risk and inaccurate liquidations.
External oracle privders are separate systems with their own validator sets and economic models, adding trust assumptions beyond the core protocol.
Mechanics
To make this concrete, follow how a BTC/USD price becomes the oracle price inside a THORChain block: nodes fetch many sources, remove outliers, publish their own averages, and the network finalizes one consensus value before execution.
Each THORChain node independently fetches the BTC/USD price, or any supported asset, from more than 10 exchange data sources. Crucially, each node operator can choose their own set of sources. This diversity makes the system resilient to any single feed going down or acting maliciously.
Node A · Price Fetch · BTC/USD
Fetching from sources
Once a node has collected prices from all its sources, it runs an outlier detection algorithm. Any price that deviates significantly from the cluster is removed before averaging. This protects against a single compromised or manipulated data source corrupting the final price.
Node A · Outlier Detection
10 prices received · sorting
After filtering, each node computes a volume weighted average of its remaining valid prices and pushes that single value to the network. This is the node's vote for the true price in this block cycle.
Node A · Computing Average
9 valid prices
Node A publishes
The network collects the averaged prices submitted by all active Nodes. Each one independently computed its own number from its own source set. The protocol then takes the average of those node-level submissions to produce the final oracle price for that block.
Network Consensus · BTC/USD
Node submissions this block
Final consensus price
The final consensus price is committed directly into the THORChain block before any transactions in that block are executed. This pre-commit window makes it extremely difficult for attackers to predict or front-run the price.
THORChain Block #21,340,812
Block Contents
Every Rujira product that needs a price, including loans, liquidations, perps, indices, and future prediction markets, reads directly from the block's enshrined oracle price. There are no external oracle calls, no latency, and no extra trust layer.
Oracle Price · Consumer Products
Comparison
| Model | THORChain Enshrined Oracle | Third-party Oracles | AMM Spot Price |
|---|---|---|---|
| Architecture | Baked into every block by 100+ validators | Separate oracle network, on-chain update txns | Derived from pool reserves on-chain |
| Latency | Every block (~6s), pre-committed | Heartbeat or deviation triggered | Every block, but manipulable |
| Manipulation risk | Very low - requires 51% of validators | Low - depends on oracle network design | High - flash loan vulnerable |
| Trust assumptions | None beyond THORChain validators | Trust external oracle operators | Trustless but manipulable |
| Data types | Crypto, forex, stocks, commodities | Crypto, forex, equities, commodities | On-chain assets only |
| Source diversity | 10+ per node, different per node | Fixed set of data providers | Single pool price only |
| Used by Rujira | Perps, Lending, Liquidations, Index | N/A | N/A |
Why this matters
By moving price data inside the protocol itself, Rujira can build financial products that would be unsafe or impossible with external oracles.
Accurate, manipulation-resistant prices allow RUJI Perps to safely support up to 50x leverage, impossible with flash-loan-vulnerable spot oracles.
CDP loans and credit accounts liquidate at a true, multi-source consensus price, not a manipulated spot price. Borrowers get fair treatment.
The same mechanism that prices BTC can price forex pairs, stocks, or commodities, opening up Rujira to real-world prediction markets and indices.
Zero dependency on any external oracle network.
Every ~6 seconds, a fresh price is committed. There are no stale windows, no deviation thresholds, and DeFi products always work with the most current data.
Trustworthy real-world data feeds pave the way for on-chain prediction markets on stocks, election outcomes, sports results, and more, coming to Rujira.
Secured Assets
Enshrined Oracles help protect the pricing side of the system. Secured Assets protect the custody side. If Secured Assets are new to you, they are 1:1 backed versions of native assets like BTC held in decentralized THORChain vaults, giving Rujira a safer foundation for native-asset DeFi from both a pricing and asset-security perspective.
FAQ
Common questions about how Enshrined Oracles work and why they matter across Rujira.
Discover More
You've now got the Enshrined Oracles overview. Pick a page below to explore the pieces behind it, or head to the Support Center for guides and answers.