Sui semantics: “update-then-consume”, publish_time freshness, and max_age guidance

Hi Pyth team—quick Sui semantics check: on Sui, does a price update apply only if its publish_time is strictly newer than the on-chain value (and otherwise get ignored vs. reverted)? In a single PTB that calls update_price_feeds with stale updateData and then immediately reads &PriceInfoObject, if someone has already updated the feed to a newer snapshot before our PTB executes, will our update be skipped and get_price return the current on-chain value?
Also, could you share the official Sui docs that recommend “update then consume in the same PTB” and enforcing recency (e.g., get_price_no_older_than), plus whether there’s any Sui equivalent to EVM’s updatePriceFeedsIfNecessary and guidance on units/recommended max_age? Thanks!

Hello, thanks for the question!

There is an assertion that the update is the latest. If there is newer data in the price object, the update is skipped (It is successful but does nothing). The subsequent read will read the latest value that exists on the chain.

Here is a link to the docs: https://docs.pyth.network/price-feeds/use-real-time-data/sui#additional-resources

See the orange section right above Additional Resources to see the reccomendation for PTB pyth usage.

3 Likes