Deep Dive on PYTH V2: The technology and overall benefits to Solana DeFi
Abstract
This article presents Pyth network, a decentralized oracle solution built on the Solana blockchain, designed to provide real-world data to smart contracts. PYTH recently announced its shift from Push Oracles to Pull Oracle. This article aims to explore Pyth V2 key architecture, benefits, and use cases, and the implications of this new development highlighting its potential to improve the efficiency of decentralized applications (dApps) and its overall benefits to Solana DeFi.
INTRODUCTION
Decentralized finance (DeFi), is a rapidly evolving sector within the blockchain and cryptocurrency space, characterized by financial applications built on decentralized networks, typically Solana, Ethereum, and other blockchains. This technology has revolutionized how people interact with their money, cutting out the need for traditional financial institutions. The advent of blockchain technology and smart contracts has created a need for reliable and accurate external data sources.
▪️ ORACLES
Oracles serve as intermediaries, bridging this gap by providing smart contracts with external data, while ensuring data verifiability, validity, and reliability. By offloading data processing and storage, oracles improve on the scalability limitations that are common to on-chain data management. Oracles, by facilitating communication between these two economies, enable the creation of novel applications, including decentralized finance (DeFi) protocols, gaming platforms, and social media applications, thereby significantly expanding the blockchain’s potential.
This article is a deep research that explores how Pyth v2, the improved oracle solution for Solana, is transforming the ecosystem. The main technology, solutions, innovations, and overall benefits to Solana DeFi.
Here are the topics that will be discussed in this article:
- OVERVIEW OF SOLANA
- OVERVIEW OF PYTH NETWORK
- Push Oracles
- PYTH V2 (PULL ORACLE)
- COMPARATIVE ANALYSIS
- Benefits to Solana Defi
- Use Cases and Adoption
- Conclusion
▪️OVERVIEW OF SOLANA
Solana is a decentralized, open-source blockchain platform that utilizes a novel Proof-of-History (PoH) consensus mechanism, enabling high-performance transaction processing at a significantly reduced cost. Launched in March 2020, Solana’s Layer 1 network adopts a hybrid consensus model, combining PoH with Delegated Proof-of-Stake (DPoS), to achieve scalability, security, and efficiency.
The native token, $SOL, serves as the network’s currency, facilitating transaction fees and validator incentives. Solana’s architecture is designed to support high transaction throughput, ensuring stability and performance through optimized hardware utilization.
The platform supports a diverse ecosystem of decentralized applications (dApps), ranging from various categories, including decentralized finance (DeFi), non-fungible tokens (NFTs), RWAs ( real world assets) and decentralized physical infrastructures (DePIN). Solana’s innovative approach and technological advancements have positioned it as a prominent player in the blockchain landscape.
▪️PYTH NETWORK
Pyth Network is a decentralized oracle solution built on the Solana blockchain, revolutionizing the way smart contracts interact with off-chain data. Pyth Network’s decentralized architecture is designed to provide highly accurate and reliable data feeds, leveraging a network of independent nodes and a token-based incentivization mechanism. This approach ensures that data is validated and trustworthy, enabling smart contracts to make informed decisions.
Pyth supports data from over 40 top-tier institutions in both traditional finance and cryptocurrency markets, such as Bloomberg, Hong Kong Stock Exchange, Nasdaq, Jump Trading, Virtu Financial, GTS, and FTX, one of the major supporters of the Solana blockchain.
▪️PUSH ORACLES
Push oracles autonomously supply smart contracts with data without awaiting explicit requests. These oracles are triggered by pre-defined events or conditions, prompting them to transmit relevant data to the smart contract. For instance, a push oracle may automatically dispatch weather data to a smart contract when the temperature surpasses a predetermined threshold, enabling the smart contract to execute actions based on this external data. This proactive approach enables smart contracts to react to real-world events in a timely and efficient manner, fostering enhanced interoperability between blockchain and off-chain data sources.
Initially, Pyth Oracle (Pyth V1) relied on a push design. This oracle was designed to operate by periodically updating the on-chain price data based on external functions known as triggers. Here’s a breakdown of its operational mechanism.
- Data provider inputs: Data providers are trusted bodies responsible for providing accurate price information through Solana transactions. These providers are the creators, and therefore owners, of their price data
- The Pyth Protocol: The data input provided by data providers contains price estimates.These estimates are aggregated by the Pyth Protocol to generate a single, combined price for each asset. Then, at regular intervals, typically every 400 milliseconds, the Pyth protocol automatically "pushes" the latest aggregated price for each supported asset to the Solana environment. This aggregation mechanism lives on an application-specific blockchain known as Pythnet.
- Data Users: DeFi protocols could then access the most recent price information readily available on-chain.
Being the first mover, Pyth captured significant usage and became a major player in Solana’s DeFi ecosystem. Pyth Oracle accounts for 95% of Solana’s total value secured (TVS) and 100% of the total volume secured.
Though the push oracle design was known for its simplicity, predictability, and volume increase, it also encountered limitations like:
- Congestion issues: High network usage could disrupt the pushing process. During network congestion, transactions might fail or be delayed, resulting in missed price updates. This could create unreliable data, especially in volatile markets.
- Scalability: Pushing updates for every price feed frequently (every 400ms) incurred transaction fees on the Solana blockchain. During periods of network congestion, these fees could become very expensive, limiting the scalability of the system.
- Vulnerabilities: The architecture of Push oracles exposes protocols to vulnerabilities like oracle manipulation. This involves exploiting vulnerabilities in a blockchain oracle to deliberately provide false or outdated information about off-chain events. This manipulation is often a key component of a larger attack on a protocol, enabling malicious actors to deceive smart contracts into executing actions based on inaccurate data, which can result in tangible benefits for the attackers.
These limitations spurred Pyth to adopt a pull model.
▪️PYTH V2: Pull don’t push
Unlike push oracles, pull oracles operate on a request-based mechanism, where smart contracts must explicitly solicit data from the oracle. This process involves the smart contract sending a query to the oracle, which then fetches the requested data and transmits it back to the contract. This approach allows smart contracts to selectively fetch specific data points, promoting efficiency and precision in their decision-making processes.
Pyth employs a streamlined approach, enabling users to request the most recent price update from an off-chain service. The system allows anyone to submit price updates to the Pyth contract on the blockchain, which verifies the accuracy of the update and stores it for future reference.
PYTH V2 three part workflow:
- Publication of prices on-chain efficiently and cheaply: On Pythnet, permissions publishers can publish their price updates for free, compared to generalized blockchains. These publishers can submit these price updates at a valid price to the on-chain oracle program, which, when invoked carries out aggregation on the prices.
- A price broadcast operation performed by the PythNet validators: After the oracle program aggregates these prices, it calls into the message buffer program with the aggregate price of the updated price feeds. The program allows for the creation of a message to be sent across chains and can be called by authorized programs. Here, the prices are stored and the validator reads the buffer’s account, broadcasting to other chains via a cross-chain messaging protocol such as the Wormhole network.
- Relaying occurs on a target chain where Pyth prices are available: Each of theses chains has a Pyth receiver contract which stores a price for every Pyth price feed. These contracts in turn, implement a permissionless operation to update the stored price. The input to this operation is an attested merkle tree root, a price update for a particular symbol that represents a leaf in the corresponding merkle tree, and the path in the tree that leads from that leaf to the root. The latter two can be accessed publicly on Pythnet
This design enables applications to utilize a single, efficient transaction method that updates the price and executes the necessary application logic simultaneously, enhancing overall performance.
▪️COMPARATIVE ANALYSIS: Why is Pyth v2 better?
The Pyth pull oracle has several advantages over the push oracle ranging from reliability, performance, frequency, to efficiency.
- Data Accuracy : Data accuracy is one of the benefits of pull oracles over push oracles. With pull oracles, smart contracts request specific data points, ensuring that the information is fresh and relevant. In contrast, push oracles may provide outdated or unnecessary data, potentially leading to inaccurate decision-making.
To further emphasize on the accuracy of pull Oracles, here is an in-depth analysis of the Pyth feeds for AAVE/USD — A pair in which the quote tokens are of very different market caps and trade on very different sets of exchange.
This analysis uses prices between November 17, 2022, through November 24, 2022 (except where explicitly noted). This week had significant price volatility, making it a good test for oracle accuracy.
- AAVE/USD
For this analysis, we chose AAVE/USD to provide an example of Pyth’s performance for less-liquid tokens. While ETH is extremely liquid (~6.2B USD 24-hour volume), AAVE is relatively illiquid (~64M USD 24-hour volume) and is traded on fewer exchanges.
As the plots above show, the Pyth feed generally tracks the CEX price well, with occasional spikes during highly volatile periods. However, with the exception of these few spikes, we can see that the AAVE price is always tracked closely. This shows the level of accuracy PYTH v2 offers.
2. Larger Coverage: PythV2 provides unparalleled data coverage, supporting a vast network of over 540 price feeds across more than 65 blockchain chains, all accessible permissionlessly. This extensive data infrastructure empowers Solana protocols and users with a vast array of real-time market data. The Pyth pull model has established itself as a comprehensive and reliable oracle solution for the Solana ecosystem.
3. Reduced Latency: The architecture and design enable reduced latency, allowing for faster data transmission and updates. With this, Solana protocols and users can access real-time market data with minimal delay, giving them swift decision-making and efficient application development. The minimal latency, also further enhances the overall performance and reduces operational costs when compared to the push model.
▪️PYTH V2: Benefits and impacts on Solana DeFi
1. Real-time data integration: Push Oracles enable Solana DeFi applications to access real-time data, ensuring that smart contracts execute with the most up-to-date information.
2. Decentralized data feeds: PYTH V2 provide decentralized data feeds, reducing reliance on centralized data sources and enhancing the overall security and integrity of Solana DeFi.
3. Automated decision-making: By providing real-time data, PYTH V2 Push model enable automated decision-making in Solana DeFi applications, improving efficiency and reducing the need for manual intervention.
4. Enhanced scalability: The Push model supports Solana’s high scalability, enabling DeFi applications to handle large volumes of transactions and data without compromising performance.
5. Improved accuracy: The Push model reduces the risk of data manipulation and ensures accurate data is used in Solana DeFi applications, fostering trust and reliability in the ecosystem.
▪️USE CASES AND ADOPTION
The Solana DeFi ecosystem is currently undergoing a migration to the Pyth pull oracle, with a significant adoption rate already achieved. Notably, the Pyth pull oracle on Solana processes an impressive 200,000 pull updates daily.
This demonstrates the growing reliance on this oracle solution for accurate and timely data feeds. This widespread adoption highlights the ecosystem’s shift towards a more robust and efficient data infrastructure. Here are some of the usecases:
- Drift Protocol a perpetual Dex platform on Solana announced its migration to pull oracles with the aim of leveraging on PythV2 advanced reliability, price Feeds and latency to improve the overall user experience on the platform.
2. ZK/USD price feed
The Pyth Network has announced the launch of its ZK/USD price feed, a significant development for the ZKync ecosystem as this integration enables decentralized applications and users on multiple chains to access accurate and ZK/USD pricing data, bringing increased adoption and utility for zkSync.
3. Divergence Protocol : Divergence an AMM is leveraging Pyth’s accurate and real-time price data, to enhance the platform by introducing a broader range of assets including real-world asset (RWA) options on multiple Layer 2 scaling solutions.
There are also lots of amazing and top leading protocols on the Solana network migrating and adopting pyth’s pull solution
▪️CONCLUSION
Pyth V2 is a significant upgrade to the Pyth Network, offering a more robust and scalable oracle solution for the Solana DeFi ecosystem. With its permissionless design, real-time price feeds, and extensive coverage of over 540 price feeds across 65+ blockchains, Pyth V2 sets a new standard for data accuracy, reliability, and accessibility.
“Oracles are the backbone of DeFi, and Pyth’s high frequency oracle network has been pushing the space forward since 2021. The launch of their pull oracle on Solana gives developers greater control and optionality over how they consume oracle data, and paves the way for expansion into the growing world of new SVM networks.” — Austin Federa, Head of Strategy at Solana Foundation
The integration of Pyth V2’s price feeds with various L2 scaling solutions, Dex platform, AMMs, and the expansion of options offerings for crypto and RWAs demonstrate the network’s commitment to driving growth and innovation in the DeFi space. By providing more trading opportunities and accurate data, Pyth V2 empowers the community to make informed decisions and unlocks new possibilities for Solana-based applications.
DApps such as Kamino Finance, Zeta Markets, Solend, Jupiter, Drift, amongst others have begun the transition to the Pyth V2 pull oracle, benefiting from the improved performance and efficiency provided by the pull oracle.
In addition, the pull oracle offers a significant increase in user trust, innovation and security, even as more protocols join the pull oracle bandwagon.
Thank you.
References
- What is Solana: https://www.coingecko.com/learn/what-is-solana-sol-and-how-does-it-work
- What is pyth network: https://www.gate.io/learn/articles/what-is-pyth-network/976
- Pull don’t push: https://pyth.network/blog/pyth-a-new-model-to-the-price-oracle
- Oracles Overview: https://docs.arbitrum.io/build-decentralized-apps/oracles/overview
- Oracle manipulation attacks: https://www.chainalysis.com/blog/oracle-manipulation-attacks-rising/
- Price Feeds: https://docs.pyth.network/price-feeds/pull-updates?ref=pyth-network.ghost.io
- Pyth Network on Twitter: https://x.com/PythNetwork
- Pyth Network: A First-Party Financial oracle”
https://pyth.network/whitepaper_v2.pdf?ref=pyth-network.ghost.io