Need a crash course on Bitcoin layers?
→ READ OUR FREE GUIDE
Need a crash course on Bitcoin layers?
→ READ OUR FREE GUIDE
Need a crash course on Bitcoin layers?
→ READ OUR FREE GUIDE
Need a crash course on Bitcoin layers?
→ READ OUR FREE GUIDE
Need a crash course on Bitcoin layers?
→ READ OUR FREE GUIDE

New Oracle Alert: Pyth Integration With Stacks

We’re thrilled to announce the developer preview of Pyth’s integration with the Stacks blockchain. You can now access over 300 price feeds from Pyth’s oracle on Stacks, opening new possibilities for DeFi apps.

Type
Announcement
Topic(s)
Stacks
Ecosystem
Published
August 23, 2023
Author(s)
Staff Engineer
VP of Strategic Partnerships
Pyth's oracle is here.
Contents

In order to support a thriving DeFi ecosystem on Bitcoin, developers need reliable, robust, open-source building blocks such as trusted oracles, cross-chain bridges and liquidity. As a developer tooling company, our work is centered around contributing to tooling that makes developers’ lives easier.

Introducing new blockchain oracles to the Stacks ecosystem gives developers more options and possibilities in how they build DeFi apps, and today, we’re excited to share that Stacks developers now have access to Pyth price feeds on Stacks, which includes 300+ price feeds for equities, ETF’s, commodities, foreign exchange pairs, and digital assets.

As a developer tooling company, our work is centered around contributing to tooling that makes developers’ lives easier.

This initial release is a Developer Preview of the Stacks x Pyth integration. The integration is live on both testnet and mainnet and is meant primarily for developers to test, give feedback and ensure reliability and stability of the integration. Four teams in the Stacks ecosystem, ALEX, Arkadiko, Hermetica, and Zest, are already implementing these price feeds in their applications.

What Are Oracles?

In DeFi, oracles are essentially tools that provide off-chain data for smart contracts and apps. The most common type of off-chain data needed in DeFi are accurate price feeds, which enable use cases such as decentralized exchanges (DEX) and borrowing/lending applications. 

Crypto assets are volatile, and their price can change significantly moment to moment. DeFi apps need accurate price feeds that are updated in real time, so that users can execute fair trades.

That’s what oracles do, but the challenge with oracles is twofold: how can they ensure the information is accurate, and how can they provide that information in a secure and decentralized way? 

To solve that challenge, oracles often aggregate real-time price data from many sources, and Pyth takes a unique approach to that. Unlike other oracles, which push prices to users, the Pyth Network uses a low-latency pull oracle design. In this design, some of the world’s largest exchanges, market makers, and financial services providers publish their proprietary price data on-chain for aggregation and distribution via Pyth to other smart contract applications.

The Pyth Network is the largest first-party financial oracle network delivering real-time market data to over 30 blockchains securely and transparently.

Learn more about Pyth from their website and documentation.

Oracle Use Cases in DeFi

DeFi applications on Stacks benefit when they have more options for real-time price feeds. Orderbooks, both spot and perpetual, depend on price feeds for setting stop limits and liquidation triggers. Borrowing and lending applications will rely on an oracle solution for accurately valuing collateral locked in pools.

DeFi teams on Stacks such as ALEX, Hermetica, Arkadiko and Zest are eager to integrate price feeds in their applications, and we are excited that Pyth is now an option to fulfill those needs.

Get Started

This Developer Preview of the Stacks x Pyth integration is live on testnet and mainnet.

This early access launch is intended for developers to test, explore, and begin integrating their decentralized applications with real-time price data. After teams have had the opportunity to integrate Pyth price feeds and share feedback with the Pyth team, Hiro plans to continue contributing towards a full implementation of the Pyth price data. This integration has two primary components: the contracts and the relayer.

Contracts

There are two contracts associated with the Pyth oracle:

  • Wormhole-core: this contract implements the core feature of the wormhole protocol, including the ability to ensure that payloads are correctly signed by at least 13 of the 19 guardians that rule the Pyth protocol.
  • pyth-oracle: this contract receives price feeds coming from the Pyth network.

Relayer

The beauty of the Pyth protocol is that everything is permissionless.

Anyone can update the oracle, and the update will go through as long as it has been correctly attested and signed by the guardians. For the developer preview, Hiro is running a relayer so that developers can simply consume the price feeds. 

Check out our relayer, which is publishing price feed updates for BTC-USD on Testnet and BTC-USD, STX-USD and ETH-USD on Mainnet.

We can’t wait to see what you build with this new oracle in the ecosystem. Let us know what you think!

Product updates & dev resources straight to your inbox
Your Email is in an invalid format
Checkbox is required.
Thanks for
subscribing.
Oops! Something went wrong while submitting the form.
Copy link
Mailbox
Hiro news & product updates straight to your inbox
Only relevant communications. We promise we won’t spam.

Related stories