Calculation Process
1. Price Collection
The oracle service collects index prices from all available sources for a given asset. Invalid values, including zero, NaN, or unavailable prices, are discarded before aggregation.2. Outlier Filtering
If three or more valid sources are available, Hotstuff applies Median Absolute Deviation (MAD) filtering. The process:- Compute the median price.
- Measure each source’s deviation from the median.
- Compute the median deviation.
- Remove sources exceeding the configured MAD threshold.
| Source | Price |
|---|---|
| Binance | 100.00 |
| Bybit | 100.10 |
| OKX | 99.95 |
| Kraken | 100.05 |
| Exchange X | 115.00 |
Exchange X is identified as an outlier and excluded from the calculation.
3. Weighted Median Aggregation
The remaining sources are aggregated using a weighted median.| Source | Price | Weight |
|---|---|---|
| Binance | 100.00 | 40% |
| Bybit | 100.10 | 25% |
| OKX | 99.95 | 20% |
| Kraken | 100.05 | 15% |