Decentralized finance (DeFi) promises to revolutionize the way we manage our money and empower individuals to take control of their financial lives. The vast majority of DeFi services require a blockchain oracle—a secure, reliable method for blockchain applications to obtain financial data from the external world.
Enter the Pyth Network, the largest first-party oracle network for publishing financial market data on-chain. The network sources its data from over 90 first-party data providers, including some of the biggest exchanges and market makers. Pyth offers real-time price feeds for cryptocurrencies, equities, foreign exchange pairs, ETFs, and commodities to smart contract developers on more than 40 blockchains.
Since April 2021, the contributors of the Pyth Network have been working to provide Web3 developers with hundreds of real-time price feeds. The mission is to make all of the world's financial market data available on the blockchain for developers everywhere.
With the blockchain industry moving towards a future of high throughput DeFi, there is a rapidly growing demand for low-latency, high-frequency on-chain data. This blog post delves into the Pyth Network’s role in enabling this transformation.
Why Do We Need Another Oracle?
The Pyth Network is not the first blockchain oracle. The contributors behind Pyth began this project in DeFi Summer of 2020 because they noticed a gap in blockchain infrastructure that held back the promises of the blockchain space. Simply put, a price oracle for ultra-low-latency, institutional-quality market data did not exist. Web3 developers felt this gap in three ways:
1. Speed: Oracles were not updating fast enough for many financial use cases.
If prices on the blockchain are slower than real-world markets, then DeFi services will be inaccurate and even vulnerable to malicious attacks. These restrictions prevent developers from building sophisticated financial services. At the time, price oracles only updated every 10-60 minutes or ‘heartbeat’, which cannot support use cases that require low-latencies and high-frequency updates.
2. Coverage and Availability: Developers did not have access to the price feeds they needed.
Developers need access to certain assets or markets to serve their users. Developers cannot deliver financial services if the relevant price feeds are not available on their blockchain of choice. Legacy oracles could have e.g. 200 price feeds on Ethereum but only 8 on a newer chain like Base. The same oracle could also support multiple chains but have only a few price feeds that are available on all supported chain. These limitations can delay a protocol’s roadmap.
3. Sourcing and Quality: Data was opaque and came from aggregated, third-party sources.
Price oracles can be responsible for securing billions of dollars of smart contract value. But if the ultimate source of their data is opaque, developers and users cannot trust the quality of the prices they receive. Additionally, it will be difficult to hold these sources accountable for their prices, especially if the oracle is collecting these prices from public aggregator services or scraping services. Developers must be able to verify the inputs from their oracle's data sources and understand the reputations at stake.
How Pyth Works
The Legacy Model for Data Distribution
The Pyth Network is designed to solve these three limitations. These shortcomings arose because traditional oracles were designed based on a fundamental misunderstanding of how financial data works.
The implicit premise behind many legacy oracles is that all data, including financial data, is freely available in the Web2 space. According to this approach, the oracle provider simply needs to incentivize network participants to fetch this data, come to a consensus, and bring it on-chain.
A network of nodes will collect or scrape data from public resources, including aggregators compiling third-party data from other undisclosed sources. This method of data sourcing may work for public datasets such as weather or sports data. However, when it comes to financial data, the oracle must make compromises in terms of data quality, costs, and scaling. Furthermore, some financial data cannot be redistributed freely due to IP laws.
Consider the financial exchange industry. In 2022, the largest traditional exchanges earned $6.6B in total for data fees alone. Subscriptions to professional data terminals like Bloomberg costs tens of thousands of dollars per year. Even crypto exchanges like Coinbase have started charging for market data. The financial data industry operates as a walled garden.
The alternative solution—non-paywalled data—is either delayed for free users or aggregated by freemium services not tailored for smart contracts. Legacy oracles cannot access the first type of valuable data without violating IP laws. Smart contract developers therefore get the second-best data, at the expense of DeFi users.
A New Model for Data Distribution
The Pyth Network is built on the understanding that financial data is valuable and not freely attainable. Instead of serving a rough approximation of this data, the Pyth protocol empowers and incentivizes original owners of financial data to contribute it directly to the blockchain. The network’s data sources are called “first-party” because they create and own the data that they contribute.
It is helpful to visualize Pyth as a decentralized marketplace for market data. On the one side, creators of proprietary data represent the suppliers. Applications using this data represent the consumers. In the same way that Airbnb brought more vacation homes and spare rooms to the travel industry, Pyth Network unlocks more high-quality data for the blockchain industry by incentivizing data owners to contribute.
The Future of DeFi is First-Party
One might ask why Pyth Network’s architecture will remain the industry’s new go-to financial oracle. The answer lies in the long-term implications of first-party price data.
Pyth Network’s first-party data model future-proofs it for DeFi’s expansion into new asset classes such as energy, treasury rates, and real-world assets which do not have free-to-access equivalents online. The distribution rights that come with Pyth's first-party data provider community ensure that the network is prepared for DeFi's expansion. If DeFi grows to serve millions or even billions of users, we should expect that it will offer new markets. Oracles need to be where DeFi grows.
A helpful illustration of these different architectures is to think of music streaming services. Reporter oracle networks are analogous to Napster, where CD purchases act as network nodes who purchase instances of the original music and distribute it to the Internet of listeners.
Napster faced severe legal consequences and spam attacks because of this model. Spotify provided a streamlined solution where musicians and record labels can directly stream to subscribers and earn from the platform’s economics. Pyth is analogous to Spotify in its acknowledgment and rewarding of owners of intellectual property—in this case, financial data.
Pyth Network is the largest publisher oracle network with over 90 first-party data sources publishing directly to the network. In this network, the nodes own and publish their data directly on-chain.
Because Pyth’s data providers are the owners of the data they contribute, the financial data can be freely distributed across the blockchain space and beyond. This data distribution model also maximizes access to information and removes middlemen costs for data consumers. The design brings speed and cost advantages which enables Pyth to scale to thousands of symbols and near limitless blockchains in coverage.
In contrast, most legacy oracles are reporter oracle network, where nodes carry data over the last mile from API endpoint to on-chain consumption. In this network design, the nodes must purchase the data from first-party sources or other middlemen for transmission. These networks are constrained by the cost, speeds, and output formats of the purchased data. You can learn more about the sustainability differences between publisher and reporter oracle networks here.
Although there is no single right way to design an oracle network, the Pyth Network is designed to scale without speed, pricing, or distribution constraints. The goal is to enable the next generation of Web3 capital markets.
The next section breaks down the Pyth Network to its core components to help illustrate how its core products work.
The Pyth Network Components
The Pyth Network allows market participants to publish pricing information on-chain for applications to use. The protocol is an interaction between:
- Data providers submit pricing information to Pyth's oracle program. Pyth has multiple data publishers for every product to improve the accuracy and robustness of the system.
- The Pyth protocol combines providers' data to produce a single aggregate price and confidence interval.
- Data users read the price information produced by the oracle program.
It is important to understand that the Pyth Network itself is not a source of data. Data providers supply data to the network, and data users demand this data. The Pyth protocol, as a decentralized marketplace, aggregates the data providers’ contributed data in preparation for delivery to applications across multiple blockchains.
The Pyth Network data provider community is comprised of global exchanges, trading firms, market makers, and other institutional as well as decentralized market participants. These providers are the creators, and therefore owners, of their price data. The data providers contribute their idea of the price of assets e.g. Bitcoin to the network for the Pyth Price Feeds.
Though it may seem counter-intuitive, there is no single true price of an asset. There is the price you can trade an asset at, which is generated by exchanges; and there is the most recent transaction price of that asset, which is generated by traders. Pyth’s data provider community specializes in these two types of price data.
The Pyth Protocol
The Pyth protocol aggregates the data providers' inputs to produce a single aggregate price and confidence interval every 400ms for each price feed. This aggregation mechanism lives on an application-specific blockchain called Pythnet.
Consider the symbol BTC/USD. Each provider reports both their price and a confidence interval estimate for Bitcoin to the BTC/USD price feed on Pyth. For example, a provider may provide a price of $30,000 ± $5. Multiple providers contribute their inputs for any price feed, resulting in a robust, accurate output.
Pythnet is configured to be a proof-of-authority chain. It runs a version of the Solana validator and is a completely separate network from Solana mainnet-beta. The Pythnet appchain processes data from various providers, combining their inputs to produce a unified price and confidence interval for each price feed.
The aggregation algorithm is designed to make each price feed robust to outliers and manipulation, weigh each data source appropriately based on their accuracy, and reflect variations between data providers’ prices an aggregate confidence band. The aggregate outputs are then streamed to Wormhole in preparation for dApps to use: the result is a signed price payload that can be verified on any chain where Pyth is supported. You can read more about the aggregation methodology here.
Data users on any Pyth-supported blockchain can read the price feeds and incorporate the data into their smart contract logic.
Pyth Network introduces a unique architecture called the Pull Oracle. With the Pull Oracle design, data users can “pull” or request a price update from the Pyth protocol when needed. This architecture is gas efficient because users only pay for prices they want.
Thanks to this design, decentralized applications can request a new price update from the Pyth protocol when needed. A user would submit the signed price payload to the Pyth contract on their blockchain, which verifies its validity, and then use the resulting price. This process allows Pyth price updates to reach any supported blockchain.
In contrast, legacy oracles are typically designed as Push Oracles. These oracles run an off-chain process to “push” price updates on-chain at a regular interval. This model can waste gas fees on unused price updates. The inefficiency of push oracles can lead to gas subsidy requirements, infrequent updates, and difficulties landing prices on-chain during network congestion.
The Pyth protocol allows data users to request and consume on-chain price updates for a small data fee. Pyth users pull sends tens of millions of price updates cross-chain every month onto the various supported blockchains. While data fees are currently set to the smallest denomination of the blockchain’s native currency (e.g. 1 wei), this fee parameter and others can be determined by future governance.
Common use cases of Pyth data include spot and derivatives exchanges, structured product vaults, borrow/lending platforms, stablecoin protocols, yield optimizers, asset management solutions, and data analytics. You have probably used a Powered by Pyth application. Notable names include Synthetix (Optimism), Vela Exchange (Arbitrum and Base), Alpaca Finance (BNB Chain), Solend (Solana), and many more.
The Pyth Network Products
The Pyth Network currently offers two flagship products for DeFi applications: Pyth Price Feeds and Pyth Benchmarks.
Integration with Pyth data is permissionless, meaning developers can access Pyth data without entering a subscription or engaging a sales team. This design choice reflects the network’s commitment to the Web3 ethos.
Pyth Price Feeds
The Pyth Network offers over 350 low-latency price feeds across cryptocurrencies, FX rates, equities, ETFs, and commodities. Each price feed updates once every 400ms: high-frequency updates mean the prices closely track the external markets to granular intervals. High resolution data is important for time- and price-sensitive applications.
Every Pyth Price Feed provides the spot price and a confidence interval, visualized as a band around the price. The confidence interval represents the range in which the data providers (in aggregate) believe the true price is likely to be. This confidence value informs data users about the strength of the price output. Data providers can adjust their confidence based on the liquidity environment, and smart contracts can use this information for safer operations.
Pyth Benchmarks allow users to query a historical archive of prices from the Pyth Price Feeds. Benchmarks are class of standards used in finance to guide decisions and settle payouts. Examples include reference prices like the Bitcoin reference rate, indices like the S&P500, and rates such as LIBOR or the Fed Funds Rate.
Pyth Benchmarks provide standardization in calculations and presentation, ensuring consistent measurements for settlement and valuation. Common use cases for Pyth Benchmarks include decentralized options vaults (DOVs), such as Aevo on Ethereum, and backfilling prices for perpetual trading settlement, such as Synthetix on Optimism.
Addressing the Limitations of Legacy Oracles
How do Pyth Network’s products address the issues of speed, asset coverage, and accuracy of legacy oracles? The key is Pyth Network’s architectural innovation of the Pull Oracle. This efficiency brings a number of advantages in latency, scalability, and data resolution.
1. Low-Latency, High-Frequency Updates
High Update Frequencies—The Pythnet appchain updates each Pyth Price Feed multiple times per second. The output is streamed to Wormhole and data users can listen to this data stream through a public API. Pushing every price on-chain would make frequent updates like this impractical. However, push oracles usually update even less frequently than the blocktime due to the high cost of more frequent updates.
Low-Latencies—Pythnet streams price updates at a high frequency off-chain so that decentralized applications can use the most recent off-chain price for every transaction. This outcome means fresher prices than relying on a last on-chain update pushed by an oracle.
2. Price Feed Coverage and Multi-Chain Availability
Broad Asset Selection—The technical capabilities of Pythnet enables the Pyth protocol to scale to thousands of price feeds. This is thanks to Solana’s specialization in high-throughput and ultra-cheap transactions.
Multi-Chain Availability—The Pyth Network's price feeds are accessible on all Pyth-supported blockchains by default, since price sourcing and aggregation occur on Pythnet, and the price updates are brought cross-chain through Wormhole. When a new Pyth Price Feed launches, it is immediately available on all supported blockchains, eliminating the need for individual deployments on each target chain. This makes Pyth an interesting oracle for launching new data feeds, as Pyth can instantly expand price exposure for an asset to dozens of blockchains.
3. High-Resolution, High-Fidelity, Transparent Data
Accurate, First-Party Prices—Pyth sources data from traditional and decentralized creators of financial data. One key advantage of Pyth’s focus on first-party data is price accuracy. Pyth’s data providers are active participants in price discovery: they truly know the prices of assets. Pyth is designed to incentivize these data owners to contribute their private price data and aggregate these inputs to yield an accurate, representative snapshot of the markets.
Transparent Aggregation—The Pyth Network’s aggregation mechanism is designed to be transparent and verifiable. The provenance of each data point can be traced back to the public keys of the data providers. The aggregation and delivery process is publicly auditable using widely available tools like the Solana block explorer and the Pyth Publisher Metrics.
Reputational Alignment—Pyth’s data providers include established businesses in the traditional finance world and the blockchain industry. It is against their economic interest to attempt to influence the oracle unfairly, as their price inputs are public and they would incur reputational loss to their main commercial activities. In addition to this alignment is the aggregation mechanism, which prevents a minority of data providers from tampering the price.
Ecosystem and Governance
The Pyth Network ecosystem spans a diverse range of stakeholders, from data owners to decentralized applications to individual blockchain participants. On-chain governance is critical for a protocol’s self-sustainability and decentralization. As discussed in a previous blog on the Pyth Network’s tokenomics, governance structures are generally established to enable community guidance of a protocol’s development.
Governance is expected to be responsible for actions such as determining the parameters of update fees, the reward distribution mechanism for data providers, and determining how products are listed on Pyth and their reference data. You can read the whitepaper to learn more.
The Pyth Network contributors understood that past oracles were founded on a mistaken assumption on how financial data works. Legacy oracles served the nascent stages of DeFi well. But they also admitted of limitations in latency, asset coverage, and data quality, which restricted DeFi’s growth.
The future of price oracles is not searching for and bringing prices to the blockchain: it is bringing price owners and creators to DeFi. The Pyth Network’s Pull Oracle architecture addresses these core limitations.
The Pyth Network’s products are permissionless, transparent, low-latency, high-fidelity, and are designed to scale with the growth of Web3 itself. We’re excited for you to join the Pyth Network journey. There’s much to build.
You can become a member of the Pythian community and explore the official social network channels. Stay tuned on the network developments and announcements: get the news and listen to our contributors speak on the latest podcasts and keynotes.
Last Updated: Nov 4, 2023.
Stay Updated with Pyth
Stay informed about Pyth network's development and upcoming events!