Price Feeds
GetUpdateFee

Get Update Fee

Get the fee required to update the on-chain price feeds with the provided vaas. Returns both a quantity of tokens and denomination. The returned number of the specified token should be sent as the transaction value when executing UpdatePriceFeeds.

The vaas can be retrieved from the Hermes API (opens in a new tab). By default, Hermes returns these as base64-encoded strings; these can be directly included in a CosmWasm query, as CosmWasm uses a base64 string encoding for the Binary type.

ArgumentInputDescription

vaas*

vec<Binary>

The price updates that you would like to submit to UpdatePriceFeeds
Examples

Example Code

use pyth_sdk_cw::{
  get_update_fee,
};
use cosmwasm_std::{
  Addr,
  Binary,
  Coin,
  Deps,
};
 
fn example_function(deps: &Deps) -> () {
  let fee_coin: Coin = get_update_fee(
    &deps.querier,
    Addr::unchecked("neutron1m2emc93m9gpwgsrsf2vylv9xvgqh654630v7dfrhrkmr5slly53spg85wv"),
    &vec![Binary::from_base64("<vaa>").unwrap()]
  ).unwrap();
}
Last updated on