does staleness threshold for each asset is same or it can be a different value
pyth::get_stale_price_threshold_secs() ? do we have to call updatePriceFeed before calling list_ema_prices_no_older_than() ?
does staleness threshold for each asset is same or it can be a different value
pyth::get_stale_price_threshold_secs() ? do we have to call updatePriceFeed before calling list_ema_prices_no_older_than() ?
No we don’t have staleness threshold per asset and in fact discourage using our default staleness (which is 60s). I recommend you get the prices with the ..._no_older_than methods to apply your desired staleness threshold.
does it have any security implication if we use default staleness (which is 60s) ?
gm
sorry for the slow reply there.
It definitely can.
if you were to solely use the time elapsed to trigger a price update, say every 60s: if following your price update at s1, the price of the asset drops by 1-10-50% in the next 59s, your scheduler will not trigger a price update and could send you a price update that is arbitrarily/significantly different from your 1st one.
This is why you should favor/think more around the price deviation value rather than the time elapsed for the price of an asset.
Taking an opposite example: a stablecoin should (arguably) be worth about $1 (+/-0.01$ or even less) - you practically do not need to update the stablecoin price onchain every 60s.
You could update the feed every 24 hours and still receive a price rather similar.
However, it becomes important to trigger price updates if/when the price moves and here you’d rely on the price deviation threshold rather than purely the time elapsed since the last price update
Let me know if this makes sense