Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions apps/insights/src/services/pyth/get-feeds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
Loading