Parse pyth benchmark prices aptos #1750
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pyth Module
Overview
The Pyth module provides functionality for parsing and validating price feeds from VAA (Verifiable Authenticated Account) data. This module ensures that the price feeds are within a specified publish time range and that all requested price IDs have corresponding valid updates.
Functions
1.
parse_and_validate_price_feeds
Parses and validates price feeds within the specified publish time range.
Parameters:
price_infos
: &vector<price_info::PriceInfo>requested_price_ids
: vector<vector>min_publish_time
: u64max_publish_time
: u64Returns:
vector<price_feed::PriceFeed>
2.
parse_price_feed_updates_from_vaa
Parses a single VAA and returns a vector of price feeds within the specified publish time range.
Parameters:
vaa
: vectorrequested_price_ids
: vector<vector>min_publish_time
: u64max_publish_time
: u64Returns:
vector<price_feed::PriceFeed>
3.
parse_price_feed_updates
Public function to parse multiple price feed updates from VAA data.
Parameters:
update_data
: vector<vector>requested_price_ids
: vector<vector>min_publish_time
: u64max_publish_time
: u64fee
: CoinReturns:
vector<price_feed::PriceFeed>
Aptos Move Compile
Example Usage