For Pyth Pro Streams, does the StreamUpdated payload continue to be published during market off-hours, or does it simply keep returning the last available market price (e.g., Friday’s closing price) until the market reopens?
For example, if I receive the latest StreamUpdated payload on Saturday:
- Will it be the exact same report that was produced at Friday’s market close?
- Or will Pyth generate a new payload on Saturday containing the same price?
Additionally, in the Saturday payload, would feedUpdateTimestamp correspond to the actual market update time (Friday’s close), or would it reflect the time the Saturday payload was generated?
Can someone from pyth team please respond to this query, or point me to the right person?
Apologies, completely missed that one.
The behavior depends on the channel:
- With a fixed_rate@… channel, StreamUpdated messages continue at the configured interval during market off-hours. Once a feed has produced its first valid price, the latest price is carried forward; no new market price is generated while the market is closed.
- With real_time, updates are sent when a new price is available, so a closed market may not produce regular updates.
To identify whether a price is fresh or carried forward, include feedUpdateTimestamp in the subscription properties:
- feedUpdateTimestamp == timestampUs: the price was generated in the current update.
- feedUpdateTimestamp < timestampUs: the price was carried forward from an earlier update.
So a Saturday fixed-rate update may contain Friday’s closing price, while feedUpdateTimestamp remains Friday’s price-generation time and timestampUs reflects the Saturday stream update.
See the subscription guide and payload reference.
Thanks, that’s clear on using feedUpdateTimestamp == timestampUs to detect a fresh price.
I want to follow up on the wording in one line: “a closed market may not produce regular updates.” The “may” implies that a closed market can still, under some conditions, “generate” a genuinely new price rather than only carrying the last one forward.
Concretely: for an asset whose primary market is closed over the weekend, under what conditions can the feed generate a new price during that closed period, i.e., a real_time or fixed_rate update where feedUpdateTimestamp == timestampUs rather than a carried-forward one where feedUpdateTimestamp < timestampUs?
I’m trying to understand whether “market closed” reliably means “no new price generation” on both channels, or whether fresh price generation can still occur off-hours for certain assets.
If a feed’s marketSession is actually closed, Pyth should not generate a new price merely because a fixed_rate subscription continues sending updates. Those updates carry forward the latest available price, so feedUpdateTimestamp < timestampUs.
real_time only sends an update when a new price is available, so a genuinely closed feed should not produce fresh real_time prices either.
The important distinction is that “off-hours” does not always mean marketSession: "closed". Some feeds may have an active preMarket, postMarket, or overNight session, while crypto feeds operate 24/7. Fresh prices can be generated during those sessions, with feedUpdateTimestamp == timestampUs.
Therefore, you should check both marketSession and feedUpdateTimestamp. If a feed reports marketSession: "closed" and feedUpdateTimestamp == timestampUs, that would be unexpected and worth investigating with the symbol, channel, and payload timestamps.
The available session values are regular, preMarket, postMarket, overNight, and closed. The details are in the payload reference.