Skip to content

(refactor)-solana sunset #391

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 3 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
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
5 changes: 2 additions & 3 deletions pages/price-feeds/how-pyth-works.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ Pyth is a protocol that allows market participants to publish pricing informatio
3. _Consumers_ read the price information produced by the oracle program.

Pyth's oracle program runs on [Pythnet](how-pyth-works/pythnet.md).
[Pythnet Price Feeds](./) are available on 50+ blockchains.
The prices constructed on Pythnet are transferred [cross-chain](how-pyth-works/cross-chain.md) to reach consumers on these blockchains.

The critical component of the system is the [oracle program](how-pyth-works/oracle-program.md) that combines the data from each individual publisher.
This program maintains a number of different [Solana accounts](pythnet-reference/account-structure.md) that list the products on Pyth and their current price data.
This program maintains a number of different [SVM accounts](pythnet-reference/account-structure.md) that list the products on Pyth and their current price data.
Publishers publish their price and confidence by interacting with the oracle program on every slot.
The program stores this information in its accounts.
The first price update in a slot additionally triggers [price aggregation](how-pyth-works/price-aggregation.md), which combines the price data from the previous slot into a single aggregate price and confidence interval.
This aggregate price is written to the Solana account where it is available for transmission to other blockchains.
This aggregate price is written to these SVM accounts of Pythnet where it is available for transmission to other blockchains.
2 changes: 1 addition & 1 deletion pages/price-feeds/how-pyth-works/oracle-program.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The oracle program is responsible for several tasks:
3. Combining the individual data providers' prices into a single aggregate price and confidence interval.
4. Performing any additional stateful computations on the resulting price series, such as computing moving averages.

The oracle solves these problems by maintaining a collection of [Solana accounts](../pythnet-reference/account-structure.md) to represent the set of price feeds.
The oracle solves these problems by maintaining a collection of [SVM accounts](../pythnet-reference/account-structure.md) to represent the set of price feeds.
Each feed has two accounts: a product account to store [metadata](../pythnet-reference/product-metadata.md) and a price account.
The price account stores a list of authorized data providers for this specific price feed, and allocates storage space for each data provider's price.
The oracle program exposes an instruction called `upd_price` that enables an authorized data provider to update the price account with their current estimate of the price and confidence interval.
Expand Down
4 changes: 2 additions & 2 deletions pages/price-feeds/how-pyth-works/price-aggregation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Second, the **aggregate price should appropriately weight data sources with diff
![](../../../images/Price_Aggregation_2.png)

Finally, the **aggregate confidence interval should reflect the variation between publishers’ prices.**
Under normal market conditions, we expect the a product to trade at a similar price across exchanges.
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.
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 @@ -24,7 +24,7 @@ In these cases, the aggregate confidence interval should widen out to reflect th

The aggregation algorithm itself is a simple two-step process.
The first step computes the aggregate price by giving each publisher three votes — one vote at their price and one vote at each of their price +/- their confidence interval — then taking the median of all the votes.
The second step computes distance from the aggregate price to the 25th and 75th percentiles of the votes, then selects the larger of the two as the aggregate confidence interval.
The second step computes the distance from the aggregate price to the 25th and 75th percentiles of the votes, and then selects the larger of the two as the aggregate confidence interval.

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.
Expand Down
3 changes: 1 addition & 2 deletions pages/price-feeds/how-pyth-works/pythnet.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ Pythnet is an application-specific blockchain operated by Pyth's data providers.
This blockchain is a computation substrate to securely combine the data provider's prices into a single aggregate price for each Pyth price feed.
Pythnet forms the core of Pyth's off-chain price feeds that serve all blockchains.

Pythnet is powered by Solana technology: it runs the same validator software, but is a Pyth specific chain that is independent of Solana's mainnet.
Pythnet is powered by Solana technology: it runs the same validator software but is a Pyth-specific chain that is independent of Solana's mainnet.
The Pyth Data Association enables each data provider to operate one validator by delegating them the necessary stake.
Once governance is live, it will take over management of validators from the Pyth Data Association.

The purpose of Pythnet is to provide a secure and reliable computing substrate for Pyth's price aggregation.
Recall that Pyth's data providers submit their own price measurements for each product.
Expand Down
5 changes: 2 additions & 3 deletions pages/price-feeds/price-feed-ids.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
Every Pyth Price Feed has a unique ID, representing the specific pair of assets being priced (e.g., BTC/USD).
Every price update is tagged with the corresponding price feed ID.
Applications need to store the IDs of the feeds they wish to read.
However, the ids may be represented in different formats (e.g., hex or base58) depending on the blockchain.
Price feeds also have different ids in the Stable and Beta channels.
However, the IDs may be represented in different formats (e.g., hex or base58) depending on the blockchain.
Price feeds also have different IDs in the Stable and Beta channels.

The full catalog of price feeds is listed on the [pyth.network website](https://pyth.network/price-feeds/).
The [Price Feed ID reference](https://pyth.network/developers/price-feed-ids) also lets you identify a feed's ID in your chosen ecosystem.
To use a price feed on-chain, look up its ID using these page, then store the feed id in your program to use for price feed queries.

## Solana Price Feed Accounts

Expand Down
Loading