Developer Hub

Understanding Price Data

Learn about confidence intervals, best bid/ask, and what these metrics represent

This page explains the key metrics in Pyth Pro price feeds and what they represent. Understanding these concepts is essential for properly interpreting price data and building robust applications. For technical field specifications and API details, see Payload Reference.

Publisher Contributions

Each publisher contributes up to three prices in every update:

  • Best bid price: the highest price at which the publisher is willing to buy.
  • Price: the publisher's view of the mid/market price.
  • Best ask price: the lowest price at which the publisher is willing to sell.

All three values are optional — a publisher may submit any subset of them in a given update depending on what its data sources provide. An update that contains none of the three is rejected and does not contribute to the aggregate. The aggregate metrics (price, confidence, bestBidPrice, bestAskPrice) are derived from whichever values publishers have contributed.

Price

The aggregate price is the median of all publisher prices when at least min_pub publishers have contributed a price in the current aggregation window.

If fewer than min_pub publishers have contributed a price, no new aggregate is produced. In this case none of the price properties updateprice, confidence, bestBidPrice, bestAskPrice, emaPrice, emaConfidence, publisherCount, and feedUpdateTimestamp are all carried forward from the previous update. The only property that still updates is marketSession, which reflects the current trading session regardless of whether a fresh aggregate was produced.

Consumers can detect this case by comparing feedUpdateTimestamp against the update's timestampUs — if they differ, the price data is carried forward from a prior update rather than freshly generated. See Payload Reference for details on these fields.

Confidence Interval

Confidence reflects the measurement uncertainty of the prices reported among publishers. This may or may not reflect the uncertainty (volatility) of the underlying market price. A high confidence value means publishers are deviating from the aggregate more than usual — whether because market conditions are volatile, publishers hold varying views on the current price, or there is less agreement across data sources. A low confidence value means publishers are in closer agreement about the price.

Because confidence captures publisher disagreement rather than market volatility directly, a low publisher count can distort it: non-optimal behavior from a single publisher — for example, being slow to update or serving stale data — can move confidence in ways unrelated to the market. We recommend:

  • Using publisherCount to filter out updates with too few contributors for your use case.
  • Using emaConfidence rather than raw confidence to smooth out short-term noise.

How Confidence Is Calculated

Confidence is the maximum distance from the aggregate price to the 25th and 75th percentiles of the combined publisher dataset:

  1. Pool all publisher quotes: For each publisher, collect their price, bestBidPrice, and bestAskPrice into a single combined dataset across all publishers (missing fields are imputed first — see below).
  2. Compute percentiles: Calculate the 25th percentile (p25) and 75th percentile (p75) of the combined dataset.
  3. Take the maximum distance: confidence = max(price − p25, p75 − price), where price is the aggregate price.

This approach uses the interquartile range of all publisher quotes, so the confidence reflects both price disagreement and publishers' view of market depth.

Imputing Missing Fields

Publishers may submit any subset of price, bestBidPrice, and bestAskPrice (see Publisher Contributions). Before a publisher's quotes are added to the pool, missing fields are imputed from what they did provide:

  • Only one field provided: the other two are set equal to it.
  • price missing, both bestBidPrice and bestAskPrice provided: price is set to the average of bestBidPrice and bestAskPrice.
  • price provided, bestBidPrice or bestAskPrice missing: the missing bid/ask is set equal to price.

This ensures every publisher contributes three values to the confidence calculation regardless of which fields they submitted.

Best Bid and Best Ask

Experimental

These fields are experimental and not yet covered by automated data quality assurance. See Payload Reference for details.

Best Bid and Best Ask represent the tightest non-overlapping bid and ask across all contributing publishers. The aggregation selects the highest bid and lowest ask such that bestBidPrice < bestAskPrice — publisher quotes that would cross are excluded so the resulting spread is always well-formed.

FieldDescription
bestBidPriceThe highest bid price across publishers that does not cross any publisher ask
bestAskPriceThe lowest ask price across publishers that does not cross any publisher bid

How Best Bid/Ask Differ from Confidence

While both metrics provide insight into market conditions, they measure different things:

MetricWhat It MeasuresUse Case
Confidence IntervalPublisher agreement/disagreement on priceRisk management, uncertainty assessment
Best Bid/AskInside market pricesSpread analysis, execution planning

The spread between best bid and best ask (bestAskPrice - bestBidPrice) shows the current market spread as seen across publishers. This is different from the confidence interval, which shows how much publishers' prices vary from the aggregate.

Using Best Bid/Ask

Best bid and ask are useful for:

  • Spread analysis: Understanding current market liquidity conditions
  • Execution planning: Estimating slippage for trades
  • Market health monitoring: Tracking spread widening during stress periods

Remember: Publisher uncertainty (confidence interval) does not always reflect market uncertainty. Use both confidence intervals and best bid/ask data together for a more complete picture of market conditions.

EMA Price and EMA Confidence

emaPrice and emaConfidence are exponentially-weighted moving averages of the aggregate price and confidence, with an averaging window of approximately 1 hour.

In an EMA, the most recent samples receive the most weight and older samples decay exponentially. For a 1-hour window, samples roughly 1 hour in the past contribute about 50% of the weighting, samples 2 hours back contribute ~25%, 3 hours back contribute ~12.5%, and so on. This produces a smoothed view of the price that is resilient to short-term noise while still tracking sustained moves.

The averaging is also inverse-confidence weighted: samples with a tight confidence interval contribute more weight than samples with a wide confidence. This dampens the influence of outlier aggregates published with high uncertainty, so transient publisher disagreement does not pull the EMA around.

For a deeper explanation of the algorithm and its motivation, see EMA Price Aggregation.

EMA does not reset on market session boundaries

emaPrice and emaConfidence continue averaging across session transitions (for example, from regular to postMarket to overNight, or back to regular). The EMA observed early in a new session still carries contributions from the prior session's aggregates, so it may reflect overnight or pre-market activity rather than the current session alone. Consumers doing session-specific analysis should keep this in mind — the EMA is a rolling 1-hour average, not a per-session average.

Circuit Breakers

The aggregator applies circuit breakers to reject publisher updates that are clearly out of line with the expected price. When a circuit breaker trips, the offending publisher update is excluded from the aggregation window rather than being counted toward the median. This protects the aggregate from stale, mis-scaled, or otherwise anomalous inputs during known sensitive periods.

Split / Reverse-Split Corporate Actions (US Equities)

When a US equity undergoes a stock split or reverse split:

  • The previous overNight session is closed on the execution date — there is no overnight aggregation spanning the corporate action boundary.
  • The split or reverse split is applied at the start of the next preMarket session for feeds enabled for 24/5 trading, and at the start of the next regular session for feeds enabled only for the regular session. From that point forward, all aggregate prices reflect the adjusted share count.

Publishers ingesting prices from upstream venues may not immediately pick up the corporate action and could briefly continue to publish non-adjusted (pre-split) prices after it takes effect. To keep these stale prices out of the aggregate, the aggregator rejects publisher updates whose price deviates beyond a threshold from the adjusted last price (for example, ~10%) for a protection window after the action is applied (for example, ~10 minutes into the new preMarket session). Once the window ends, aggregation returns to normal behavior.

On this page