Every Pyth price comes with a confidence interval. It's a number expressed in the same units as the price, representing the half-width of a band centered on the price. A BTC/USD reading might be 76,000 ± 25 — meaning the publisher set's collective uncertainty is about 25 dollars around the 76,000 dollar midpoint.
Why it exists
Most price oracles give you one number. Pyth gives you two: a price and a measure of how much to trust that price right now. The interval widens when publishers disagree (a fast move, a thin order book, one exchange having an outage) and narrows when they converge. A smart contract that uses raw price without checking the interval is throwing away the safety signal.
How to use it in a contract
- Decide your tolerance based on the action — tight for risk-bearing operations like liquidations, looser for casual UI display
- Read the interval alongside the price on every read
- If interval divided by price exceeds your tolerance, treat the read as unusable: skip, retry, or fall back
Pyth's SDKs expose helpers (get_price_no_older_than, get_price_unchecked, etc.) that take both freshness and interval criteria. Use the safe variants in production; the unchecked ones exist only for cases where the caller has already done the validation.
Where to verify
Every feed page on Pythscan shows the latest price; the underlying API surfaces the confidence interval alongside it. The best-practices guide in Pyth's docs is the canonical write-up on how to use it.