Skip to content
This repository was archived by the owner on May 6, 2025. It is now read-only.

Add parsePriceFeedUpdates #34

Merged
merged 2 commits into from
Nov 15, 2022
Merged

Add parsePriceFeedUpdates #34

merged 2 commits into from
Nov 15, 2022

Conversation

ali-behjati
Copy link
Contributor

@ali-behjati ali-behjati commented Nov 14, 2022

This PR adds parsePriceFeedUpdates method to the Pyth interface.

Some protocols need to access the price of a feed at a fixed point of time rather than the most recent one. This method will enable them to do so.

Also, this PR removes the transfer back logic as it is removed from the original contract to be consistent with Aptos.

@ali-behjati ali-behjati merged commit 9297259 into main Nov 15, 2022
@ali-behjati ali-behjati deleted the abehjati/add-parse-interface branch November 15, 2022 08:56
@njk-64
Copy link

njk-64 commented Nov 15, 2022

The value expected to be passed in the updateData array is the priceFeed data itself or the VAA? Also unrelated to this PR, but just realised the Price Struct in the sdk seems to not reflect the changed Price layout.

@ali-behjati
Copy link
Contributor Author

ali-behjati commented Nov 15, 2022

The value expected to be passed in the updateData array is the priceFeed data itself or the VAA?

It is the VAA. in the mock contract it is the encoded price feed as user does not care.

Also unrelated to this PR, but just realised the Price Struct in the sdk seems to not reflect the changed Price layout.

Yeah the Price here is a bit different than the way we store the price. We always construct these structs when user queries a price (or a pricefeed)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants