Difference between revisions of "Pyth Network"

Jump to navigation Jump to search
167 bytes added ,  13:30, 8 May 2022
1. Formatted better the Example under the Claims Process Section 2. Changed a few capital N in Pyth Network to lower case as written in official blogs and other material
m (typo edits)
(1. Formatted better the Example under the Claims Process Section 2. Changed a few capital N in Pyth Network to lower case as written in official blogs and other material)
Line 1: Line 1:
[[File:Pyth Network Logo.jpg|thumb|300x300px|Pyth Network]]
[[File:Pyth Network Logo.jpg|thumb|300x300px|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.
The 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.   
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.   
Line 14: Line 14:
[https://pythnetwork.mypinata.cloud/ipfs/QmZyXccxUfhHjqHevkhWXKw5zWcnFj3NY4JvnrXbkeAEhw Whitepaper release]: January 18, 2022
[https://pythnetwork.mypinata.cloud/ipfs/QmZyXccxUfhHjqHevkhWXKw5zWcnFj3NY4JvnrXbkeAEhw Whitepaper release]: January 18, 2022


On April 7, 2021, Dave Olsen, the President and Chief Investment Officer of [[wikipedia:Jump_Trading|Jump Trading]], announced on [https://podcast.jumpcap.com/public/88/The-Jump-Off-Point-8c500774/b546fd6a The Jump Off Point podcast] that Jump Trading is “collaborating on a world oracle project called Pyth”.<ref>https://podcast.jumpcap.com/public/88/The-Jump-Off-Point-8c500774/b546fd6a</ref> Pyth then revealed its live devnet prices [https://pythnetwork.medium.com/bf6877f8ece3 in mid-May] and showcased its live streaming and sub-second price update capabilities. In June 2021, Pyth released its [https://pyth.network/developers/publishers/migrating_to_version_2 v2 upgrade] smart contract, improving its aggregation method and space for up to 32 data publishers for a single asset. Finally, on August 26, the Pyth Network officially launched on the [[Solana]] [https://pythnetwork.medium.com/the-pyth-network-mainnet-a3d45d2c0f58 mainnet].  
On April 7, 2021, Dave Olsen, the President and Chief Investment Officer of [[wikipedia:Jump_Trading|Jump Trading]], announced on [https://podcast.jumpcap.com/public/88/The-Jump-Off-Point-8c500774/b546fd6a The Jump Off Point podcast] that Jump Trading is “collaborating on a world oracle project called Pyth”.<ref>https://podcast.jumpcap.com/public/88/The-Jump-Off-Point-8c500774/b546fd6a</ref> Pyth then revealed its live devnet prices [https://pythnetwork.medium.com/bf6877f8ece3 in mid-May] and showcased its live streaming and sub-second price update capabilities. In June 2021, Pyth released its [https://pyth.network/developers/publishers/migrating_to_version_2 v2 upgrade] smart contract, improving its aggregation method and space for up to 32 data publishers for a single asset. Finally, on August 26, the Pyth network officially launched on the [[Solana]] [https://pythnetwork.medium.com/the-pyth-network-mainnet-a3d45d2c0f58 mainnet].  


Pyth finished 2021 with over $1B in Total Value Secured (TVS), and facilitated over $7B in trading (including perpetual and synthetics platforms), with 38 announced mainnet integration partners and 41 data publishers.<ref>https://pythnetwork.medium.com/pythiad-6-2021-in-review-2022-in-sight-5e1f4c1743cc</ref> Since then, Pyth TVS reached about $2B spread over 50 integrations and welcomed more than 15 new data publishers.<ref>https://pythnetwork.medium.com/pythiad-6-2021-in-review-2022-in-sight-5e1f4c1743cc</ref>  
Pyth finished 2021 with over $1B in Total Value Secured (TVS), and facilitated over $7B in trading (including perpetual and synthetics platforms), with 38 announced mainnet integration partners and 41 data publishers.<ref>https://pythnetwork.medium.com/pythiad-6-2021-in-review-2022-in-sight-5e1f4c1743cc</ref> Since then, Pyth TVS reached about $2B spread over 50 integrations and welcomed more than 15 new data publishers.<ref>https://pythnetwork.medium.com/pythiad-6-2021-in-review-2022-in-sight-5e1f4c1743cc</ref>  


In January 2022, the [https://pythdataassociation.com/ Pyth Data Association] released the [https://pythnetwork.mypinata.cloud/ipfs/QmZyXccxUfhHjqHevkhWXKw5zWcnFj3NY4JvnrXbkeAEhw Pyth Network whitepaper]. It outlined the design and mechanics around the PYTH token and its role in making the Pyth Network self-sustaining and decentralized. The Pyth Data Association was created to support the Pyth Network. A board of directors oversees the Pyth Data Association.
In January 2022, the [https://pythdataassociation.com/ Pyth Data Association] released the [https://pythnetwork.mypinata.cloud/ipfs/QmZyXccxUfhHjqHevkhWXKw5zWcnFj3NY4JvnrXbkeAEhw Pyth network whitepaper]. It outlined the design and mechanics around the PYTH token and its role in making the Pyth network self-sustaining and decentralized. The Pyth Data Association was created to support the Pyth network. A board of directors oversees the Pyth Data Association.


The Pyth Network has also been involved in several public events within the Solana ecosystem and DeFi. Pyth was a sponsor for the [https://solana.com/solanaszn Solana Season Hackathon] (May 15-June 7, 2020) and the [https://serum-wormhole-hackathon.devpost.com/ Convergence - Serum x Wormhole Hackathon] (January 7-31, 2021). Pyth also held its first own [https://www.youtube.com/playlist?list=PLilwLeBwGuK6TE5QuMos8a8B9uOfS2cm1 workshop] in Chicago for developers looking to learn more about Pyth and building on top of it (January 17-21, 2022). Outside of DeFi, Pyth was a platinum sponsor at the 2022 [https://www.fia.org/events/international-futures-industry-conference?utm_source=FIAWeb&utm_medium=Top FIA Boca Conference] in Florida (March 15-17).
The Pyth network has also been involved in several public events within the Solana ecosystem and DeFi. Pyth was a sponsor for the [https://solana.com/solanaszn Solana Season Hackathon] (May 15-June 7, 2020) and the [https://serum-wormhole-hackathon.devpost.com/ Convergence - Serum x Wormhole Hackathon] (January 7-31, 2021). Pyth also held its first own [https://www.youtube.com/playlist?list=PLilwLeBwGuK6TE5QuMos8a8B9uOfS2cm1 workshop] in Chicago for developers looking to learn more about Pyth and building on top of it (January 17-21, 2022). Outside of DeFi, Pyth was a platinum sponsor at the 2022 [https://www.fia.org/events/international-futures-industry-conference?utm_source=FIAWeb&utm_medium=Top FIA Boca Conference] in Florida (March 15-17).


==General Concepts==
==General Concepts==
Line 87: Line 87:
The Human judges’ role is not to answer yes or no the claim is valid but rather to report several pieces of (public) information:
The Human judges’ role is not to answer yes or no the claim is valid but rather to report several pieces of (public) information:


* What was the minimum and maximum price for the product during the time interval in question on a fixed set of reference exchanges.
* What was the minimum and maximum price for the product during the time interval in question on a fixed set of reference exchanges (''those'' ''will be selected in advance per-product by Pyth protocol governance'').
* The maximum and minimum Pyth aggregate price and maximum confidence interval during the time in question.
* The maximum and minimum Pyth aggregate price and maximum confidence interval during the time in question.


* The maximum and minimum price per publisher and maximum confidence interval during the time in question.
* The maximum and minimum price per publisher and maximum confidence interval during the time in question.
'''''Note that the reference exchanges will be selected in advance per-product by Pyth protocol governance.'''''
The claim will be successful if (1) the price feed published an aggregate price during the claim interval, and if (2) the published aggregate price, incorporating any uncertainty provided by the confidence interval, disagrees with the reference prices.  
The claim will be successful if (1) the price feed published an aggregate price during the claim interval, and if (2) the published aggregate price, incorporating any uncertainty provided by the confidence interval, disagrees with the reference prices.  


The algorithm for comparing the prices constructs two ranges. The Pyth Network price range extends from the minimum aggregate price minus 3 confidence intervals to the maximum aggregate price plus 3 confidence intervals. The Human price range extends from the reference exchange with the lowest reported price to the one with the highest reported price. The claim is successful if these two ranges do not overlap – this indicates that the Pyth aggregate price and confidence are highly improbable according to these reference exchange.
The algorithm for comparing the prices constructs two ranges. The Pyth network price range extends from the minimum aggregate price minus 3 confidence intervals to the maximum aggregate price plus 3 confidence intervals. The Human price range extends from the reference exchange with the lowest reported price to the one with the highest reported price. The claim is successful if these two ranges do not overlap – this indicates that the Pyth aggregate price and confidence are highly improbable according to these reference exchange.


If the claim is successful, the algorithm will then additionally identify a set of at-fault publishers, slash their stake, and then redistribute it to paying end-users according to the share of fees they paid. The algorithm identifies at-fault publishers using the same algorithm applied to the publisher’s price and confidence instead of the aggregate price and confidence.
If the claim is successful, the algorithm will then additionally identify a set of at-fault publishers, slash their stake, and then redistribute it to paying end-users according to the share of fees they paid. The algorithm identifies at-fault publishers using the same algorithm applied to the publisher’s price and confidence instead of the aggregate price and confidence.


<u>Example:</u>
<u>'''Example:'''</u>
{| class="wikitable"
|+Pyth Network BTC/USD Price on 01/01/2022 @ 08.00.00AM
!
!Price ($)         
!Confidence Interval (+/- $)
|-
|Pyth Publisher A
|51,000
|1,000
|-
|Pyth Publisher B
|50,000
|500
|-
|Pyth Publisher C
|49,000
|1,000
|-
|'''Pyth Output'''
|          '''50,000'''
|                  '''750'''
|}
''Note that 1,000 is an unusually wide confidence interval for bitcoin. The typical confidence interval is ~50 (0.1%).''


''Reference Exchanges selected by governance for the Claims Process on Bitcoin were: Coinbase and Binance. Note that in practice, more reference exchanges will be used.''
''Reminder that the Pyth network price range extends from the minimum aggregate price minus 3 confidence intervals to the maximum aggregate price plus 3 confidence intervals.''


''Let's assume the following for 01/01/2022 @ 08.00.00AM:''
So the '''Pyth price range extends from''' '''47,750 to 52,250.''


''Pyth BTC Aggregated Price = 50,000 +/- 1,000''
Now, let's assume the Pyth Governance selected Coinbase and Binance as the reference exchanges for any BTC/USD Claim Process and the Human Job returned the following values:
{| class="wikitable"
|+Human Protocol BTC/USD on 01/01/2022 @ 08.00.00AM
!
!Lowest Reported Price ($)
!Highest Reported Price ($)
|-
|Coinbase
|46,500
|46,750
|-
|Binance
|46,750
|47,300
|}
So the '''Human Protocol price range extends from 46,500 to 47,300.'''


''(Note that 1000 is an unusually wide confidence interval for bitcoin. The typical confidence interval is ~50.)''
In this case, '''the Pyth range''' ($47,750 to $52,250) '''does not overlap with the Human range''' ($46,500 to $47,300). '''Therefore this claim is valid.'''
 
{| class="wikitable"
''So the Pyth price range extends from 47,000 to 53,000.''  
|+'''Identifying at-fault Pyth Publishers'''
 
!
''Now, let's assume that Human protocol returns the following:''
!Lowest Reported Price ($)
 
!Highest Reported Price ($)
''Coinbase BTC price = 45,000''
|-
 
|Human Protocol
''Binance BTC price = 46,000''
|46,500
 
|47,300
''So the Human price range extends from 45,000 to 46,000.''
|-
 
|Pyth Publisher A
''In this case, the Pyth range (47k to 53k) does not overlap with the Human range (45k to 46k).''
|48,000
 
|54,000
''Therefore this claim is valid.''
|-
 
|Pyth Publisher B
''The next step is then to identify the publishers that did not fall within the Human price range. Those publishers' stake will then get slashed and paid out to end-users having contributed data fees.''
|48,500
 
|51,500
''Pyth Publishers Inputs:''
|-
 
|Pyth Publisher C
''Pyth Publishers Inputs:''
|46,000
 
|52,000
''Pub A BTC Price = 55,000 +/- 1,000''
|}
 
'''Pyth Publishers A & B do not overlap with the Human Protocol range and so are automatically identified as at-fault publishers. Their stake is slashed and paid out to voluntarily paying users.'''
''Pub B BTC Price = 50,000 +/- 500''
 
''Pub C BTC Price = 45,000 +/- 1,000''
 
''Pub A BTC Range = 52,000 < x < 58,000''
 
''Pub B BTC Price = 48,500 < x < 51,500''
 
''Pub C BTC Price = 42,000 < x < 48,000''
 
''A reminder that the Human price range extends from 45,000 to 46,000.''
 
''→ Publishers A & B are outside of this range and so are automatically identified as at-fault publishers.''
 
''Their stake is slashed and paid out to voluntarily paying users.''


== Pyth Network Products ==
== Pyth Network Products ==
Line 151: Line 172:


=== Data Feeds ===
=== Data Feeds ===
Pyth’s ‘main product’ is its set of live price feeds. Find all the price feeds available on the Pyth Network [https://pyth.network/markets/ website].
Pyth’s ‘main product’ is its set of live price feeds. Find all the price feeds available on the Pyth network [https://pyth.network/markets/ website].


Each feed admits to the following features:
Each feed admits to the following features:
Line 159: Line 180:
* '''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.
* '''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 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]
* '''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]


== The Pyth Network Ecosystem ==
== The Pyth Network Ecosystem ==
Line 167: Line 188:
=== Publishers ===
=== Publishers ===
[[File:Pyth Data Publishers.jpg|thumb|Pyth Data Publishers]]
[[File:Pyth Data Publishers.jpg|thumb|Pyth Data Publishers]]
The Pyth Network is made up of proprietary (first-party) data providers that contribute their data (inputs) on-chain to the Pyth program and create derived outputs. By having a diverse group of data publishers, ranging from exchanges (US accredited or Crypto) to trading firms and other financial services providers, the Pyth Network creates a completely new composite market data stream at quality levels previously inaccessible.
The Pyth network is made up of proprietary (first-party) data providers that contribute their data (inputs) on-chain to the Pyth program and create derived outputs. By having a diverse group of data publishers, ranging from exchanges (US accredited or Crypto) to trading firms and other financial services providers, the Pyth network creates a completely new composite market data stream at quality levels previously inaccessible.


There are more than 55 publicly announced data providers. The full list of publishers can be found on the Pyth website [https://pyth.network/publishers/ here].
There are more than 55 publicly announced data providers. The full list of publishers can be found on the Pyth website [https://pyth.network/publishers/ here].
12

edits

Navigation menu