Skip to content

Commit 67fb0f1

Browse files
authored
Merge pull request #3076 from pyth-network/fhqvst/ui-241-publisher-page-throwing-errors-in-conformance-cluster
fix: Exclude feeds for which there are product accounts but no price account
2 parents d47fd3c + b9f85f0 commit 67fb0f1

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

apps/insights/src/services/pyth/get-feeds.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ import { priceFeedsSchema } from "../../schemas/pyth/price-feeds-schema";
66
const _getFeeds = async (cluster: Cluster) => {
77
const unfilteredData = await getPythMetadata(cluster);
88
const filtered = unfilteredData.symbols
9-
.filter(
10-
(symbol) =>
11-
unfilteredData.productFromSymbol.get(symbol)?.display_symbol !==
12-
undefined,
13-
)
9+
.filter((symbol) => {
10+
const product = unfilteredData.productFromSymbol.get(symbol);
11+
const hasDisplaySymbol = product?.display_symbol !== undefined;
12+
const hasPriceAccount = product?.price_account !== undefined;
13+
14+
return hasDisplaySymbol && hasPriceAccount;
15+
})
1416
.map((symbol) => ({
1517
symbol,
1618
product: unfilteredData.productFromSymbol.get(symbol),

0 commit comments

Comments
 (0)