You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pages/home/metrics/publisher-metrics.mdx
+6-6
Original file line number
Diff line number
Diff line change
@@ -8,25 +8,25 @@ Pyth Publishers Metrics is a feature that provides insights that will empower de
8
8
9
9
The **price graph** shows how a publisher’s price compares to the aggregate price, illustrating how closely the two prices track each other, and whether there were any periods where the publisher deviated significantly from the rest of the market.
The **uptime graph** shows when the publisher was actively contributing prices. The x-axis subdivides the time interval into bins, and the y-axis is the % of slots in that bin where the publisher’s price was recent enough to be included in the aggregate. This graph lets you determine the regularity and reliability of a publisher.
The quality graph shows the dataset used in the regression model for computing the quality score described in section 4.1.1 of the [whitepaper](https://pyth.network/whitepaper.pdf). The quality score measures how well a publisher’s price series predicts future changes in the aggregate price. A smooth color gradient (from blue on the bottom left to pink on the top right) indicates a high-quality score.
The **calibration graph** shows how closely the publisher’s prices and confidences match the expected Laplace distribution. The closer the fit between the two distributions, the higher the calibration score (described in section 4.1.2 of the whitepaper). In other words, a perfect publisher should produce a uniform histogram. As a reminder, the calibration score does not reward publishers for producing tighter confidence intervals; rather, the score captures whether the reported confidence interval corresponds to the publisher’s “true” confidence.
If you want to review the Publisher Metrics of another price feed (e.g. ETH/USD), you will need to access the relevant asset. As mentioned, the [Pyth Price Feeds page](https://pyth.network/price-feeds/) has the full list of price feeds.
In an EMA the most recent samples receive the most weight, and samples further back in time get exponentially less weight the farther in the past they are. For a 1 hour EMA, the samples 1 hour in the past get 50% of the weighting, samples 2 hours in the past get 25% of the weighting, 3 hours in the past get 12.5% of the weighting, etc.
25
25
26
-
 (1).png>)
26
+

27
27
28
28
While conceptually not as simple as an SMA (Simple Moving Average), the EMA has a particularly simple implementation for streaming applications such as Pyth. The exponential weighting method allows the entire history of prices and weights to be represented by a single number.
29
29
@@ -38,6 +38,6 @@ The current Pyth averaging method is a slot-weighted, inverse confidence-weighte
38
38
-**Slot weighted** — The Pyth EMA uses the Solana slot number to measure the passage of time. The averaging period is 5921 slots, which corresponds to approximately 1 hour on Solana mainnet.
39
39
-**Inverse confidence weighted** — Weighting each sample by 1/Confidence lets the EMA give more weight to samples with tight confidence and ignore samples with very wide confidence. Below is an example of an outlier aggregate price with a wide confidence interval. Notice how the average using inverse confidence weighting does not get pulled up by the outlier sample while the uniform weighted average does.
40
40
41
-
 (1) (1).png>)
41
+

42
42
43
43
For more details and explanations, be sure to read our dedicated blog post on this topic [here](https://pythnetwork.medium.com/whats-in-a-name-302a03e6c3e1).
Copy file name to clipboardExpand all lines: pages/price-feeds/how-pyth-works/price-aggregation.mdx
+7-7
Original file line number
Diff line number
Diff line change
@@ -6,19 +6,19 @@ Price aggregation combines the prices and confidences submitted by individual da
6
6
7
7
The aggregation algorithm is designed to achieve 3 properties. First, it must be **robust to manipulation.** If most publishers are submitting a price of \$100 and one publisher submits a price of \$80, the aggregate price should remain near \$100 and not be overly influenced by the single outlying price. In the figure below, the aggregate price and confidence interval (represented by the red star) is not influenced by the blue publisher whose price is far away from the other publishers:
Second, the **aggregate price should appropriately weight data sources with different levels of accuracy.** Pyth allows publishers to submit a confidence interval because they have varying levels of accuracy in observing the price of a product. This property can result in situations where one publisher reports a price of \$101 +/- 1, and another reports \$110 +/- 10. In these cases, we would like the aggregate price to be closer to \$101 than \$110, as in the figure below.
Finally, the **aggregate confidence interval should reflect the variation between publishers’ prices.**
16
16
Under normal market conditions, we expect the a product to trade at a similar price across exchanges.
17
17
In these cases, we would like the aggregate confidence interval to reflect the confidence intervals of the individual data providers, as shown in the figure on the left.
18
18
However, in some rare situations, a product can trade at different prices on different exchanges.
19
19
In these cases, the aggregate confidence interval should widen out to reflect the variation between these prices, as shown in the figure on the right.
@@ -41,21 +41,21 @@ Finally, the bold red star depicts the aggregate price and the bold red line dep
41
41
In the first scenario, one publisher with a tight confidence interval is an outlier.
42
42
Although this publisher does influence the objective function (the red line is lower on the left side than the right), it does not have enough influence to affect either the aggregate price or confidence interval.
The second scenario depicts how publishers with tighter confidence intervals can exert more influence over the location of the aggregate price, as long as their prices are consistent with the confidence intervals of other publishers.
Finally, the fourth scenario considers the case where the publishers publish distinct prices with non-overlapping confidence intervals.
56
56
In this case, the confidence interval widens out because the dispersion between publishers creates a large gap between the aggregate price and the 25th/75th percentiles of the votes.
Exchange A should publish a price of \$50,000.01 and a confidence of \$50.005 (half the bid-ask spread after fee adjustment). It would be wrong to publish a confidence of \$0.005 based on the "not fee-adjusted" raw exchange bid-ask spread.
17
17
18
18
Example 2 - Exchange A has a best aggressive fee of 10bps. Exchange B has a best aggressive fee of 1bps, and a publisher is combining them into a single combined book. Exchange books are combined by taking the best ask across both exchanges and the best bid across both exchanges.
In this example, if a publisher were combining the books of Exchange A and Exchange B to get a combined price, they should publish a price of \$49,978.13 and confidence of \$28.125, which corresponds to the midprice and half the bid-ask spread of the combined fee-adjusted books. It would be wrong to publish a price of \$50,000.01 and confidence of \$0.01 based on the "not fee-adjusted" raw exchange prices. Note that in this example, not only is the confidence changed by including the exchange fees, but the price reported is also substantially different once fees are properly accounted for.
0 commit comments