Skip to content

chore(docs) Remove personal Language instances #463

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pages/entropy/best-practices.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ For example, if you want to generate a random number between 1 and 52, the proba

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.

In the following example, we generate 6 random attributes for a character using the `mapRandomNumber` function defined above.
In the following example, `mapRandomNumber` is used to generate 6 random attributes for a character.

```solidity
function generateAttributes(bytes32 randomNumber) internal {
Expand Down
2 changes: 1 addition & 1 deletion pages/home/metrics.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ A lot is happening in the Pyth network ecosystem and it is important to keep tra

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.

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).
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).

- [Pyth Dune Dashboard](metrics/dune-dashboard.md)
- [Pyth Publisher Metrics](metrics/publisher-metrics.md)
Expand Down
4 changes: 2 additions & 2 deletions pages/home/metrics/dune-dashboard.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Find the full Dune Dashboard [here](https://dune.com/cctdaniel/pyth-push-oracle-

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.

If you have any relevant metrics youd like to see on this dashboard, come let us know in our [Discord](https://discord.gg/invite/PythNetwork).
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).

---

Expand Down Expand Up @@ -139,7 +139,7 @@ _The more a publisher spends, the more likely he is active on more price feeds a

### Consumers

Who's #PoweredByPyth? Find the known integration on our [website](https://pyth.network/consumers/).
Who's #PoweredByPyth? Find the known integration on the [Pyth's website](https://pyth.network/consumers/).

**Past 24H Daily Active Consumers — Pyth Oracle Daily Active Consumers**

Expand Down
4 changes: 2 additions & 2 deletions pages/home/metrics/kpi.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ On-chain protocols need sustainable price references, which means they need orac

- **#PoweredByPyth Applications**

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).
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)).

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.
From an integrations perspective, one segment the crypto community may overlook is off-chain applications needing pricing data in their own environment.

- **Total Value Secured**

Expand Down
8 changes: 4 additions & 4 deletions pages/home/metrics/publisher-metrics.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Pyth Publishers Metrics

Pyth Publishers Metrics is a feature that provides insights that will empower developers, publishers, and delegators by providing the historical performance of the networks data sources. This powerful tool reflects our commitment to transparency and delivering timely, accurate, and valuable first-party data for everyone.
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 the commitment to transparency and delivering timely, accurate, and valuable first-party data for everyone.

---

Expand All @@ -24,13 +24,13 @@ The quality graph shows the dataset used in the regression model for computing t

**Calibration**

The **calibration graph** shows how closely the publishers 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.
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.

![](../../../images/publisher-metrics/Calibration.jpg)

**Accessing the Metrics**

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.
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).

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.

Expand All @@ -46,4 +46,4 @@ 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.

For more details on the Pyth Publishers Metrics, please visit our [blog post](https://pythnetwork.medium.com/introducing-pyth-publishers-metrics-3b20de6f1bf3).
For more details on the Pyth Publishers Metrics, please visit this [blog post](https://pythnetwork.medium.com/introducing-pyth-publishers-metrics-3b20de6f1bf3).
2 changes: 1 addition & 1 deletion pages/price-feeds/api-instances-and-providers/hermes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ The following node providers offer Hermes:

## Self-Hosting

We provide a Helm chart for running Hermes in our
The Pyth Data Association provides a Helm chart for running Hermes in
[charts](https://github.com/pyth-network/charts/tree/main/charts/hermes) repository. Please refer to the chart's readme
for the configuration values.
You will need a Pythnet RPC to run Hermes; see the [guide for accessing a Pythnet RPC](pythnet-rpc).
6 changes: 3 additions & 3 deletions pages/price-feeds/best-practices.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ In such cases, Pyth may return a stale price for the product.
Integrators should be careful to avoid accidentally using a stale price.
The Pyth SDKs guard against this failure mode by incorporating a staleness check by default.
Querying the current price will fail if too much time has elapsed since the last update.
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.
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.
The SDK provides a sane default for the staleness threshold, but users may configure it to suit their use case.

## Adversarial selection
Expand Down Expand Up @@ -75,7 +75,7 @@ At every point in time, Pyth publishes both a price and a confidence interval fo

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.

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.
To explain this, let's 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.

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.

Expand All @@ -84,7 +84,7 @@ The aggregate confidence interval interpolates between the two cases above as pu
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.
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.

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.
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.

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:

Expand Down
4 changes: 2 additions & 2 deletions pages/price-feeds/how-pyth-works/ema-price-aggregation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ In an EMA the most recent samples receive the most weight, and samples further b

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.

Find the implementation in our [GitHub](https://github.com/pyth-network/pyth-client/blob/852b991fb4403dcf23043752e3a799a40ed0133b/program/src/oracle/upd_aggregate.h).
Find the implementation in [GitHub](https://github.com/pyth-network/pyth-client/blob/852b991fb4403dcf23043752e3a799a40ed0133b/program/src/oracle/upd_aggregate.h).

**How does Pyth calculate its EMA Price and EMA Confidence?**

Expand All @@ -40,4 +40,4 @@ The current Pyth averaging method is a slot-weighted, inverse confidence-weighte

![](../../../images/EMA_Price_Aggregation_2.png)

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).
For more details and explanations, be sure to read dedicated blog post on this topic [here](https://pythnetwork.medium.com/whats-in-a-name-302a03e6c3e1).
12 changes: 6 additions & 6 deletions pages/price-feeds/how-pyth-works/price-aggregation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ The aggregation algorithm is designed to achieve 3 properties. First, it must be

![](../../../images/Price_Aggregation_1.png)

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.
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, aggregating the price to be closer to \$101 than \$110 is appropriate, as in the figure below.

![](../../../images/Price_Aggregation_2.png)

Finally, the **aggregate confidence interval should reflect the variation between publishers prices.**
Under normal market conditions, we expect a product to trade at a similar price across exchanges.
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.
Finally, the **aggregate confidence interval should reflect the variation between publishers' prices.**
Under normal market conditions, it is reasonable to expect a product to trade at a similar price across exchanges.
In these cases, aggregate confidence interval will be preferred to reflect the confidence intervals of the individual data providers, as shown in the figure on the left.
However, in some rare situations, a product can trade at different prices on different exchanges.
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.

Expand All @@ -28,11 +28,11 @@ The second step computes the distance from the aggregate price to the 25th and 7

This process acts like a hybrid between a mean and a median, giving confident publishers more influence, while still capping the maximum influence of any single publisher.
The algorithm has an interpretation as computing the minimum of an objective function that penalizes the aggregate price from deviating too far from the publishers' prices.
This interpretation allows us to prove properties of the algorithm's behavior: for example, the aggregate price will always lie between the 25th and 75th percentiles of the publishers' prices.
This interpretation allows proving properties of the algorithm's behavior: for example, the aggregate price will always lie between the 25th and 75th percentiles of the publishers' prices.

**Scenarios**

We can visualize the operation of this algorithm and objective function in the 4 scenarios from above.
The operation of this algorithm and objective function can be visualized in the 4 scenarios described above.
In the following graphs, the colored bars represent each publisher's price and confidence interval, and the grey dashed lines above depict the publisher's contribution to the overall objective function.
The red line represents the combined objective function, that is, the sum of the dashed grey lines.
The grey circles represent the 25th and 75th percentiles of the votes — the further one of these from the aggregate price determines the confidence interval’s width.
Expand Down
2 changes: 1 addition & 1 deletion pages/price-feeds/pythnet-reference/account-structure.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The Pyth oracle program manages a number of on-chain accounts. There are three d
2. _Price accounts_ store the current price information for a particular product. This account has fields such as the current price, a confidence interval, an exponential moving average price, an exponential moving average confidence interval and whether or not a price is currently available.
3. _Mapping accounts_ serve as a listing of other accounts. The mapping accounts are organized into a linked list whose values are the set of product accounts. These accounts allow applications to enumerate the full list of products whose prices are available on Pyth. 

The [Pyth Rust SDK](https://github.com/pyth-network/pyth-sdk-rs) contains a sample application that prints the current content of all Pyth accounts. We will use the output of this application to better understand the content of these accounts.
The [Pyth Rust SDK](https://github.com/pyth-network/pyth-sdk-rs) contains a sample application that prints the current content of all Pyth accounts. The following sections use the output of this application to better understand the content of these accounts.

**Product Accounts**

Expand Down
Loading
Loading