Pyth Network: Chainlink's Big Rival?

D9An...ps6F
8 Jan 2024
79


When thinking of oracle services, one thinks of Chainlink. As the golden child of the 2018-2019 bear market, Chainlink is the most recognised and used oracle network today, securing ~$14.7 Million on over 360 protocols. This Total Value Secured (TVS) represents lending protocols on Ethereum such as Aave and Compound. These two lending protocols account for more than half of Chainlink's TVS.


Pyth is a new player that started in 2021 with a focus on Solana, and has recently been expanding outwards. With Chainlink's deep integration in the DeFi landscape, the question is why do we need another oracle service?


Source : DeFiLlama


What Makes Pyth Different?


Besides fulfilling the needs of oracles in Solana, Pyth takes a fundamentally different and innovative approach. Pyth gets information only from first-party sources, without using data aggregators. While Chainlink oracles have some first-party nodes, they also rely on data aggregators (such as CoinGecko and CMC) as part of their process.


Pyth also introduced the concept of "Confidence Interval" (CI), a tool that gives protocols more information about market prices and uncertainty, especially during times of high volatility or low liquidity.


There is only a small group of users who have access to critical information in a timely manner. They are trading firms, market makers, and exchanges. These participants send prices to Pyth directly, thus eliminating data aggregation costs and significantly reducing latency from outside the blockchain. Hence, this leads to more timely and high-quality prices.


Many of Pyth's publishers are well-known, from crypto entities like Amber, Binance, Bitstamp, CMS Holdings, Galaxy Digital, Jump Trading, Kaiko, QCP Capital, Wintermute to traditional financial entities like Jane Street, Cboe, and more.


Pyth takes prices from these publishers and aggregates them. But, rather than publishing one single price, they publish prices within a Confidence Interval (CI) range.


For assets that are traded in multiple venues with multiple participants, information, deposit and withdrawal limits, liquidity profiles, etc..., there is no such thing as a "correct price". Confidence Intervals can reflect more realistic market status and liquidity conditions, especially in times of high volatility.


While this process asks for additional considerations from the DeFi protocol, it does offer some benefits.


The illustration is this: Say there is an ETH price pool at $1,500 with a CI of $5. To get the right price with a probability of 99.7%, that CI number is multiplied by 3. This would give a very high probability that the value of ETH is between $1,485-$1,515.


DeFi protocols can choose which level is conservative/aggressive at their convenience, by specifying their own CI. For example, a conservative lending protocol might value the collateral at the lower end of the range ($1,485), reducing the loan amount that users can take out. Conversely, a more aggressive lending protocol may value the collateral at the higher upper range ($1,515) to avoid unnecessary liquidation.


Source: BTC/USD price with CI $19


Under normal market conditions, CI should be tight (ETH is usually <$0.5). During abnormal conditions, CI needs to be carefully considered and planned. Confidence Intervals allow for more "exotic" products, such as the use of CIs in Zeta Markets to generate settlement prices (around contract expiry dates) that are not prone to price manipulation.


Since 2021, Pyth has experienced steady adoption in Solana, and is the de facto oracle network in Solana - serving almost the entire ecosystem. Growth over the past two years is as follows:


  • Publisher: 25 → 90
  • Price Feed: 43 → 91
  • dApp: 17 → 260+


Early Growth Challenges

Pyth had some issues in its early days that damaged its reputation. I will briefly discuss what happened and then go into the details of how the Pyth engine works and steps to prevent these issues in the future.


The first major issue was around the BTC/USD price during the 2-minute period on 20 September 2021. Due to 2 of the 11 publishers putting the decimal point wrong and the data set weighting their contributions, the BTC price ended up being very far from the actual ~$42,000 level, instead being reported as low as $5,402 with a Confidence Interval of +/- $21,623.


This error resulted in useless and dangerous price information. For protocols that do not incorporate a Confidence Interval, and rely solely on the median price of $5,400, this causes detrimental effects such as erroneous liquidation.


Source: Pyth Network Blog


This incident would give credence to oracles that use aggregators. We can clearly argue that a data aggregator would never experience a price report like this, because that's its job. This is the trade-off without aggregators; by getting rid of the middleman and his costs, we can get faster, higher-quality data updates. But, if the stake weights don't account for errors like this, there's a serious problem. This filter/aggregation process in the middle is a check that Pyth lacks. Pyth relies on cryptoeconomics and algorithms.


So, what are the remediation steps that Pyth has taken from here?


  1. Developed a trial protocol with a better sign-in process for new publishers.
  2. Adjusting the aggregation system to properly weight prices that range widely.
  3. Creating better documentation for developers on how and why to use price intervals (CIs). This process adds work to the protocol, and many are not familiar with the CI concept.
  4. Welcoming more publishers: BTC/USD now has 30 publishers, which was only 11 when this issue occurred.
  5. Cryptoeconomic security with consideration of staking and slashing using PYTH tokens.

There were some other early issues as well, such as software bugs, Solana network congestion (can't blame Pyth), and some very broad CI extremes such as BTC issues in less liquid markets.


While protocols have a responsibility in understanding how to use Pyth data and the concept of Confidence Intervals, such wildly incorrect price reports are clearly unacceptable as an oracle service. Furthermore, the median price & CI being so divorced from reality was a failure and financially damaging.


Despite all the initial challenges, Pyth has become more reliable, especially as their publisher coverage has grown. It is also important to distinguish between true oracle failures (such as the BTC issue above), and market manipulation, such as the Mango or Solend tragedies (note that Pyth was not involved in these two cases).




Over the past year or so, Pyth has continued to welcome big-name publishers with better integration processes. On top of that, they have also significantly changed the pricing algorithm, and added security measures with the crypto-economy around the PYTH token. They also launched Pythnet as a solution for blockchain in addition to Solana. Pythnet is a fork of the Solana codebase which is its own blockchain.


How the Pyth Network Engine Works


Pyth has 3 main stakeholders: consumers, publishers, and delegators.

  • Consumers: The users of price data, predominantly smart contracts and DeFi protocols. In Pyth v1 in Solana, protocols receive price data feeds for free. For protocols outside Solana, they pay a small "on-demand" fee to retrieve prices from Pythnet (v2) via Wormhole. Consumers can now pay insurance fees with PYTH tokens in anticipation of inaccurate oracles.
  • Publisher: Publish the price. They receive PYTH tokens in return and 20% data fee (subject to change). They need to stake PYTH tokens for price production, and these tokens can be deducted if they make a mistake.
  • Delegator: Holders of PYTH tokens. They stake in the price feed to determine the publisher's weight and generate insurance fees from consumers. Their tokens can also be deducted if the staked price feed has errors.

Source: Pyth Network Blog


For a deeper dive into the algorithm (maths), you can read here. With weighted staking, assets will combine all these factors in their pricing, and publishers will be rewarded according to their honesty in reporting the Confidence Interval.


Pyth's design is a unique and innovative model, very different from other oracle services with the introduction of market makers and trading companies, Confidence Intervals, staking weights, publisher scores, and aggregation algorithms.


Pyth in Solana: Diving into Data


Pyth represents a huge number of Solana transactions. Without counting consensus votes, Pyth is responsible for ~30% of Solana transactions. Being on a low-latency blockchain that charges a fixed transaction fee, Pyth data updates very frequently. Publishers update prices onchain in every Solana slot (~600 milliseconds). This is too expensive and not possible on other blockchain ecosystems.


Even with almost 10 Million transactions per day, being a publisher on Pyth is inexpensive. Publisher revenue comes from staking that generates PYTH tokens, data fees, and token allocation at launch.


Pythnet (a solution for blockchain other than Solana) also has on-demand price updates, different from the asset prices on Solana which are updated every slot. This on-demand data feed from Pythnet will generate additional fees when processed onchain.


While borrowing protocols typically hold the most value for safekeeping (e.g. Aave and Compound for Chainlink, Marginfi and Solend for Pyth), they do not request the most price updates. The most comes from derivative protocols that need to utilize low latency pricing. Hence, Pyth has enabled some unique products with their oracles, such as Drift, Zeta, Mango, 01, HXRO, and Cypher.


Pyth's birth in Solana was quite problematic, but it has significantly improved performance since 2021 and now covers almost the entire Solana ecosystem (>90% TVS). Even Pyth has aspirations beyond Solana, and this is why they launched Pythnet.


Expansion Out of Solana


Pythnet is a fork of the Solana codebase, a separate blockchain just for Pyth publishers to submit price data. Pythnet is already integrated with BNB Chain, Aptos, Ethereum, and Optimism.


While the way publishers work on Pythnet is similar to Pyth publishers on Solana, the process is different for consumers. The difference is that price updates are not sent directly like in Solana, but rely on Wormhole to broadcast messages across blockchains.


The main differences between Pythnet on other blockchains and Pyth on Solana are as follows:


  • Pull vs push model: Prices are "pulled" from Pythnet and updated onchain when requested by applications. This is in contrast to prices being "pushed" automatically in Solana.
  • Higher latency: The latency from CEX price to blockchain is ~3 seconds. 1 second is from CEX to Pythnet, and 2 seconds is from Pythnet to the pricing service (introduced by Wormhole).
  • Fees for price updates: Solana protocols can use Pyth for free, while protocols outside Solana need to pay onchain fees from Pythnet. The fees start cheap in the smallest denominations (e.g. 1 wei), but can be adjusted by governance later. For example, you can see the Pyth fee collector in Aurora.
  • Gas efficiency: Gas fees are only paid when consumers actually need the price. Otherwise, a lot of gas is wasted on price feeds like LTC and BCH that not many people use.
  • Reliability: Pythnet is a stand-alone blockchain. So if the Solana network goes down, Pythnet still continues to operate.

Source: Pyth Network Blog


While latency is not ideal compared to the sub-second-fast Solana version, there are mitigating measures that can be taken. Also, note that many other oracles do not update price data every block due to inefficient gas costs. Pythnet's solution enables real-time streams that can be pulled onchain whenever needed.


Pyth comes to the oracle sector with a unique point of view. It is not a "cheap" fork or a copy of an existing model. Pyth is a new and bold legit model. Despite the initial problems, their operations have grown more effective. While they have coverage in almost the entire Solana ecosystem, they have yet to see success outside of it. Let's see if they can become successful with Pythnet.


PYTH Tokenomic


PYTH is the native token of Pyth Network, with a maximum supply of 10 Billion tokens. Most of the PYTH tokens are locked for ecosystem growth.


Ecosystem Growth 52% (5.2M PYTH)

  • This allocation is for developers, educators, researchers, strategic contributors, early publishers, etc. This allocation aims to facilitate initiatives such as funding research projects that advance the Pyth protocol, incentivizing developers to build complementary tools and resources, and to support public education programs.

Publisher Rewards | 22% (2.2M PYTH)

  • This allocation goes to Pyth data providers, also known as publishers. This allocation consists of various reward mechanisms and funding allowance programs that encourage the publication of accurate and timely data. It is designed to support new digital assets that may lack popularity or initial liquidity.

Protocol Contributors 10% (1M PYTH)

  • This allocation is for core contributors focused on building tools, products, and oracle infrastructure to extend Pyth protocol services. One example is Douro Labs.

Private Token Sale | 10% (1M PYTH)

  • This allocation symbolizes Pyth's two historical fundings alongside strategic contributors who have added value to the network (as advisors and infrastructure supporters).

Community and Launch | 6% (600JT PYTH)

  • This allocation is given during the initial launch phase and community-related initiatives (such as airdrops).


The duration of the token unlock is quite long, with a 4-year vesting schedule. So there will be consistent unlocks over time. This makes PYTH a "low-float high-FDV" token.


For those who haven't heard of this term:

  • Low Float = Few tokens in market circulation (many are still unreleased). In the case of PYTH, there are currently only 15% of tokens in circulation (i.e. 1.5M tokens out of a total amount of 10M).
  • High FDV = High full valuation. This means that if all PYTH tokens (100% of the total supply) were circulating in the market, the value would be very far adrift of the current market cap.

The bottom line, in my simple language is: It is difficult to maintain a high valuation while new supply will be released in the future. The risk of selling pressure is quite high in the future. Of course, this view does not take into account external factors (other than tokenomy).


Source: Pyth Network Blog

Write & Read to Earn with BULB

Learn More

Enjoy this blog? Subscribe to Aang

5 Comments

B
No comments yet.
Most relevant comments are displayed, so some may have been filtered out.