Oracle Price Evaluation
The Oracle price evaluation algorithm is designed to be reliable, fully deterministic, and resistant to manipulation. No single party - not Hyperliquid, not any external data provider - can manipulate the price.
We will actively test this algorithm throughout the testnet phase and may adjust certain parameters based on observed performance.
Aggregation Algorithm
Step 1: Data Collection
For each market, fair-value prices are collected from multiple dedicated external data sources, as well as Hyperliquid's own market data. Each value is stored together with its original source timestamp.
Step 2: Outlier Removal
Any price that deviates by more than 50% from the median of all collected values is discarded. This prevents any single source from manipulating the oracle by submitting extreme or invalid prices.
Step 3: Freshness weighting
Some data sources update in real time, while others update less frequently due to market specifics. To account for this, the age of each value is incorporated into the evaluation using an exponential decay function:
age_weight_multiplier = 1.0 / (1.0 * exp(k * x))
where k is a market-specific decay parameter, and x is the age of the data point. Older data receives a lower weight.
Step 4: Reputation multiplier
Each data source is assigned a reputation score based on its historical stability and data quality. These scores may be updated over time as performance is evaluated.
Step 5: Final price selection
The oracle price is calculated as a weighted average of all remaining values:
oracle_price = sum(age_weight_multiplier[i] * reputation_multiplier[i] * value[i]) / sum(age_weight_multiplier[i] * reputation_multiplier[i])
Step 6: Smoothing
To prevent sudden jumps, each oracle update is capped at a maximum price change of 1%.
These steps work together to ensure that the oracle price is fair, robust, and highly resistant to manipulation. The algorithm may continue to evolve as we gather more data and insights.
Core principles behind the oracle algorithm
- No single point of failure: The system remains functional even if any individual data source goes offline.
- Manipulation resistance: Outlier filtering and reputation weighting prevent malicious or faulty prices from influencing the oracle.
- Stale data resistance: Only data sources that actively update contribute meaningful weight to the final price.
- Predictable and transparent algorithm: Anyone can independently reproduce historical oracle prices as long as they have the same inputs.
- No sudden jumps: The algorithm prevents abrupt, source-driven spikes or flash-crash effects from impacting the market.
Example Scenarios and Oracle Behaviour
The following examples illustrate how the oracle behaves under different real-world conditions:
A data source stops updating permanently
As time passes, its freshness weight naturally decays toward zero, causing the source to be automatically ignored. No manual intervention is required.
A data source begins returning clearly incorrect or compromised values
If its price deviates by more than 50% from the current median, it is discarded during outlier filtering. This prevents a single bad actor from influencing the oracle.
A majority of data sources are compromised and report different fake prices
All of these scattered values are flagged as outliers and filtered out. Remaining values are used for the oracle price evaluation.
A majority of data sources are compromised and report the same fake price
In this case, the oracle follows the majority, which is correct behavior, since the algorithm respects consensus rather than special-casing any single source.
The Hyperliquid perp market experiences a sudden 500% pump or 90% dump
Since the perp feed is treated as just one source, its price spike alone cannot move the oracle significantly. External confirmations are still required, and the oracle price would move no more than about 1% per update.