Pythscan
Core concept · Core

Aggregation

How Pyth combines many publisher quotes into one number per feed. The short version: it approximates a confidence-weighted median, with outlier handling.

Every Pyth feed has multiple publishers reporting at once. Aggregation is the step that turns that crowd of submissions into the single price plus confidence interval that consumers read. It runs on Pythnet, on a fast cadence, every time the publisher set's quotes update.

What goes in

Each publisher contributes three things: a price, a confidence interval, and a status. The confidence interval is their own claim about how certain they are. A publisher claiming a tighter interval has more influence on the aggregate, because they are saying their reading is more reliable. A publisher claiming a wide interval has less influence — the protocol takes them at their word about their own uncertainty.

What comes out

  • Aggregate price — roughly a confidence-weighted median across the publisher set, with outlier handling
  • Aggregate confidence interval — the spread that captures publisher disagreement
  • Status — Trading if enough publishers are contributing (per the feed's min_publishers threshold), otherwise Halted / Auction / Unknown

Why this design

A simple median is robust to a single bad actor but doesn't reward publishers for being more accurate. A simple average is vulnerable to one outlier. Pyth's confidence-weighted approach combines them: a tight quote from a reliable source has more weight, and the protocol's outlier handling reduces the influence of any single quote that drifts far from the rest of the publisher set. When the publisher set genuinely disagrees — for example during a fast crash — the aggregate confidence interval widens to reflect that, and downstream contracts can refuse to act on a wide read.

On the exact algorithm

This description is a plain-language summary. The full methodology — including how Pyth handles outliers, what counts as a tight versus wide quote, and the specific math behind the weighted median — is in Pyth's docs. Use this entry to understand the shape of aggregation; consult the docs before relying on the exact behavior in production.

How to read this on Pythscan

Every feed page shows the aggregate price and a publish time. The confidence interval is what your contract should check next; a band that's much wider than usual is the protocol telling you the publisher set isn't agreeing right now.

Related concepts