Module lazer

Source
Expand description

Pyth Lazer adapter feed data — the native, feed-id-keyed shape the contract/pyth-lazer adapter stores and serves. The adapter is a pure store-and-serve oracle: it hands back the raw FeedData, and each consumer (the proxy-oracle’s Lazer source, the gateway) projects it to a pyth::Price itself, mirroring redstone::FeedData::to_pyth_price. Freshness is likewise the consumer’s concern; the adapter applies no age filter on reads.

Modules§

ext_pyth_lazer

Structs§

EmaData
EMA price/confidence for a feed, following the same fixed-point expo as the spot price.
FeedData
The latest stored data for one Lazer feed. Prices/exponent follow the Pyth fixed-point convention (value * 10^expo); the timestamp is stored as Nanoseconds.
ParsedFeedView
JSON view of one verified feed returned by the adapter’s verify_update — the full Lazer property set (not just the Pyth-compatible subset). Price-like values are raw i64 mantissas (interpret with exponent); _ns timestamps are nanoseconds. None = property absent.
VerifiedUpdateView
JSON view of a verified update returned by the adapter’s verify_update.

Traits§

PythLazer
Feed-id-keyed read ABI of the Pyth Lazer adapter (contract/pyth-lazer). Feeds are addressed by their native u32 id; the adapter serves the raw stored FeedData and the consumer projects it (mirroring the RedStone adapter, which serves redstone::FeedData).

Functions§

feed_data_from_parsed
Fallibly build a storable FeedData from a verified feed, owning every intrinsic validity rule. Returns None for missing price or exponent, missing or invalid spot/EMA confidence, missing EMA price, or an effective publish timestamp more than max_ahead_s seconds beyond now. Anti-replay is relational and handled by the caller.

Type Aliases§

FeedDataResponse
Response shape of the adapter’s feed-id-keyed read (get_feeds_data): the raw stored feed for each requested u32 feed id (None when the feed is absent).