diff --git a/pythclient/pythaccounts.py b/pythclient/pythaccounts.py index 38e9b33..d92ef0b 100644 --- a/pythclient/pythaccounts.py +++ b/pythclient/pythaccounts.py @@ -489,6 +489,9 @@ def __init__(self, key: SolanaPublicKey, solana: SolanaClient, *, product: Optio self.derivations: Dict[EmaType, int] = {} self.timestamp: int = 0 # unix timestamp in seconds self.min_publishers: Optional[int] = None + self.prev_slot: int = 0 + self.prev_price: float = field(init=False) + self.prev_conf: float = field(init=False) self.prev_timestamp: int = 0 # unix timestamp in seconds @property @@ -512,7 +515,7 @@ def aggregate_price_confidence_interval(self) -> Optional[float]: return self.aggregate_price_info.confidence_interval else: return None - + @property def aggregate_price_status(self) -> Optional[PythPriceStatus]: """The aggregate price status.""" @@ -562,9 +565,11 @@ def update_from(self, buffer: bytes, *, version: int, offset: int = 0) -> None: timestamp, min_publishers = struct.unpack_from(" None: self.price_components = price_components self.timestamp = timestamp self.min_publishers = min_publishers + self.prev_slot = prev_slot + self.prev_price = prev_price + self.prev_conf = prev_conf self.prev_timestamp = prev_timestamp def __str__(self) -> str: