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/entropy/best-practices.mdx
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -42,7 +42,7 @@ For example, if you want to generate a random number between 1 and 52, the proba
42
42
43
43
If you need to generate multiple random values in a single transaction, you can hash the random input provided by Entropy with a unique identifier for each random number.
44
44
45
-
In the following example, we generate 6 random attributes for a character using the `mapRandomNumber` function defined above.
45
+
In the following example, `mapRandomNumber` is used to generate 6 random attributes for a character.
46
46
47
47
```solidity
48
48
function generateAttributes(bytes32 randomNumber) internal {
Copy file name to clipboardExpand all lines: pages/home/metrics.mdx
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ A lot is happening in the Pyth network ecosystem and it is important to keep tra
4
4
5
5
These data points will further grow in importance (and coverage) as the full Pyth smart contract is deployed (data staking, reward distribution, and governance) and the Pyth price feeds are made available on new chains.
6
6
7
-
If you have any questions or suggestions about the Pyth metrics made available below, please let us know in our [Discord](https://discord.gg/invite/PythNetwork).
7
+
If you have any questions or suggestions about the Pyth metrics made available below, please raise questions in the [Pyth Discord](https://discord.gg/invite/PythNetwork).
Copy file name to clipboardExpand all lines: pages/home/metrics/dune-dashboard.mdx
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ Find the full Dune Dashboard [here](https://dune.com/cctdaniel/pyth-push-oracle-
8
8
9
9
This dashboard was created by a Pyth contributor to further provide relevant statistics around the Pyth network, its operations and price feed, as well as its usage by protocols and users.
10
10
11
-
If you have any relevant metrics you’d like to see on this dashboard, come let us know in our [Discord](https://discord.gg/invite/PythNetwork).
11
+
If you have any relevant metrics you'd like to see on this dashboard, please raise questions in the [Pyth Discord](https://discord.gg/invite/PythNetwork).
12
12
13
13
---
14
14
@@ -139,7 +139,7 @@ _The more a publisher spends, the more likely he is active on more price feeds a
139
139
140
140
### Consumers
141
141
142
-
Who's #PoweredByPyth? Find the known integration on our [website](https://pyth.network/consumers/).
142
+
Who's #PoweredByPyth? Find the known integration on [the Pyth Network website](https://pyth.network/consumers/).
143
143
144
144
**Past 24H Daily Active Consumers — Pyth Oracle Daily Active Consumers**
Copy file name to clipboardExpand all lines: pages/home/metrics/kpi.mdx
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -14,9 +14,9 @@ On-chain protocols need sustainable price references, which means they need orac
14
14
15
15
-**#PoweredByPyth Applications**
16
16
17
-
The metrics include all known on-chain dApps composing with Pyth; sometimes, a team using Pyth data may not tell us. (If this is the case for you, let us know [here](https://yyyf63zqhtu.typeform.com/ContactPyth?typeform-source=pyth.network) and we’ll get you featured).
17
+
The metrics include all known on-chain dApps composing with Pyth; sometimes, a team using Pyth data may not be known. (If this is the case for you, please inform [here](https://yyyf63zqhtu.typeform.com/ContactPyth?typeform-source=pyth.network)).
18
18
19
-
From an integrations perspective, one segment the crypto community may oversee is off-chain applications needing pricing data in their own environment: this is a segment we expect to see a strong uptick in the future thanks to Pyth’s unique offering and quality assurance.
19
+
From an integrations perspective, one segment the crypto community may overlook is off-chain applications needing pricing data in their own environment.
Pyth Publishers Metrics is a feature that provides insights that will empower developers, publishers, and delegators by providing the historical performance of the network’s data sources. This powerful tool reflects our commitment to transparency and delivering timely, accurate, and valuable first-party data for everyone.
3
+
Pyth Publishers Metrics is a feature that provides insights that will empower developers, publishers, and delegators by providing the historical performance of the network's data sources. This powerful tool reflects a commitment to transparency and delivering timely, accurate, and valuable first-party data for everyone.
4
4
5
5
---
6
6
7
7
**Price Series**
8
8
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.
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.
15
+
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.
16
16
17
17

18
18
19
19
**Quality**
20
20
21
-
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.
21
+
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.
27
+
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.
You can start at the[Pyth Price Feeds page](https://pyth.network/price-feeds/), which will list every market symbol (“price feed”). Clicking on any price feed will bring you to the corresponding market page. We will use the[SOL/USD price page](https://pyth.network/price-feeds/#Crypto.SOL/USD) as our example.
33
+
You can start at the[Pyth Price Feeds page](https://pyth.network/price-feeds/), which will list every market symbol (“price feed”). Clicking on any price feed will bring you to the corresponding market page. Here is an example of the[SOL/USD price page](https://pyth.network/price-feeds/#Crypto.SOL/USD).
34
34
35
35
Each price feed page has a list of price components (representing each publisher by their publisher keys). Each component will link to the corresponding Publisher Metrics page.
36
36
@@ -44,6 +44,6 @@ To open the metrics for another publisher (of that same price feed), you can cli
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.
47
+
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.
48
48
49
-
For more details on the Pyth Publishers Metrics, please visit our[blog post](https://pythnetwork.medium.com/introducing-pyth-publishers-metrics-3b20de6f1bf3).
49
+
For more details on the Pyth Publishers Metrics, please visit this[blog post](https://pythnetwork.medium.com/introducing-pyth-publishers-metrics-3b20de6f1bf3).
Copy file name to clipboardExpand all lines: pages/price-feeds/best-practices.mdx
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@ In such cases, Pyth may return a stale price for the product.
30
30
Integrators should be careful to avoid accidentally using a stale price.
31
31
The Pyth SDKs guard against this failure mode by incorporating a staleness check by default.
32
32
Querying the current price will fail if too much time has elapsed since the last update.
33
-
The SDKs expose this failure condition in an idiomatic way: for example, the Rust SDK may return `None`, and our Solidity SDK may revert the transaction.
33
+
The SDKs expose this failure condition in an idiomatic way: for example, the Rust SDK may return `None`, and the Solidity SDK may revert the transaction.
34
34
The SDK provides a sane default for the staleness threshold, but users may configure it to suit their use case.
35
35
36
36
## Adversarial selection
@@ -75,7 +75,7 @@ At every point in time, Pyth publishes both a price and a confidence interval fo
75
75
76
76
In a Pyth feed, each publisher specifies an interval `(p_i-c_i, p_i+c_i)` in the form of their price and confidence submission. This interval is intended to achieve 95% coverage, i.e. the publisher expresses the belief that this interval contains the “true” price with 95% probability. The resulting aggregate interval `(μ-σ, μ+σ)`, where `μ` represents the aggregate price and `σ` represents the aggregate confidence, is a good estimate of a range in which the true price lies.
77
77
78
-
To explain this, we consider two cases of publisher estimates. In the first case, there is 100% overlap of all the publishers’ intervals, i.e. each publisher submits the same interval `(p-c, p+c)`. In this case, the aggregate confidence interval is exactly that interval, so the aggregate confidence interval provides 100% coverage of the publishers’ intervals. This first case represents normal operating conditions, where most publishers agree about the price of an asset.
78
+
To explain this, consider two cases of publisher estimates. In the first case, there is 100% overlap of all the publishers’ intervals, i.e. each publisher submits the same interval `(p-c, p+c)`. In this case, the aggregate confidence interval is exactly that interval, so the aggregate confidence interval provides 100% coverage of the publishers’ intervals. This first case represents normal operating conditions, where most publishers agree about the price of an asset.
79
79
80
80
In the second case, each publisher specifies an interval that is disjoint from each of the other publishers’ intervals. In this case, the aggregate confidence interval can be seen to contain at least the 25th percentile and at least the 75th percentile of the set of points consisting of each of the publisher’s price, price plus confidence, and price plus confidence. As a result, the aggregate confidence interval is somewhat analogous to an interquartile range of the data, which is a reasonable measure of the spread of a set of points. Note that this is not an IQR of the prices alone of the publishers but rather of the set composed of the 3 points that each publisher submits. Moreover, note that the IQR does not include the most extreme publishers’ prices on either side; this property is necessary to ensure that a small group of publishers cannot manipulate the aggregate confidence interval. This second case represents an atypical scenario where publishers all disagree. Such circumstances are rare but can occur during market volatility or unusual events.
81
81
@@ -84,7 +84,7 @@ The aggregate confidence interval interpolates between the two cases above as pu
84
84
1. It can use a discounted price in the direction favorable to it. For example, a lending protocol valuing a user’s collateral can use the lower valuation price `μ-σ`. When valuing an outstanding loan position consisting of tokens a user has borrowed from the protocol, it can use the higher end of the interval by using the price `μ+σ`. This allows the protocol to be conservative with regard to its own health and safety when making valuations.
85
85
2. It can decide that there is too much uncertainty when `σ/μ` exceeds some threshold and choose to pause any new activity that depends on the price of this asset.
86
86
87
-
To expand upon the first option, we recommend using the confidence interval to protect your users from these unusual market conditions. The simplest way to do so is to use Pyth's confidence interval to compute a _range_ in which the true price probably lies. This principle is common sense. Imagine that you are lending money to a friend, and your friend pledges a bitcoin as collateral. Also imagine that Pyth says the bitcoin price is \$50000 +- \$1000. (Note that \$1000 is an unusually large confidence interval for bitcoin; the confidence interval is typically \$50 dollars). You therefore calculate that the true price is between \$49000 and \$51000. When originating the loan, you would value the bitcoin at \$49000. The lower price is conservative in this instance because it limits the amount of borrowing that is possible while the price is uncertain. On the other hand, if you were to issue a loan of bitcoin, you would value the borrowed bitcoin at \$51000. The higher price is conservative, as it protects you from allowing someone to borrow in excess during times of increased volatility.
87
+
To expand upon the first option, it is recommended to use the confidence interval to protect your users from these unusual market conditions. The simplest way to do so is to use Pyth's confidence interval to compute a _range_ in which the true price probably lies. This principle is common sense. Imagine that you are lending money to a friend, and your friend pledges a bitcoin as collateral. Also imagine that Pyth says the bitcoin price is \$50000 +- \$1000. (Note that \$1000 is an unusually large confidence interval for bitcoin; the confidence interval is typically \$50 dollars). You therefore calculate that the true price is between \$49000 and \$51000. When originating the loan, you would value the bitcoin at \$49000. The lower price is conservative in this instance because it limits the amount of borrowing that is possible while the price is uncertain. On the other hand, if you were to issue a loan of bitcoin, you would value the borrowed bitcoin at \$51000. The higher price is conservative, as it protects you from allowing someone to borrow in excess during times of increased volatility.
88
88
89
89
The same principle would apply if you wrote a derivative contract. If someone wants to open a derivative contract with you, you would value their collateral at the lower price. However, if you were deciding whether someone's margin limits were violated, you could value their outstanding leveraged position at the higher price. If a contract needs to be settled at a price, you could take approaches such as the following:
Copy file name to clipboardExpand all lines: pages/price-feeds/how-pyth-works/ema-price-aggregation.mdx
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ In an EMA the most recent samples receive the most weight, and samples further b
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
30
-
Find the implementation in our [GitHub](https://github.com/pyth-network/pyth-client/blob/852b991fb4403dcf23043752e3a799a40ed0133b/program/src/oracle/upd_aggregate.h).
30
+
Find the implementation in [GitHub](https://github.com/pyth-network/pyth-client/blob/852b991fb4403dcf23043752e3a799a40ed0133b/program/src/oracle/upd_aggregate.h).
31
31
32
32
**How does Pyth calculate its EMA Price and EMA Confidence?**
33
33
@@ -40,4 +40,4 @@ The current Pyth averaging method is a slot-weighted, inverse confidence-weighte
40
40
41
41

42
42
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).
43
+
For more details and explanations, be sure to read the dedicated blog post on this topic [here](https://pythnetwork.medium.com/whats-in-a-name-302a03e6c3e1).
0 commit comments