• Solutions
  • Developers
  • Blockchains
  • Blog
Wormholescan
Subscribe

Subscribe for updates

Subscribe to the Wormhole newsletter for exclusive updates.

Use Multichain Apps

Products

MessagingQueriesConnectNTTGateway

2024 Ⓒ Wormhole. All Rights Reserved.

05 Jan 2024

4 min read

Revolutionizing On-Chain Price Feeds with Wormhole Queries

Share:

In the ever-evolving world of decentralized finance (DeFi), the integration of real-time, reliable data is a cornerstone for the functionality and success of various DeFi protocols. This holds especially true in the context of DEX’s (decentralized exchanges).

Wormhole’s newest cross-chain innovation “Wormhole Queries” acknowledges that, by offering a seamless solution for accessing accurate on-chain price feeds. This blog post will explore the transformative role of Wormhole Queries in providing efficient and reliable on-chain price feeds, focusing on its use for any DEX, while also covering the implications for the broader DeFi space. 


The Wormhole Queries Advantage

Wormhole Queries introduces a new approach for on-chain data retrieval. Shifting from the traditional 'push' model to a more dynamic 'pull' system, it enables applications to access data across chains quickly and cost-effectively.

Technical Breakdown:

  • Mechanism: It uses an off-chain request model, facilitated and secured by Guardian nodes, which pull data from the target chain upon request.
  • Guardians: Guardians maintain the 13/19 multisig scheme and run full nodes on every connected chain. They act as intermediaries, fetching the required data from the respective blockchain, in this case, Ethereum, verifying the data, and delivering it to the application on another chain like Optimism (OP).
  • Efficiency and Cost-Effectiveness: This model eliminates the need for costly and slow on-chain transactions or reliance on traditional oracles (off-chain data source).

Wormhole Queries: Enabling Real-Time On-Chain Price Feeds

For a DEX, accessing real-time price feeds is crucial for various functions, including margin calculations, liquidations as well as pricing of futures contracts and collateral. Current methods of obtaining this data, either through an on-chain push mechanism that requires a transaction or oracles feeding off-chain data onto a network, pose unsolved challenges in terms of speed, cost, and reliability.

That’s why with Wormhole Queries, it allows DEXs on networks like Optimism, to directly access the current swap rates of assets on other chains (e.g. Ethereum on Uniswap pairs) through our off-chain pull mechanism, while still benefiting from the battle-tested security of our Guardian network. This allows Queries to provide a cheaper and faster alternative. 

Additionally, reliable on-chain price feeds are particularly vital for assets that may not have a well-established off-chain source for oracles to draw upon and could potentially enable a DEX on Optimism to allow for Perpetual contracts of new assets or enable new assets for collateral usage.

On a high level, the process works as follows:

  1. Request Initiation: A DEX on Optimism makes an off-chain request to Wormhole's Guardian network for the latest swap rate of a specific pair on Uniswap on Ethereum.
  2. Data Retrieval: Guardian nodes fetch this data directly from the Ethereum blockchain, ensuring the accuracy and timeliness of the information.
  3. Seamless Integration: Once verified by the Guardian-maintained multisig the retrieved data is then relayed back to the DEX, allowing for real-time updates and decisions based on current market conditions.

Implications for the broader DeFi Space

The implications of on-chain price feeds however, goes beyond the application in the context of DEXs and unlocks new opportunities across the DeFi space. For a borrowing and lending platform that requires reliable price feeds to price collateral assets, Wormhole Queries can also be a game changer. 

Especially for the before-mentioned assets traded on DEXs with no truly reliable off-chain price source (that could be accessed and fed on-chain through oracles), Wormhole Queries can provide the necessary market data directly from the source chain by pulling the necessary state information, which is then subsequently relayed to the application in need of this data (in current architecture technically done by the app itself). This enables the protocol to put a price on assets it didn’t have access to before and enables new lending markets / types of collateral.

Wormhole Queries enables a number of benefits:

  • Accuracy and Reliability: Ensures that the price feeds are accurate and up-to-date, crucial for maintaining the stability of borrowing and lending platforms.
  • Cost-Effectiveness: Eliminates the cost associated with on-chain transactions for price data retrieval.
  • Speed: Facilitates near-instantaneous data retrieval, enhancing the platform's efficiency in responding to market changes.

Additionally, on-chain price feeds could play a role in pricing assets on synthetic asset platforms or other DeFi applications.

Conclusion

Wormhole Queries has a broad set of use cases within the DeFi ecosystem, bearing the potential to improve UX across applications. In particular, on-chain price feeds enabled by Wormhole Queries is interesting for DEXs and other platforms like borrowing & lending protocols. By enabling direct, efficient, and reliable access to on-chain price feeds from various chains, it paves the way for more responsive and user-friendly DeFi applications.


Get started building with Wormhole products today! Check out our website for more information about Wormhole Queries, and you can also sign up for the Queries beta here. Developers can learn more about Queries by reading our Whitepaper in our Github!

About Wormhole

Wormhole is an industry-standard cross-chain messaging protocol that powers applications across Web3. It provides developers with access to liquidity and users on over 20 leading blockchain networks, enabling use cases in DeFi, NFTs, governance, and more. Wormhole's messaging layer allows a growing suite of products to be built on top of it.

One of Wormhole's key asset layer products is Wormhole Connect. It offers developers an in-app bridging widget that can be integrated with as few as 3 lines of code. The wider Wormhole network is trusted and used by teams like Circle and Uniswap. To date, the platform has facilitated the transfer of over 35 billion dollars through hundreds of millions of cross-chain messages.

Stay up to date with the latest news

Here’s your chance to get in on this one.

Discover More

Take a deep dive into our ever-evolving discussion on xChain technologies, new feature announcements, research, and more.

W is Now Natively Multichain on Ethereum and Layer-2s with Wormhole Native Token Transfers (NTT)

W is Now Natively Multichain on Ethereum and Layer-2s with Wormhole Native Token Transfers (NTT)

25 Apr 2024

3 min read

Native W tokens are now available on Solana, Ethereum, Arbitrum, Optimism, and Base through Wormhole Native Token Transfers (NTT). With NTT, users can seamlessly transfer W across ...

25 Apr 2024

3 min read

Subscribe for updates

Subscribe to the Wormhole newsletter for exclusive updates.

Products

MessagingConnectGateway

About

Terms of ServicePrivacy Policy

2024 Ⓒ Wormhole. All Rights Reserved.