Skip to content

Commit e151575

Browse files
committed
fix: Mark price feeds fields as optional
1 parent e204c9f commit e151575

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,13 @@ const _getFeeds = async (cluster: Cluster) => {
77
const unfilteredData = await getPythMetadata(cluster);
88
const filtered = unfilteredData.symbols
99
.filter(
10-
(symbol) =>
11-
unfilteredData.productFromSymbol.get(symbol)?.display_symbol !==
12-
undefined,
10+
(symbol) => {
11+
const product = unfilteredData.productFromSymbol.get(symbol)
12+
const hasDisplaySymbol = product?.display_symbol !== undefined
13+
const hasPriceAccount = product?.price_account !== undefined
14+
15+
return hasDisplaySymbol && hasPriceAccount
16+
}
1317
)
1418
.map((symbol) => ({
1519
symbol,

0 commit comments

Comments
 (0)