Subscribe for updates
Subscribe to the Wormhole newsletter for exclusive updates.
05 Jan 2024
•4 min read
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.
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:
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:
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:
Additionally, on-chain price feeds could play a role in pricing assets on synthetic asset platforms or other DeFi applications.
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.
Here’s your chance to get in on this one.
Take a deep dive into our ever-evolving discussion on xChain technologies, new feature announcements, research, and more.