Skip to content

Commit

Permalink
fix findDelistedPerpMarketsAndOracles
Browse files Browse the repository at this point in the history
  • Loading branch information
crispheaney committed Nov 27, 2024
1 parent ed25e7c commit 1c6d8cb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sdk/src/accounts/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export function findDelistedPerpMarketsAndOracles(
// make sure oracle isn't used by spot market
const filteredDelistedOracles = [];
for (const delistedOracle of delistedOracles) {
let isUsedBySpotMarket = false;
for (const spotMarket of spotMarkets) {
if (!spotMarket.data) {
continue;
Expand All @@ -45,9 +46,12 @@ export function findDelistedPerpMarketsAndOracles(
spotMarket.data.oracleSource
);
if (spotMarketOracleId === delistedOracleId) {
isUsedBySpotMarket = true;
break;
}
}

if (!isUsedBySpotMarket) {
filteredDelistedOracles.push(delistedOracle);
}
}
Expand Down

0 comments on commit 1c6d8cb

Please sign in to comment.