Expand description
Pyth price-feed helpers (PriceUpdateV2 accounts — push or pull).
§Preferred flow (push feed accounts)
The Pyth Data Association maintains continuously-updated price feed accounts at fixed PDAs
(heartbeat ~400 ms). Pass crate::consts::PYTH_BTC_USD_PRICE_FEED_ACCOUNT directly to
AdminInstantSettlement — no Hermes fetch or post_update_atomic required.
§Settlement price chain
AdminInstantSettlement reads the close price from the Pyth push feed and writes it back to
Treasury::last_close_*. The next period’s settlement reads that stored value as its open
reference. No anchor transaction at open_ts is needed.
Structs§
Functions§
- assert_
pyth_ receiver_ owner - Assert that
infois owned by either the Pyth Receiver program (pull feeds) or the Pyth Push Oracle program (continuously-maintained push feed accounts). - load_
fresh_ price - Parse a
PriceUpdateV2account into our internalPricetype. - outcome_
from_ open_ close - Determine UP or DOWN from open vs close prices at a common exponent.