Difference between revisions of "Pyth Network"

Jump to navigation Jump to search
3,474 bytes added ,  08:12, 12 December 2022
Pythnet and Pyth going cross-chain
(Pythnet and Pyth going cross-chain)
Line 141: Line 141:


* '''Price and Confidence EMA:''' Pyth also offers an exponentially-weighted moving average (EMA) price and exponentially-weighted moving average (EMA) confidence.These values are time-weighted averages of the aggregate price and confidence. Both the EMA price and confidence are natively available from Pyth price accounts.<ref>https://pythnetwork.medium.com/whats-in-a-name-302a03e6c3e1</ref>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. Anyone can find more details about Pyth EMA [https://pythnetwork.medium.com/whats-in-a-name-302a03e6c3e1 here] and the implementation in Pyth’s [https://github.com/pyth-network/pyth-client/blob/852b991fb4403dcf23043752e3a799a40ed0133b/program/src/oracle/upd_aggregate.h GitHub]
* '''Price and Confidence EMA:''' Pyth also offers an exponentially-weighted moving average (EMA) price and exponentially-weighted moving average (EMA) confidence.These values are time-weighted averages of the aggregate price and confidence. Both the EMA price and confidence are natively available from Pyth price accounts.<ref>https://pythnetwork.medium.com/whats-in-a-name-302a03e6c3e1</ref>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. Anyone can find more details about Pyth EMA [https://pythnetwork.medium.com/whats-in-a-name-302a03e6c3e1 here] and the implementation in Pyth’s [https://github.com/pyth-network/pyth-client/blob/852b991fb4403dcf23043752e3a799a40ed0133b/program/src/oracle/upd_aggregate.h GitHub]
== Pythnet and Cross-chain Feeds ==
=== Pythnet ===
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 (except Solana mainnet).
Pythnet is powered by Solana technology: it runs the same validator software, but is a separate network that is specially configured to be a proof-of-authority chain. The network depends on a tightly controlled supply of the chain's native token, called PGAS, which is currently controlled by the Pyth Data Association. Operating a validator on the network requires a large stake of PGAS tokens. The Pyth Data Association allows each data provider to operate one validator by delegating them the necessary stake. Each data provider is then given a sufficient quantity of PGAS tokens to publish prices to the network. The network is configured such that account creation is very expensive, preventing anyone without a substantial quantity of PGAS from deploying programs to the network. Once governance is live, it will take over management of the PGAS token from the Pyth Data Association.
[[File:Pythnet and Pyth Cross-chain .jpg|thumb|Pythnet and Pyth Cross-chain]]
Pythnet allows the network to scale with tremendous efficiency and a highly performant uptime.
Read more about Pythnet [https://docs.pyth.network/how-pyth-works/pythnet here]
=== Cross-chain Feeds ===
Pyth needs a cross-chain component to ferry prices on Pythnet to target chains. Pyth Network uses a “pull” update model for target chain prices: instead of continually pushing updates to each target chain, users pull the prices on-chain when they are needed. This pull model is highly scalable and allows Pyth Network to deliver high-frequency price updates for a large number of products without overwhelming the transaction capacity of target chains (or incurring excessive gas fees).
Data providers publish their prices on Pythnet. The on-chain aggregation program then aggregates prices for a feed to obtain the aggregate price and confidence. Next, the attester program regularly attests to the most recently observed Pyth prices and creates a Wormhole message to be sent to the Wormhole contract on Pythnet. The Wormhole guardians then observe the attestation message and create a signed VAA for the message.
The price service API continually listens to Wormhole for Pyth price update messages. It stores the latest update message in memory and exposes HTTP and websocket APIs for retrieving the latest update. (Anyone can run an instance of this webservice, but the Pyth Data Association runs a public instance for convenience.) When a user wants to use a Pyth price in a transaction, they retrieve the latest update message (a signed VAA) from the price service and submit it in their transaction. The target chain Pyth contract will verify the validity of the price update message and, if it is valid, store the new price in its on-chain storage.
Thanks to Pythnet, Pyth Network is able to expand to other blockchains with minimum friction. Users in other ecosystems can enjoy high-frequency and high-fidelity price updates on many types of assets ranging from crypto, equities, FX, and precious metals.
Read more about Pyth cross-chain [https://docs.pyth.network/how-pyth-works/cross-chain here]


== The Pyth Network Ecosystem ==
== The Pyth Network Ecosystem ==
49

edits

Navigation menu