# How to prove a priceUpdate is the latest available?

**URL:** <https://dev-forum.pyth.network/t/how-to-prove-a-priceupdate-is-the-latest-available/422>\
**Category:** Price Feeds\
**Tags:** evm\
**Created:** [September 30, 2025, 12:07am UTC](https://dev-forum.pyth.network/t/how-to-prove-a-priceupdate-is-the-latest-available/422 "2025-09-30T00:07:16Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![0xjimmy](https://avatars.discourse-cdn.com/v4/letter/0/c89c15/32.png) [@0xjimmy](https://dev-forum.pyth.network/u/0xjimmy)\
**Post date:** [September 30, 2025, 12:07am UTC](https://dev-forum.pyth.network/t/how-to-prove-a-priceupdate-is-the-latest-available/422/1 "2025-09-30T00:07:16Z")

</div>

```auto
uint fee = oracle.getUpdateFee(priceUpdate);
oracle.updatePriceFeeds{ value: fee }(priceUpdate);
PythStructs.Price memory price = oracle.getPriceNoOlderThan(priceFeedId, 30);

```

The price only has `publishTime` and no other time guarantees. How can I prove a price update is the most recent (or at least within TTL of the expiry). If the price is from an asset that doesn’t trade 24/7, the `publishTime` will be the time the last price change happened before markets closed. Is there anyway I can prove no updates happened after this up to current time - TTL?

Latest price response from Hermes API has metadata with slot and proof\_available\_time, for example:

```auto
{
  "binary": {
    "encoding": "hex",
    "data": [
      "…"
    ]
  },
  "parsed": [
    {
      "id": "b1073854ed24cbc755dc527418f52b7d271f6cc967bbf8d8129112b18860a593",
      "price": {
        "price": "18187100",
        "conf": "17266",
        "expo": -5,
        "publish_time": 1759176019
      },
      "ema_price": {
        "price": "18154805",
        "conf": "11032",
        "expo": -5,
        "publish_time": 1759176019
      },
      "metadata": {
        "slot": 245773653,
        "proof_available_time": 1759190658,
        "prev_publish_time": 1759176019
      }
    }
  ]
}

```

Is there any way to prove this?

---

<div class="post-metadata">

**Author:** ![0xjimmy](https://avatars.discourse-cdn.com/v4/letter/0/c89c15/32.png) [@0xjimmy](https://dev-forum.pyth.network/u/0xjimmy)\
**Post date:** [September 30, 2025, 12:39am UTC](https://dev-forum.pyth.network/t/how-to-prove-a-priceupdate-is-the-latest-available/422/2 "2025-09-30T00:39:40Z")

</div>

> **[Price Feeds | Pyth Network API Reference](https://api-reference.pyth.network/price-feeds/evm/getPriceNoOlderThan)**
>
> API reference, interactive explorer, and documentation for Pyth network products.

```
function getPriceNoOlderThan(
    bytes32 id,
    uint age
) public view virtual override returns (PythStructs.Price memory price) {
    price = getPriceUnsafe(id);

    if (diff(block.timestamp, price.publishTime) > age)
        revert PythErrors.StalePrice();

    return price;
}

```

I assume what I’m asking is not possible? its based on publishedTime which will not update if market is closed?

---

<div class="post-metadata">

**Author:** ![Aditya520](https://yyz2.discourse-cdn.com/flex034/user_avatar/dev-forum.pyth.network/aditya520/32/12_2.png) [@Aditya520](https://dev-forum.pyth.network/u/Aditya520)\
**Post date:** [September 30, 2025, 3:01am UTC](https://dev-forum.pyth.network/t/how-to-prove-a-priceupdate-is-the-latest-available/422/3 "2025-09-30T03:01:32Z")

</div>

That’s true.  
When you fetch from hermes `v2/update/price/latest` , it will return the latest price which was published & aggregated on pythnet(oracle infra).

---

<div class="post-metadata">

**Author:** ![0xjimmy](https://avatars.discourse-cdn.com/v4/letter/0/c89c15/32.png) [@0xjimmy](https://dev-forum.pyth.network/u/0xjimmy)\
**Post date:** [September 30, 2025, 5:23am UTC](https://dev-forum.pyth.network/t/how-to-prove-a-priceupdate-is-the-latest-available/422/4 "2025-09-30T05:23:48Z")

</div>

Right, so if any proof is submitted onchain, you can only prove that the data is newer than the last known price. But no idea if there are more proofs more recent or the one submitted was the most recent within a time range

Eg last price onchain is from now-1hr, user submits a proof of an update with timestamp of now-30min, no way to prove there are no available proofs since now-30min and now

---

<div class="post-metadata">

**Author:** ![Aditya520](https://yyz2.discourse-cdn.com/flex034/user_avatar/dev-forum.pyth.network/aditya520/32/12_2.png) [@Aditya520](https://dev-forum.pyth.network/u/Aditya520)\
**Post date:** [September 30, 2025, 5:51am UTC](https://dev-forum.pyth.network/t/how-to-prove-a-priceupdate-is-the-latest-available/422/5 "2025-09-30T05:51:38Z")

</div>

You are absolutely right.

On the other hand, all crypto are reference rates price feeds are being updated every 400ms 24x7.  
There are some exception that you can find in our [market hours](https://docs.pyth.network/price-feeds/market-hours) page.

---

<div class="post-metadata">

**Author:** ![0xjimmy](https://avatars.discourse-cdn.com/v4/letter/0/c89c15/32.png) [@0xjimmy](https://dev-forum.pyth.network/u/0xjimmy)\
**Post date:** [September 30, 2025, 6:37am UTC](https://dev-forum.pyth.network/t/how-to-prove-a-priceupdate-is-the-latest-available/422/6 "2025-09-30T06:37:14Z")

</div>

This is an issue for tradfi markets though. [Does Laser have any better guarantees about data?](https://dev-forum.pyth.network/t/using-lazer-after-market-hours/423)

---

<div class="post-metadata">

**Author:** ![Aditya520](https://yyz2.discourse-cdn.com/flex034/user_avatar/dev-forum.pyth.network/aditya520/32/12_2.png) [@Aditya520](https://dev-forum.pyth.network/u/Aditya520)\
**Post date:** [September 30, 2025, 7:24am UTC](https://dev-forum.pyth.network/t/how-to-prove-a-priceupdate-is-the-latest-available/422/7 "2025-09-30T07:24:57Z")

</div>

That’s why we recommend folks to use `getPriceNoOlderThan` with a threshold(age) as per your need. We see alot of users use 30~60 seconds.

[API Reference](https://api-reference.pyth.network/price-feeds/evm/getPriceNoOlderThan) for getPriceNoOlderThan.

If this fails, you can update with the latest price, hence making sure that you are getting the latest price.

---

<div class="post-metadata">

**Author:** ![0xjimmy](https://avatars.discourse-cdn.com/v4/letter/0/c89c15/32.png) [@0xjimmy](https://dev-forum.pyth.network/u/0xjimmy)\
**Post date:** [September 30, 2025, 7:27am UTC](https://dev-forum.pyth.network/t/how-to-prove-a-priceupdate-is-the-latest-available/422/8 "2025-09-30T07:27:58Z")

</div>

Yes but the lack of no new price updates could be from many things.  
Market hours, emergency circuit breaker, pythnet being down, or users not supplying a fresh price update onchain. There is no way to differentiate between no new price available or no new price provided afaik

---

<div class="post-metadata">

**Author:** ![ali](https://avatars.discourse-cdn.com/v4/letter/a/8c91f0/32.png) [@ali](https://dev-forum.pyth.network/u/ali)\
**Post date:** [September 30, 2025, 12:27pm UTC](https://dev-forum.pyth.network/t/how-to-prove-a-priceupdate-is-the-latest-available/422/9 "2025-09-30T12:27:28Z")

</div>

@0xjimmy this is a great question. Unfortunately we don’t have an easy way to do it as each price has it’s own timestamp. However, if you feel a bit hacky, there are ways to proof it by making some assumptions on how the data is generated.

What you can do, is to bundle your asset with a 24/7 asset like Bitcoin and check the timestamp of Bitcoin as an estimate of the time this data was published. You need to ensure the `updateData.length == 1` to have a guarantee that both your asset and Bitcoin are generated from the same block (hence same time) on Pythnet.

If you read about Pyth message format (for instance from [here](https://www.pyth.network/blog/perseus-network-upgrade)) you see all prices form a merkle tree and the root of merkle tree authenticity is verified for cross-chain usage along the merkle proofs for the given prices. In an `updateData` you see an array of bytes, and if there’s only one element it means the price updates have the same merkle root and that single element (`updateData[0]`) contains merkle proofs for all of them.

Please note that this is relying on the internals of the system, they rarely change but if they change, they’ll be posted in this forum. So if you use it, please check the forum regularly.
