From 7abc071b052c404ace5ae3cd462b5f1f8f7b764f Mon Sep 17 00:00:00 2001 From: Tejas Badadare Date: Tue, 3 Dec 2024 12:42:23 -0800 Subject: [PATCH] Exclude coming soon feeds from alerts (#82) * skip alerting on coming soon feeds * feat: bump ver --- pyproject.toml | 2 +- pyth_observer/__init__.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 6be8b0e..b55868d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ ignore_missing_imports = true [tool.poetry] name = "pyth-observer" -version = "0.3.0" +version = "0.3.1" description = "Alerts and stuff" authors = [] readme = "README.md" diff --git a/pyth_observer/__init__.py b/pyth_observer/__init__.py index 8fa1d98..1a520aa 100644 --- a/pyth_observer/__init__.py +++ b/pyth_observer/__init__.py @@ -90,6 +90,12 @@ async def run(self): # for each publisher). states = [] price_accounts = await self.get_pyth_prices(product) + + # If the min_publishers is set to 255, this is a "coming soon" feed and is not live yet + # Skip alerting on these feeds + if product.prices[PythPriceType.PRICE].min_publishers == 255: + continue + crosschain_price = crosschain_prices.get( b58decode(product.first_price_account_key.key).hex(), None )