What Confidence Intervals Really Mean
The ±CI published with every Pyth price — what it measures, how it's computed, and whether it's calibrated.
What the CI is
Every Pyth price update contains three numbers: price, conf, and expo. The confidence is a half-width: the true price is expected to lie in the range [price − conf, price + conf].
Pyth aggregates prices from dozens of first-party data publishers — market makers, exchanges, and trading firms who submit their own observed prices. The CI reflects how much those publishers disagree with each other at that moment. Wide disagreement → wide CI. Tight agreement → tight CI.
What calibrated means
In probability theory, a confidence interval is well-calibrated if the stated coverage probability matches the observed frequency. A perfect ±1σ CI should contain the true price 68.3% of the time. A ±2σ CI should contain it 95.4% of the time.
| CI width | Expected coverage | Meaning |
|---|---|---|
| ±0.5σ | 38.3% | Very tight — high certainty required |
| ±1.0σ | 68.3% | Standard deviation — typical usage |
| ±1.5σ | 86.6% | Conservative buffer |
| ±2.0σ | 95.4% | Very safe — liquidation engines often use this |
| ±3.0σ | 99.7% | Extreme — essentially guaranteed containment |
If Pyth's CI is over-confident (observed coverage < expected), protocols using it for liquidation triggers or price guardrails are exposed to more risk than they think. If it is under-confident (too wide), capital is being unnecessarily locked up in collateral buffers.
How this app measures it
The CI Calibration Analysis page fetches historical price snapshots from the Pyth Benchmarks API at hourly intervals. For each snapshot, it records the published price and CI, then checks whether the actual price at the next interval fell within ±kσ of the snapshot's CI — for k ∈ {0.5, 1, 1.5, 2, 2.5, 3}.
Why this matters for DeFi
The $388K oracle exploit referenced on the home page happened because a protocol used a BTC/USD feed to price USDC collateral — a mismatch the CI would have flagged (a $79,999 price with a ±$1 CI for something that should be valued at $1 is an obvious anomaly). Calibrated CIs give protocols a principled way to detect such mismatches at runtime.
How to use CI in your protocol
// Solidity — safe price check with CI guard
PythStructs.Price memory p = pyth.getPriceNoOlderThan(
BTC_USD_FEED, 60 // max 60 seconds stale
);
// Reject if CI is too wide (oracle uncertain)
uint256 confPct = uint256(p.conf) * 10000 / uint256(p.price);
require(confPct < 50, "Oracle CI too wide"); // reject if CI > 0.5%
// Use p.price safely