Pyth Network: A Deep Dive
The Decentralized Oracle for the Future, providing reliable Data from First-Party Publishers for everyone.
“Data is the new Oil”.
Data has become the most valuable asset in the 21st Century. All our lives are governed by an infinitely large matrix of Data produced by the entire world. It decides the stock prices, the weather predictions, your content page on Twitter or Instagram and the outcomes of Geopolitical events. The influence of Data in our Life decisions & the world of Business, continues to rise.
All upcoming technologies like Artificial Intelligence & Genomics leverage the potential of Data to provide better results & increase their efficiency. Today, we’ll be exploring how the Web3 & Blockchain world is using Data to refine technologies & benefit consumers.
The Peculiar Case of Blockchain
Blockchain is a distributed Ledger of records. It is essentially a Peer-to-Peer network where all records of Activity & transactions are stored not in a Central Server but across all participants in form of decentralised chains of Blocks (Information Packets). Immutable records of all activities are stored and are searchable.
But here’s the interesting thing, Blockchains are isolated systems. All of this computing power & transactions have no connection to the world outside. All of these historic records but the Blockchain can’t tell what time it is in Australia or what is the current price of Gold. Blockchains themselves cannot interact with real-world Data.
In words of Imad Ali : “The blockchain is sort of like a supercomputer with no internet connection.”
Oracles come to the rescue
‘Oracle’ was a term used in ancient Greece, that referred to a person connecting the common masses with God & answering all there questions.
This is exactly what Oracle networks do for Blockchains. They act as a connecting tool between the Smart Contracts on Blockchain & the Data from outside world.
📝 Smart Contracts are certain commands that are an agreement between multiple parties. They are immutable pieces of code on the Blockchain. They are executed when specified conditions are met. Essentially a tool to decide what transactions take place on a Blockchain based on certain conditions.
Oracles can relay any form of Data from any source as per the need of the smart contract. Here’s an example:
Imagine you write a smart contract on Solana Blockchain, that will transfer 5 SOL to your Friend’s wallet at 5:00 PM IST on 27/10/2022.
Now the transaction is fairly simple here, deduct 5 SOL from your wallet & add 5 SOL to your Friend’s wallet, but How will the Blockchain know it is the right time to schedule the transfer?
Here you can integrate an Oracle, that will share the current Time & Date with the Smart Contract every second. Once the specified Time & Date arrives, the Smart Contract will make the Transaction.
The Off-chain Data used here was Time. You could take Asset prices, Weather Conditions, Social Media Stats, Sports Outcomes….. There is no end to the types of Data that can be used.
Today, we’ll be discussing a very unique Decentralised Oracle Network. Are you ready? Let’s Dive in! 🌊
Pyth Network
The Pyth Network is a Decentralized Oracle. It specializes in making once-exclusive Financial Data (Asset prices) available to DeFi protocols & the general public. We’ll be exploring the functioning of this Oracle in-depth, let’s begin!
DeFi stands for Decentralized Finance. These are protocol that bring regular Financial practices like Lending, Borrowing, Investing & Staking On-chain with the Blockchain technology. Read my previous article to know more here.
The word ‘Pyth’ is derived from ‘Pythia’, an Oracle from ancient Greece. Like any other Oracle, the Pyth Network connects real world Data with Smart Contracts on Blockchain.
Pyth presently focuses on Financial Data; i.e Prices of Stocks, Crypto currencies, Metals, etc.
This type of Data is essential for Markets around the world. It is used by Traders & Investors to plan their investments. Every person needs this Data to decide what Stock to buy or which Cryptocurrency to invest in. It is particularly helpful for Large Exchanges, Banks & Investment Funds. The final form of this Data is charts on our screens.
Now that the Internet is adopting Blockchain, it is only Logical for this Financial Data to be available on-chain. This is the Vision of Pyth Network.
Here’s what we’ll be discussing Today:
Overview of the Pyth Network
Tokenomics
Participants in the Pyth Network
→ Publishers
→ Delegators
→ Consumers
→ Node ProvidersMechanisms of the Pyth Network
→ Price Aggregation
→ Data Staking
→ Reward Distribution
→ GovernanceWhat if the Data is inaccurate?
Pyth Network Vs Legacy Oracles
Pyth Network’s Journey
My closing Thoughts
Overview of the Pyth Network
In General, all oracles have the following basic Structure:
But in case of Pyth Network, the objective is not to just deliver Data, but to ensure that:
→ The Data is Accurate & properly sourced.
→ All participants are incentivized.
→ All processes of the Network are Transparent.
→ Necessary protocols are in place to deal with erroneous Data.
To ensure that the Network as a whole meets all the aforementioned objectives, the Pyth Network is designed in the following Structure:
The Purple Ovals depict Network Participants & the Purple circles depict Mechanisms.
Now, the structure here may seem complex (because it is designed to deliver robust data), we’ll break it down & understand it. 👍
Tokenomics of Pyth Network
Since the entire Oracle is a decentralized Ecosystem, the PYTH Token plays a key role in the functioning. Here’s how it is used:
All rewards & incentives on the Network are in form of PYTH Tokens.
PYTH Tokens are also used for Staking & paying Data Fees.
They are a prerequisite for anyone to vote & involve in the Governance of the Network.
The plan is for 10 Million PYTH Tokens to exist. 85% of these tokens will remain locked at the time of Launch and will be released monthly over a period of 7 years with an initial 1 year cliff.
Note that there are no PYTH Tokens in circulation at the time of writing. Only details and mentions to the Tokenomics are from the Pyth Whitepaper. Tokens are yet to be launched.
Participants in the Pyth Network
The entire Pyth Network has 4 main Participants that run the Oracle. They are:
Publishers: These are the sources of Data. Pyth mainly relies on Institutions & Firms that have access to live market data (First-party Publishers). This includes Exchanges & Firms who can provide Original & timely data. They are incentivized with PYTH tokens based on the quantity & quality of Data that they share.
Delegators: There role is to stake tokens on a particular product & publisher. They essentially vouch for a publisher & stand a chance to earn a share of their reward (PYTH Tokens) or lose their stake if inaccurate Data is published. They make to Network more robust because their stakes affect the impact Publisher’s Individual data has on the Aggregated Data. (Aggregation will be discussed as we move ahead)
Consumers: They are the end-users of this Data. Every individual can become a consumer, but it is usually DeFi, AMM (Automated Market Makers) & other Protocols that incorporate this Data on-chain for their use. They may pay Data fees (PYTH Tokens) in return for guarantee of a payout if inaccurate Data is shared. These Data fees incentivize Publishers & Delegators.
Node Providers: Nodes are single processing units in a Blockchain Network. A node provider is essentially a collection of nodes that allow the Pyth Network to operate upon them. They are required, because the Pyth Oracle is decentralized & cannot me managed from a single Computer Server.
Note:
A participant can play multiple roles in the network, they can be the Publisher or Delegator or Consumer of Data at the same time.
Data fees may be collected in other types of tokens if such a proposal is approved by the network via Governance.
Anyone can apply to become a Publisher (Click here) by filling an application form.
Mechanisms of the Pyth Network
Now that we’ve understood the participants in the network, let’s understand the entire process of the Data being sourced to it being delivered. We’ve broken this down into 4 steps:
Price Aggregation
Pyth sources from first-party Publishers, but to ensure robustness of Data same information is collected from multiple sources. This process avoid a single point of failure in the Network. Now, the consumers can’t use multiple Data sources and need a median solution; Pyth now uses the most crucial Mechanism of Price Aggregation. It combines each individual price & confidence feed into a single aggregate form.
If a publisher’s price for a random stock is $10 ± 2, it implies that the stock value is between $8 - $12. The ‘± 2’ portion of the price is the Confidence feed and conveys a probable range. It depicts the uncertainty of the price data.
This mechanism is on-chain & is designed to be resistant to any form of Price manipulation. This is done by assigning a stake to a Publisher, which is done by:
Analyzing their previously shared Data, Confidence interval, Delegator’s stake & several other factors.
Analyzing how well does their current price data align with the predicted price in the future by a specialized Algorithm on Pyth Network.
Based on these factors, the more stake that a Publisher has, the more influence will their price have on the final Aggregate price.
Data Staking
This mechanism involves the Tokenomics of the network. ‘Staking’ means supporting. The Pyth network allows every participant to support the Network & benefit from their contributions in the following way:
Publishers are required to stake certain amount of PYTH tokens for every Asset price they’ll be providing Data for. These tokens can be slashed & payed out to consumers if inaccurate Data is provided. Every Publisher is assigned a Stake Weight (A score of their influence on the Aggregate Price).
Consumers can choose to pay Data fees in form of PYTH, USDC or any other governance tokens to incentivize Publishers. In exchange, consumers are entitled to receive a payout if inaccurate Data is found to be published.
Delegators are required to stake PYTH token on the selected asset & publisher. These staked token offer them a chance to earn certain percentage of the Data fee collected by the Publisher (Initially, 80% of fees will go to Delegators but as the Network matures, this number will reduce). They may also lose these tokens if the Publisher publishes inaccurate Data.
Reward Distribution
This mechanism decides how the total reward pool (Collected Data Fees) are distributed amongst the Publishers. The main idea is to:
Reward Publishers that contribute most accurate & timely data to the Network.
→ More Quality = More Reward Proportion
Encourage Publishers to share all available data (including private pricing information) honestly to make the aggregate price more robust.
→ Honest Data = Quality Aggregate price = More reward proportionPrevent Publishers that exploit the Network Data for personal gain or purposefully share erroneous data from being rewarded.
→ Bad Data = Less/No Reward Proportion
In order to make this process of assessing a Publisher’s contribution, Pyth launched Publisher’s Metrics, an analytics feature in the Pyth Network that allows everyone to see how a particular Publisher has contributed to the Network. This includes:
These metrics are used by Consumers to check the quality of Data. They are used by Delegators to understand a Publisher’s contribution before staking on it. They allows Publishers' to monitor their Contributions and make changes if required.
The Platform Algorithm finally uses a combination of scores from the above metrics to determine how a particular Publisher will be rewarded. This is a combination of Stake Weight (See Data Staking👆) + Quality Score (Graph above) + Calibration Score (Graph above).
Governance
In the initial stage, all decisions concerning Pyth Network are made by Pyth Data Association. Once the PYTH token is launched, the control will eventually be handed over to an on-chain Governance Protocol.
This Decentralized Governance will follow a coin-voting system. Anyone with a minimum number of Staked PYTH Token will be allowed to introduce & vote upon proposals. This applies to all decisions & changes made by the Network. A few examples are:
Giving approval for Software updates to the on-chain program.
Determining the minimum PYTH tokens that Publishers should stake.
Giving approval to types of Token accepted as Data Fees.
What if the Data is inaccurate?
Let’s imagine a scenario where inaccurate data was published by a particular Publisher. In this scenario, the Claims procedure is initiated. Here’s how this goes down:
Any Consumer has the right to file a claim against the Publisher if they believe incorrect data was published. They’ll have to bond some PYTH tokens to issue a claim along with a prior payment for the Human Protocol. (They will be reimbursed if claim is ratified).
The Human Protocol (Open-source Software by Pyth Network) collects the alleged incorrect Data from the claimant. This Data is then shared with a group of independent & unbiased Humans. They compare the Price data at claimed instance with off-chain sources and feed their findings to an on-chain Algorithm.
This algorithm then analyzes the results from the Human Protocol and submits an on-chain claim to the Pyth Network.
Now, the PYTH Token Holders vote to either ratify this claim or reject it.
If ratified, a payout is initiated wherein the staked tokens of the Publisher & the Delegators are slashed and distributed proportionally amongst the affected claimants. If the claim is rejected by Token holders, the collected bond & payment are not returned.
Pyth Network Vs Legacy Oracles
Here are the advantages of Pyth Network that separates it from other Legacy Oracles:
Pyth is a First-Party Publisher Oracle : Most of the Legacy oracles don’t have original Data sources; instead, they collect data from 3rd party aggregators or worse directly from publicly available databases. This jeopardizes the accountability of Data & also increases the time interval of the price reaching the end-user. These are called Reporter Oracles. Pyth on the other hand sources its Data from Institutions with access to it & removes all intermediaries to make prices available at the fraction of a second.
Pyth is Transparent & Decentralized : Pyth Network ensures that all processes take place on-chain and are visible to all participants. A single party cannot take decision for the Network, instead Pyth has a well-defined Governance mechanism that ensures democratic decision making.
Pyth operates on-chain : Unlike a lot of other Oracles, all processes in the Pyth Network occur on-chain. An immutable record of these activities remains accessible to the public.
Pyth undergoes frequent updates : The on-chain Data is updated multiple times in a single second! It undergoes about 200,000 updates every day which ensures the most latest Data is available readily.
Pyth Incentivizes Network Participants : It is ensured that the Publishers, Delegators & Consumers are compensated for their contribution to the robustness of the Network, unlike many other oracles.
Pyth operates cross-chain : Yes, you heard it right! Although Pyth originated on the Solana chain, it ain’t stopping there. Pyth is leveraging the potential of Wormhole, to expand cross-chain & provide data to the Ethereum chain, EVM chains (Polygon, BNB), Aptos chain & 20 such Wormhole supported chains.
Wormhole, for our concise understanding acts as a bridge between multiple Blockchains. It is an attestation engine that trustlessly bridges activity from one chain to another. It therefore allows all on-chain Pyth Activity in Solana to be used by consumers from other chains.
All of these advantages give Pyth a competitive edge over other players in the space like Chainlink, Switchboard, SupraOracles, Razor Network & Dia.
Pyth Network’s Journey
Pyth Network launched in April 2021.
It reached Devent in 4 months & launched on the Solana Mainnet in August 2021.
Pyth Network grew at roughly 1 Publisher every week to reach about 70+ active publishers on the Network today.
Pyth Network has over 550K+ downloads by Consumers & Developers.
The Network presently provides Data on US Equities, Cryptocurrencies, Metals & Forex with features like Time weighted Average Price (TWAPs) & Advanced Aggregation & Combination methods.
Find the current 70+ Data Publishers on the Pyth Network here.
Find the current 70+ institution consumers on the Pyth Network here. This includes DeFi Protocols, Decentralized Exchanges (DEX), Stablecoins, Wallets, etc.
The Pyth Network is going cross-chain with Wormhole across 20+ chains. It’s already live on BNB mainnet with Venus. Ribbon Finance on Ethereum is already powered by Pyth. Hashflow will soon be using Pyth Data on Polygon, Avalanche, Optimism, Arbitrum, Ethereum & BNB Chain.
The Pyth Network presently has 7 Infrastructure/node providers : Syndica, P2P, Everstake, Triton, Coinbase Cloud, Blockdaemon & Figment.
The Network has secured more than 90% of total value on the Solana chain with $1.65 Billion in Monthly traded Volume for September 2022
My Closing Thoughts
Pyth Network has certainly demonstrated that their technology has an ever-rising demand in the Financial Market. They are not only making data accessible to the masses but also ensuring that it is of the highest quality.
An interesting challenge in to future will be to ensure that once the PYTH tokens are launched, the Network can assemble as a DAO-like entity with cohesion. If this crucial phase sees any problems, the entire state of the Oracle could change.
I personally enjoyed researching for this Deep Dive & interacting with the Pyth Community via Discord. They are most certainly motivated with a clear vision & in the near future, I could see Pyth to be a Billion Dollar Oracle Network.
References
Aaditya_Alive | @Aaditya_Alive