From b9f85f033ea2b3678dd7b34cbbcd0a8504631f70 Mon Sep 17 00:00:00 2001 From: Filip Hallqvist Date: Tue, 23 Sep 2025 17:41:24 +0200 Subject: [PATCH] fix: Mark price feeds fields as optional --- apps/insights/src/services/pyth/get-feeds.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/apps/insights/src/services/pyth/get-feeds.ts b/apps/insights/src/services/pyth/get-feeds.ts index 17a2d66387..ecd9218605 100644 --- a/apps/insights/src/services/pyth/get-feeds.ts +++ b/apps/insights/src/services/pyth/get-feeds.ts @@ -6,11 +6,13 @@ import { priceFeedsSchema } from "../../schemas/pyth/price-feeds-schema"; const _getFeeds = async (cluster: Cluster) => { const unfilteredData = await getPythMetadata(cluster); const filtered = unfilteredData.symbols - .filter( - (symbol) => - unfilteredData.productFromSymbol.get(symbol)?.display_symbol !== - undefined, - ) + .filter((symbol) => { + const product = unfilteredData.productFromSymbol.get(symbol); + const hasDisplaySymbol = product?.display_symbol !== undefined; + const hasPriceAccount = product?.price_account !== undefined; + + return hasDisplaySymbol && hasPriceAccount; + }) .map((symbol) => ({ symbol, product: unfilteredData.productFromSymbol.get(symbol),