Price Feeds
update_price_feeds_with_funder

Update Price Feeds with Funder

Update the on-chain price feeds using the provided update_data, which contains serialized and signed price update data from Pyth Network. This function updates the on-chain price if the provided update is more recent than the current on-chain price. Otherwise, the provided update will be ignored. The function call will succeed even if the update is ignored.

You can retrieve the latest price update_data for a given set of price feeds from the Hermes API (opens in a new tab). By default, the data is returned as a base64-encoded string that you must deserialize into a vector of bytes before calling this method.

This function requires the caller to pay a fee to perform the update. The required fee for the provided updates will automatically be transferred from the provided account.

Reverts if the account does not have a sufficient balance or update_data is incorrectly signed or formatted.

ArgumentInputDescription

account*

signer

The account paying the fee.

update_data*

vector<vector<u8>>

The price update data for the contract to verify.
Examples

Example Code

use pyth::pyth;
use pyth::price_identifier;
 
pyth::update_price_feeds_with_funder(
  funder,
  vec![<update_data>]
);
Last updated on