Skip to content

Add instructions to migrate to Pyth from Chainlink #250

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 17, 2024
Merged

Conversation

jayantk
Copy link
Contributor

@jayantk jayantk commented Apr 16, 2024

Add a how-to guide explaining how to use Pyth as a drop-in replacement for chainlink compatible apps.

Copy link

vercel bot commented Apr 16, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
documentation ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 17, 2024 1:49pm

[
"/price-feeds/pythnet-price-feeds/pull-updates",
"/price-feeds/pull-updates",
],
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

drive-by: we moved this page and forgot a redirect. There are a couple inbound links to the old URL.

@@ -0,0 +1,100 @@
# Migrate from Chainlink to Pyth

This guide explains how to migrate an EVM application that uses Chainlink price feeds to use Pyth price feeds.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chainlink price feeds to use Pyth price feeds

Pyth provides a Chainlink-compatible interface for its price feeds to make this process simple.
There are two main steps to the migration:

1. Deploy the `PythAggregatorV3` contract to provide a Chainlink-compatible feed interface.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


## Deploy Adapter Contract

Chainlink-compatible applications can deploy and use `PythAggregatorV3` in `@pythnetwork/pyth-sdk-solidity` as a replacement for their Chainlink price feeds.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can be written like "You can deploy PythAggregatorV3 as a replacement for Chainlink price feeds"

The context for migration has been set multiple times above, so we don't need to rewrite it IMO.

## Schedule Updates

Chainlink-compatible applications typically expect on-chain price feeds to update on a schedule.
When migrating to Pyth, apps may need to schedule these price updates themselves.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we highlight this?
Or should we mention this above?

Because this is the biggest change.

Chainlink-compatible applications can deploy and use `PythAggregatorV3` in `@pythnetwork/pyth-sdk-solidity` as a replacement for their Chainlink price feeds.
`PythAggregatorV3` is an adapter contract that wraps the Pyth contract and implements Chainlink's `AggregatorV3Interface`.

One important difference between Pyth and Chainlink is that the Pyth contract holds data for all price feeds, whereas Chainlink has separate instances of `AggregatorV3Interface` for each feed.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This narrative feels better.

"Pyth contract holds data for all price feeds, in comparison to Chainlink, which has separate instances of AggregatorV3Interface` for every feed.

@jayantk jayantk merged commit 1f995f8 into main Apr 17, 2024
4 checks passed
@jayantk jayantk deleted the migration2 branch April 17, 2024 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants