Difference between revisions of "Pyth Network"

Jump to navigation Jump to search
59 bytes removed ,  18:43, 5 May 2022
no edit summary
(Minor edits on the sub-headers, and added a few images)
Line 1: Line 1:
[[File:Pyth Network Logo.jpg|thumb|Pyth Network]]
Pyth Network is a first-party financial oracle network designed to publish continuous real-world data on-chain in a tamper-resistant, decentralized, and self-sustainable environment. [[File:Pyth Network Logo.jpg|thumb|Pyth Network]]The network incentivizes market participants — exchanges, market makers, and financial services providers — to share directly on-chain the price data collected as part of their existing operations. The network then aggregates this first-party price data (still on-chain) and makes it available for free to either on- or off-chain applications.<ref>https://pyth.network/whitepaper</ref> End-users of Pyth data can elect to pay data fees to gain protection against a potential oracle failure as well as attract additional publishers to make the network more robust.  
Pyth Network is a first-party financial oracle network designed to publish continuous real-world data on-chain in a tamper-resistant, decentralized, and self-sustainable environment.  
 
The network incentivizes market participants — exchanges, market makers, and financial services providers — to share directly on-chain the price data collected as part of their existing operations. The network then aggregates this first-party price data (still on-chain) and makes it available for free to either on- or off-chain applications.<ref>https://pyth.network/whitepaper</ref> End-users of Pyth data can elect to pay data fees to gain protection against a potential oracle failure as well as attract additional publishers to make the network more robust.  


==History==
==History==
Line 35: Line 32:


=== The Price of an Asset ===
=== The Price of an Asset ===
Consider a single stock, say [[wikipedia:Tesla,_Inc.|TSLA]].  
[[File:Pyth Feed Real-Time.png|thumb|Pyth Price and Confidence Interval]]Consider a single stock, say [[wikipedia:Tesla,_Inc.|TSLA]].  


“What is the price of TSLA?” is a seemingly simple question, but there are subtle complications.
“What is the price of TSLA?” is a seemingly simple question, but there are subtle complications.
Line 44: Line 41:


Another “price” that could be considered the proper price is actual transaction prices. “Last traded price” is a price that is often reported, and especially in a thinly traded stock, might be even more representative of the true price than the current best bid and best ask prices (where the bid-ask spread might be very wide).<ref name=":0">https://pythnetwork.medium.com/what-is-confidence-uncertainty-in-a-price-649583b598cf</ref>
Another “price” that could be considered the proper price is actual transaction prices. “Last traded price” is a price that is often reported, and especially in a thinly traded stock, might be even more representative of the true price than the current best bid and best ask prices (where the bid-ask spread might be very wide).<ref name=":0">https://pythnetwork.medium.com/what-is-confidence-uncertainty-in-a-price-649583b598cf</ref>
[[File:Pyth Feed Real-Time.png|thumb|Pyth Price and Confidence Interval]]
=== Uncertainty (or “Confidence”) in a Price ===
=== Uncertainty (or “Confidence”) in a Price ===
In scientific and engineering fields, observation or measurement is almost always accompanied by a measurement of uncertainty. The distance between two points might be measured to be 10.12m +/- 0.01m. The time it took for a car to travel that distance might be 1.23s +/- 0.05s. The measurement of uncertainty is the observer’s best estimate of how far off from the “true” value their measurement is likely to be, given the precision of their measuring equipment, the difficulty in making the measurement, and potentially other factors the observer deems important.
In scientific and engineering fields, observation or measurement is almost always accompanied by a measurement of uncertainty. The distance between two points might be measured to be 10.12m +/- 0.01m. The time it took for a car to travel that distance might be 1.23s +/- 0.05s. The measurement of uncertainty is the observer’s best estimate of how far off from the “true” value their measurement is likely to be, given the precision of their measuring equipment, the difficulty in making the measurement, and potentially other factors the observer deems important.
Line 75: Line 70:


=== Network Interactions ===
=== Network Interactions ===
The Pyth protocol consists of 4 on-chain core mechanisms:
[[File:Pyth Ecosystem Diagram.png|thumb|Pyth Ecosystem Diagram]]The Pyth protocol consists of 4 on-chain core mechanisms:


* '''Price aggregation''' combines individual publishers' reported prices and confidence intervals into a single price feed and confidence interval feed for a specific product (e.g. BTC/USD feed). This mechanism is designed to produce robust price feeds — feeds whose prices cannot be significantly influenced by small groups of publishers.
* '''Price aggregation''' combines individual publishers' reported prices and confidence intervals into a single price feed and confidence interval feed for a specific product (e.g. BTC/USD feed). This mechanism is designed to produce robust price feeds — feeds whose prices cannot be significantly influenced by small groups of publishers.
* '''Data staking''' allows delegators to stake tokens to earn data fees. The delegators in aggregate also determine the level of influence (stake-weight) that each publisher has on the aggregate price. In addition, this mechanism determines whether delegators' stakes are slashed. Finally, the mechanism collects data fees from consumers and distributes a share to delegators (initially set at 80%). The remainder (20%) goes into a reward pool distributed among publishers. The 80/20 fee distribution initially set may be adapted at any point with a governance proposal.
* '''Data staking''' allows delegators to stake tokens to earn data fees. The delegators in aggregate also determine the level of influence (stake-weight) that each publisher has on the aggregate price. In addition, this mechanism determines whether delegators' stakes are slashed. Finally, the mechanism collects data fees from consumers and distributes a share to delegators (initially set at 80%). The remainder (20%) goes into a reward pool distributed among publishers. The 80/20 fee distribution initially set may be adapted at any point with a governance proposal.
* '''Reward distribution''' determines the share of the reward pool earned by each publisher. Each product has a reward pool that delegators can stake into. The reward distribution mechanism preferentially rewards publishers with higher quality price feeds and reduces the likelihood that uninformed publishers will earn rewards.
* '''Reward distribution''' determines the share of the reward pool earned by each publisher. Each product has a reward pool that delegators can stake into. The reward distribution mechanism preferentially rewards publishers with higher quality price feeds and reduces the likelihood that uninformed publishers will earn rewards.
* '''Governance''' will be using a coin-voting system that will help determine the high-level parameters of the three mechanisms above. Parameters include what types of tokens may be used for data fees; which products are listed on Pyth; the share of data fees allocated to publishers, delegators, and other uses; the number of PYTH tokens that publishers must stake or enable claims to be filed against a product, and more.[[File:Pyth Ecosystem Diagram.png|thumb|Pyth Ecosystem Diagram]]
* '''Governance''' will be using a coin-voting system that will help determine the high-level parameters of the three mechanisms above. Parameters include what types of tokens may be used for data fees; which products are listed on Pyth; the share of data fees allocated to publishers, delegators, and other uses; the number of PYTH tokens that publishers must stake or enable claims to be filed against a product, and more.


=== The Claims Process ===
=== The Claims Process ===
Line 156: Line 151:


* '''Continuous Streaming:''' Thanks to Solana, Pyth is able to stream data at a sub-second latency and at affordable costs. The network’s publishers can update prices at every Solana slot — currently once every 400ms.
* '''Continuous Streaming:''' Thanks to Solana, Pyth is able to stream data at a sub-second latency and at affordable costs. The network’s publishers can update prices at every Solana slot — currently once every 400ms.
* '''Sophisticated Aggregation:''' As a reminder, the Pyth program computes this price on-chain by aggregating individual publishers' prices and confidence intervals. The first step of the algorithm 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 — and by then taking the median of all the votes.  The second step computes the 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.  Overall, the aggregate price will always lie within the 25th-75th percentile of the publisher’s prices. In addition, Pyth is working on a staking system for publishers that incentivizes them to provide accurate data. In that system, each publisher will have a varying amount of stake. All of the results also hold for stake weights if Pyth replaces the percentage of publishers with the percentage of stake controlled. In the future, the weight calculation can be extended to include other non-price factors such as publisher’s stake, historical publisher’s performance, and other relevant metrics. For more information, please visit the Pyth [https://docs.pyth.network/how-pyth-works/price-aggregation docs].
* '''Sophisticated Aggregation:''' As a reminder, the Pyth program computes this price on-chain by aggregating individual publishers' prices and confidence intervals. The first step of the algorithm 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 — and by then taking the median of all the votes.  The second step computes the 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.  Overall, the aggregate price will always lie within the 25th-75th percentile of the publisher’s prices. In addition, Pyth is working on a staking system for publishers that incentivizes them to provide accurate data. In that system, each publisher will have a varying amount of stake. All of the results also hold for stake weights if Pyth replaces the percentage of publishers with the percentage of stake controlled. In the future, the weight calculation can be extended to include other non-price factors such as publisher’s stake, historical publisher’s performance, and other relevant metrics. For more information, please visit the Pyth [https://docs.pyth.network/how-pyth-works/price-aggregation docs].
* '''Confidence Interval:''' Each Pyth publisher reports both a price estimate and confidence interval (for that estimate) to be aggregated, and the aggregated price will have its own aggregated confidence interval value.   The confidence interval represents the width around their price estimate in which they believe the true price probably lies. Different publishers have access to different sorts of data and may have [https://docs.pyth.network/how-pyth-works/price-aggregation different methods] of calculating their price estimate and confidence.<ref>https://docs.pyth.network/how-pyth-works/price-aggregation</ref> This confidence value will inform users of the data of the perceived strength of the output. Publishers can acknowledge the low liquidity environment on the traded venue and choose to adjust their confidence accordingly. Applications using Pyth Network prices can respond to this extra information accordingly for greater flexibility and security. Synthetic asset platforms, for example, could choose to scale liquidity at a price with the confidence reported rather than allow infinite liquidity for mints/redeems on every price (and confidence level).   The Pyth Network empowers data consumers by continuously publishing a consolidated estimate of these important price reporting dislocations.
 
* '''Price and Confidence EMA:''' Pyth Network 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>[[File:Pyth EMA Chart.png|thumb|Pyth EMA Chart]]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]
* '''Confidence Interval:''' Each Pyth publisher reports both a price estimate and confidence interval (for that estimate) to be aggregated, and the aggregated price will have its own aggregated confidence interval value.The confidence interval represents the width around their price estimate in which they believe the true price probably lies. Different publishers have access to different sorts of data and may have [https://docs.pyth.network/how-pyth-works/price-aggregation different methods] of calculating their price estimate and confidence.<ref>https://docs.pyth.network/how-pyth-works/price-aggregation</ref> This confidence value will inform users of the data of the perceived strength of the output. Publishers can acknowledge the low liquidity environment on the traded venue and choose to adjust their confidence accordingly. Applications using Pyth Network prices can respond to this extra information accordingly for greater flexibility and security. Synthetic asset platforms, for example, could choose to scale liquidity at a price with the confidence reported rather than allow infinite liquidity for mints/redeems on every price (and confidence level). The Pyth Network empowers data consumers by continuously publishing a consolidated estimate of these important price reporting dislocations.
 
* '''Price and Confidence EMA:''' Pyth Network 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]


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

edits

Navigation menu