Skip to content

(refactor)-sunset-solana push oracle #379

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all 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
20 changes: 9 additions & 11 deletions pages/price-feeds/how-pyth-works.mdx
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
# Design Overview

Pyth is a protocol that allows market participants to publish pricing information on-chain for others to use. The protocol is an interaction between three parties:
Pyth is a protocol that allows market participants to publish pricing information on-chain for others to use.
The protocol is an interaction between three parties:

1. _Publishers_ submit pricing information to Pyth's oracle program. Pyth has multiple data publishers for every product to improve the accuracy and robustness of the system.
1. _Publishers_ submit pricing information to Pyth's Oracle program.
Pyth has multiple data publishers for every product to improve the accuracy and robustness of the system.
2. Pyth's _oracle program_ combines publishers' data to produce a single aggregate price and confidence interval.
3. _Consumers_ read the price information produced by the oracle program.
3. _Consumers_ read the price information produced bsy the Oracle program.

Pyth's oracle program runs simultaneously on both Solana mainnet and [Pythnet](how-pyth-works/pythnet.md).
Each instance of the program is responsible for its own set of price feeds.
[Solana Price Feeds](solana-price-feeds.md) are available for use by Solana protocols.
In this case, since the oracle program itself runs on Solana, the resulting prices are immediately available to consumers without requiring any additional work.
[Pythnet Price Feeds](pythnet-price-feeds.md) are available on 12+ blockchains.
Pyth's oracle program runs on [Pythnet](how-pyth-works/pythnet.md).
The prices constructed on Pythnet are transferred [cross-chain](how-pyth-works/cross-chain.md) to reach consumers on these blockchains.

In both cases, 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](how-pyth-works/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.
This program maintains a number of different [Pythnet accounts](how-pyth-works/account-structure.md) that list the products on Pyth and their current price data.
Publishers publish their prices 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 readable by other on-chain programs and available for transmission to other blockchains.
This aggregate price is written to the Pythnet account where it is readable by other on-chain programs and available for transmission to different blockchains.
14 changes: 4 additions & 10 deletions pages/price-feeds/price-feed-ids.mdx
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
# Price Feed IDs

Every Pyth Price Feed has a unique ID, representing the specific pair of assets being priced (e.g., BTC/USD).
Every Pyth Price Feed has a unique ID, representing the specific pair of assets 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, depending on the blockchain, the IDs may be represented in different formats (e.g., hex or base58).
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

On Solana, each feed additionally has a collection of **price feed accounts** containing the feed's data.
The addresses of these accounts are programmatically derived from the feed id and a shard id, which is simply a 16-bit number.
See [How to Use Real-Time Data on Solana](price-feeds/use-real-time-data/solana#write-frontend-code) for more information on price feed accounts.
To use a price feed on-chain, look up its ID using these pages, then store the feed ID in your program to use for price feed queries.
Loading