-
-
- Your IOTA Move module **should NOT** have a hard-coded call to
- `pyth::update_single_price_feed.` In other words, a contract should **never
- call** the IOTA Pyth `pyth::update_single_price_feed` entry point. Instead, it
- should be called directly from client code (e.g., Typescript or Rust).
-
-
-
- When IOTA contracts are
- [upgraded](https://docs.iota.org/developer/iota-101/move-overview/package-upgrades/introduction),
- the address changes, which makes the old address no longer valid. If your
- module has a hard-coded call to `pyth::update_single_price_feed` living at a
- fixed call-site, it may eventually get bricked due to how Pyth upgrades are
- implemented. (Pyth only allow users to interact with the most recent package
- version for security reasons).
-
-
-
- Therefore, you should build a [IOTA programmable
- transaction](https://docs.iota.org/developer/iota-101/transactions/ptb/programmable-transaction-blocks-overview)
- that first updates the price by calling `pyth::update_single_price_feed` at
- the latest call-site from the client-side and then call a function in your
- contract that invokes `pyth::get_price` on the `PriceInfoObject` to get the
- recently updated price.
-
-
- You can use `IOTAPythClient` to build such transactions and handle all the
- complexity of updating the price feeds.
-
-
-
- Consult [Fetch Price Updates](../fetch-price-updates) for more information on
- how to fetch the `pyth_price_update`.
-
-
-
+