Should DeFi protocols migrate to pull oracles?

You’ve kickstarted your DeFi journey, and you want immediate acceleration in the market.

Perhaps you started a coin and you want to see its true valuations against other alt-coins. Or, you need real-time data to supplement your trading ventures. In either or other circumstances, as a web3 techie, you will need to depend on oracles to access real-world, updated (off-chain) data on the blockchain. For those unfamiliar:

What are Oracles?

Oracles are third-party services that provide external data to blockchain smart contracts, enabling them to interact with real-world information. They act as a bridge between on-chain (blockchain) and off-chain (external) systems, allowing smart contracts to execute based on inputs and outputs from the real world.

Oracles can fetch data from various sources, such as APIs, sensors, and other external databases, and securely relay it to the blockchain.

Until the better alternative, “push oracles” have been the backbone of many DeFi protocols.

Push oracles operate by regularly "pushing" price data on-chain at specific intervals or when certain conditions are met, without waiting for a request from the blockchain. Push oracles are straightforward and easy to integrate, making it a popular choice for developers.

Here’s my simplified illustration of how push oracles function.
Here’s my simplified illustration of how push oracles function.

Understanding the above diagram, we can make the following inferences:

With downsides easily notable from its functionality, it becomes apparent to us that push oracles are not the best options in transporting off-chain data onto blockchains. Push oracles are wasteful, inherently undermined in crucial factors such as scalability, latency, reliability, security, and flexibility.

In elaboration:

1. High Gas Fees and Inefficiency

Continuously pushing data to the blockchain at regular intervals, regardless of necessity leads to high gas fees and inefficiency, as many of these updates may go unused. This situation is problematic during periods of high network congestion, where transaction costs can skyrocket.

“Pull, Don’t Push: A New Price Oracle Architecture” - Pyth Network
“Pull, Don’t Push: A New Price Oracle Architecture” - Pyth Network

2. Latency Issues

Push oracles can suffer from latency issues because they update data at predefined intervals. Data may not be the most current when it is needed, leading to potential inaccuracies in smart contract executions. This latency can be critical in fast-moving markets where real-time data is essential.

3. Scalability Constraints

The cost and complexity of continuously pushing data to multiple blockchains can limit the scalability of push oracles. Supporting a large number of feeds or frequent updates becomes prohibitively expensive, which restricts the ability to scale and support a wide range of applications and blockchains.

Source: @Cryptoape0 on X.com Chainlink vs Pyth Net (the latter uses “pull” oracles)
Source: @Cryptoape0 on X.com Chainlink vs Pyth Net (the latter uses “pull” oracles)

4. Security Vulnerabilities

Push oracles are prone to security vulnerabilities, such as data manipulation and front-running attacks. Since data is continuously pushed to the blockchain, it can be intercepted and manipulated by malicious actors. If the oracle sources data from its own entities, there is a risk of biased or manipulated data being pushed to the blockchain.

If otherwise that the push oracles are trustworthy, then we’d have to question it’s complete reliability as well: Due to the constant data push, many push oracles will eventually rely on fewer data sources/ limited number of data providers. This concentration introduces single points of failure and increases the risk of data manipulation.

6. Data Redundancy and Congestion

Push oracles can lead to data redundancy and network congestion. Since data is pushed at regular intervals, there may be multiple redundant updates that do not add value but still consume network resources. This can lead to congestion and slow down the overall performance of the blockchain network.

7. Lack of flexibility

Push oracles lack the flexibility to provide data on-demand. They operate on a fixed schedule, which may not align with the specific needs of different DeFi applications. This can limit the effectiveness of the oracle in providing timely and relevant data.

At an overview, how do push oracles occur to you?

To me, they strike as continually running faucets in times of sustainability and optimisation.

A visualisation of how wasteful push oracles are.
A visualisation of how wasteful push oracles are.

An alternate, improved solution:

Pull Oracles

→ Operate on a "pull" model, where users actively request or "pull" the data they need from the oracle. This model offers several advantages that make it a compelling choice for the future of DeFi.

On Pyth Network, data users can “pull” or request a price update from the Pyth protocol when needed.

Simplified illustration of how PythNet’s pull oracles work
Simplified illustration of how PythNet’s pull oracles work

In quickly analysing the diagram, the only underwhelming aspects of pull oracles are:

  1. Pull oracles require more off-chain infrastructure to handle data requests and ensure timely responses.

  2. Implementing pull oracles can be more complex due to the need for robust off-chain systems to manage data requests and ensure data integrity.

With benefits overweighing the aforesaid cons:

The Case for Migration, with Pyth Net’s pull oracle as an example:

1. Gas Efficiency:

Every gwei counts. Pull oracles like Pyth Network allow users to pay for data only when needed, making them more gas- and cost-efficient. Particularly beneficial in volatile markets where data needs can fluctuate significantly, and undesired fees can be incurred.

→ Pyth Network, for example, has demonstrated reduced price tracking error by 5-10 times compared to competing oracles, showcasing the effectiveness of pull oracles in delivering high-frequency, reliable market data.

→ Although the cost of pulling a Pyth update is negligible, users must still pay the gas associated with their DeFi transactions. User costs fell 4% QoQ, largely driven by the decrease in gas usage from Optimism and zkSync Era.

→ Over 98% of Pyth's price update activity occurred on Sui (67%) and Aptos (31%), indicating high usage on these chains due to their low-cost nature.

2. Low Latency:

Pull oracles provide data with lower latency because the data is fetched on-demand. Ensures DeFi protocols rely on the most recent data, reducing the risk of using stale information and improving the accuracy of smart contract executions.

→ Data aggregation method: Pyth sources data from over 100 first-party providers, including major exchanges and market makers, ensuring high-quality and reliable data feeds.

3. Scalability:

Pull oracles support a large number of data feeds across multiple blockchains without incurring high costs. Essential for DeFi applications that operate across various platforms and require high-frequency data updates.

→ Pyth's total value secured grew 322% QoQ to $7.2 billion, including Ethena. This growth was driven by the addition of 41 new price feeds, expansion to 9 new blockchains, and integration into 35 new applications; while maintaining reasonable costs.

4. Security:

Keeping data off-chain until needed mitigates front-running attacks and reduces the risk of data manipulation. Ensures data is not exposed until the transaction is settled, enhancing security.

5. Flexibility and Customisation:

Pull oracles offer greater flexibility and customisation for DeFi protocols. Developers can tailor their data requests to specific needs, such as requesting data at particular intervals or under certain conditions. Allows for more efficient use of resources and better alignment with the protocol's operational requirements.

6. Optimal Scalability

Unlike push oracles, pull oracles can maintain their sustainability through cut wastage and optimal data sourcing, yielding greater productivity of its users and durability of the protocol itself.

→ The "State of Pyth Network Q1 2024" report highlights that Pyth supports over 450 price feeds and is integrated with more than 330 decentralised applications (dApps) across 55 blockchains, demonstrating its widespread adoption and reliability.

Pull oracles allow for productive and optimal data sourcing. Source.
Pull oracles allow for productive and optimal data sourcing. Source.

Which option do you gravitate towards?

I think it’s Pyth for me.

Insofar it is obvious that pull oracles are a viable alternative to push based oracles; Yet indefinitely, empirical data are more convincing in affirming the promising nature of pull oracles:

The result

  1. Pull oracles can provide real-time data updates on demand, which is crucial for DeFi applications that rely on accurate and timely information, such as automated market makers (AMMs) and lending platforms.

  2. By sourcing data from multiple institutional providers, pull oracles like Pyth can offer more reliable and accurate data, reducing the risk of manipulation and ensuring the integrity of DeFi protocols:

    → Major financial institutions, including Jane Street, CBOE, Binance, and others, contribute data to the Pyth network, enhancing its reliability and accuracy.

    Their reliability is substantiated by the fact that:

    → The amount of PYTH staked grew 92% QoQ. Combined with a 206% increase in the price of PYTH, the staked PYTH value grew 489% in USD terms, from $215 million to $1.3 billion

    → Pyth's market cap grew from $488 million to $1.5 billion by the end of Q1 2024

Additionally, other protocols follow suit to adopt pull based oracles:

  1. One of MonadLabs articles discuss the general inefficiencies of traditional oracles, whether push or pull, due to high latency and imprecision caused by expensive on-chain price updates. However, it emphasises that environments with extremely cheap gas fees enable more precise oracles, which can update every 1-10 seconds. This high-frequency updating mitigates risk, increases trading confidence, and offers better-informed trading, leading to higher capital efficiency in DeFi protocols;

  2. Chainlink has introduced a new low-latency pull-based oracle solution specifically designed for the DeFi derivatives market. This solution generates oracle updates per block, which users can retrieve off-chain and validate with their on-chain transactions. The key benefits include:

    • Ultra-low latency: Oracle updates are generated per block, significantly reducing latency.

    • Front running mitigation: Prices are kept private until transactions are settled, reducing the risk of frontrunning.

    • Gas efficiency: The cost of validating oracle updates is highly gas-efficient.

Zeno’s paradox — Why pull oracles will always be better than push based ones

edited by yours truly
edited by yours truly

In the Zeno paradox, Achilles, the fastest runner, races against a tortoise that is given a head start. Zeno argues that Achilles can never overtake the tortoise, because each time Achilles reaches the tortoise's previous position, the tortoise will have moved ahead, creating an infinite series of catch-up points that Achilles must reach.

This paradox is analogous to the comparison between push and pull oracles. Both oracles focus on delivering data for the DeFi protocols, yet how much of this data is productively used, distinguishes the better option.

Push oracles are like Achilles; They constantly push data to optimise user convenience and productivity, but inherent flaws such as wastage and congestion compromises it’s reliability and potential. Push oracles are fallible also in the concept of "infinite choices" in decision-making can also be applied to the oracle scenario. [Variables: Push oracles (X), against Pull oracles (Y)]

If applying pull oracles alone into Zeno’s context, the paradox is resolved by allowing users to retrieve data on-demand, ensuring they always access the most up-to-date information, which recognises that the infinite series converges, and Achilles will eventually overtake the tortoise. [Variables: Pull oracles (X) against Real-time data (Y)]

In conclusion

The transition from push oracles to pull oracles brings significant advantages for decentralised finance (DeFi) protocols. Pull oracles offer cost-effectiveness, scalability, precision, security, and flexibility. The Pyth Network represents a prime example of these benefits, providing a robust and trustworthy pull oracle system that supports a wide option of financial applications.

References:

  1. BNB Chain. (n.d.). BNB Chain report: The state of oracles. Retrieved June 3, 2024, from https://www.bnbchain.org/pt-BR/blog/bnb-chain-report-the-state-of-oracles

  2. ArbiSmart. (n.d.). Understanding DeFi oracles. Retrieved June 3, 2024, from https://arbismart.com/blog/understanding-defi-oracles/

  3. Chaos Labs. (n.d.). Oracle risk and security standards: An introduction. Retrieved June 3, 2024, from https://chaoslabs.xyz/posts/oracle-risk-and-security-standards-an-introduction

  4. CoinTrust. (n.d.). Pyth network enhances data security with Ambient partnership. Retrieved June 3, 2024, from https://www.cointrust.com/market-news/pyth-network-enhances-data-security-with-ambient-partnership

  5. Diadata. (n.d.). What is blockchain oracle? Retrieved June 3, 2024, from https://www.diadata.org/blog/post/what-is-blockchain-oracle/

  6. Gate.io. (2023). Messari research report: In-depth analysis of Pyth, the leading oracle on Solana. Retrieved June 3, 2024, from https://www.gate.io/learn/articles/messari-research-report-in-depth-analysis-of-pyth-the-leading-oracle-on-solana/2309

  7. Hackernoon. (n.d.). The strengths and weaknesses of DeFi price oracles. Retrieved June 3, 2024, from https://hackernoon.com/the-strengths-and-weaknesses-of-defi-price-oracles-x7l35ui

  8. Hailstone Labs. (n.d.). Exploring the design space and challenges for oracle implementations in DeFi protocols. Retrieved June 3, 2024, from https://hailstonelabs.com/blog/exploring-the-design-space-and-challenges-for-oracle-implementations-in-defi-protocols

  9. Liquity. (n.d.). The oracle conundrum. Retrieved June 3, 2024, from https://www.liquity.org/blog/the-oracle-conundrum

  10. Okx.com. (n.d.). What is Pyth network: Unlocking the future of blockchain oracles. Retrieved June 3, 2024, from https://www.okx.com/learn/what-is-pyth-network-unlocking-the-future-of-blockchain-oracles

  11. Pintu. (n.d.). What is blockchain oracles? Retrieved June 3, 2024, from https://pintu.co.id/en/academy/post/what-is-blockchain-oracles

  12. Pyth Network. (n.d.-a). Pyth: A new model to the price oracle. Retrieved June 3, 2024, from https://pyth.network/blog/pyth-a-new-model-to-the-price-oracle

  13. Pyth Network. (n.d.-b). Pyth delivers high-fidelity oracles to Arbitrum ecosystem. Retrieved June 3, 2024, from https://pyth.network/blog/pyth-delivers-high-fidelity-oracles-to-arbitrum-ecosystem

  14. Pyth Network. (n.d.-c). Pyth launches price oracles on Cronos. Retrieved June 3, 2024, from https://pyth.network/blog/pyth-launches-price-oracles-on-cronos

  15. Pyth Network. (n.d.-d). What is the Pyth network? Retrieved June 3, 2024, from https://pyth.network/blog/what-is-the-pyth-network

  16. ResearchGate. (n.d.-a). A first look into DeFi oracles. Retrieved June 3, 2024, from https://www.researchgate.net/publication/355458677_A_First_Look_into_DeFi_Oracles

  17. ResearchGate. (n.d.-b). Toward trustworthy DeFi oracles: Past, present, and future. Retrieved June 3, 2024, from https://www.researchgate.net/publication/360965797_Toward_Trustworthy_DeFi_Oracles_Past_Present_and_Future

  18. Solana. (n.d.). Case study: Pyth. Retrieved June 3, 2024, from https://solana.com/news/case-study-pyth

  19. Twitter. (n.d.). Title of the tweet. Retrieved June 3, 2024, from https://twitter.com/mdomcahill/status/1793643129637065204

  20. UofT. (n.d.). Title of the paper. Retrieved June 3, 2024, from https://www.eecg.utoronto.ca/\~veneris/ICSE24.pdf

  21. Yahoo Finance. (2023). Oracle cases upgrade blockchain sector. Retrieved June 3, 2024, from https://finance.yahoo.com/news/oracle-cases-upgrade-blockchain-sector-184843358.html

  22. Binance. (n.d.). Delphi DeFi: How crypto oracles are shaping future finance. Retrieved June 3, 2024, from https://www.wilsoncenter.org/article/delphi-defi-how-crypto-oracles-are-shaping-future-finance

  23. Binance. (n.d.). Post title. Retrieved June 3, 2024, from https://www.binance.com/en/square/post/3652236173890

  24. Polygon Technology. (n.d.). Title of the documentation. Retrieved June 3, 2024, from https://docs.polygon.technology/tools/oracles/pyth/

  25. Bitstamp. (n.d.). What is Pyth network? Retrieved June 3, 2024, from https://www.bitstamp.net/learn/cryptocurrency-guide/what-is-pyth-network-pyth/

  26. Pyth Network. (n.d.). Where Pyth is now: Looking towards 2024. Retrieved June 3, 2024, from https://pyth.network/blog/where-pyth-is-now-looking-towards-2024

  27. Pyth Network. (n.d.). Pyth whitepaper. Retrieved June 3, 2024, from https://pyth.network/whitepaper_v2.pdf

  28. Optimism. (n.d.). Title of the documentation. Retrieved June 3, 2024, from https://docs.optimism.io/builders/tools/build/oracles

  29. Hedera. (n.d.). Title of the documentation. Retrieved June 3, 2024, from https://docs.hedera.com/hedera/open-source-solutions/oracle-networks/pyth-network-oracle

  30. CoiNStats. (n.d.). Interview: Pyth’s architecture as pull oracle has mainly driven its growth, says Michael Cahill. Retrieved June 3, 2024, from https://coinstats.app/news/cf56cd7bd86e42553963635243bcce4f40217847c9eac64b4719c86beb0fb9b8_Interview%3A-Pyth%E2%80%99s-architecture-as-pull-oracle-has-mainly-driven-its-growth%2C-says-Michael-Cahill/

  31. Gate.io. (n.d.). What is Pyth network? Retrieved June 3, 2024, from https://www.gate.io/learn/articles/what-is-pyth-network/976

  32. Bitget. (n.d.). What is Pyth network and how does it work? Retrieved June 3, 2024, from https://www.bitget.com/en-GB/academy/what-is-pyth-network-pyth-and-how-does-it-work

  33. Oracle. (n.d.-a). Creating diagrams. Retrieved June 3, 2024, from https://docs.oracle.com/cd/E26098_01/user.1112/e17455/creating_diagrams.htm

  34. Oracle. (n.d.-b). Database technical architecture. Retrieved June 3, 2024, from https://www.oracle.com/webfolder/technetwork/tutorials/architecture-diagrams/19/database-technical-architecture.html

  35. Pyth Network. (n.d.). How Pyth works. Retrieved June 3, 2024, from https://docs.pyth.network/price-feeds/how-pyth-work

  36. Oracle. (n.d.-c). Reference graphics for diagrams. Retrieved June 3, 2024, from https://docs.oracle.com/en-us/iaas/Content/General/Reference/graphicsfordiagrams.htm

  37. Pyth Network. (n.d.). Pull updates. Retrieved June 3, 2024, from https://docs.pyth.network/price-feeds/pull-updates

Subscribe to 0xShuul
Receive the latest updates directly to your inbox.
Mint this entry as an NFT to add it to your collection.
Verification
This entry has been permanently stored onchain and signed by its creator.