only include enabled spot market fulfilments
This commit is contained in:
@@ -147,6 +147,9 @@ const initializeAllMarketSubscribers = async (driftClient: DriftClient) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (market.phoenixMarket) {
|
if (market.phoenixMarket) {
|
||||||
|
const phoenixConfigAccount =
|
||||||
|
await driftClient.getPhoenixV1FulfillmentConfig(market.phoenixMarket);
|
||||||
|
if (isVariant(phoenixConfigAccount.status, 'enabled')) {
|
||||||
const phoenixSubscriber = getPhoenixSubscriber(
|
const phoenixSubscriber = getPhoenixSubscriber(
|
||||||
driftClient,
|
driftClient,
|
||||||
market,
|
market,
|
||||||
@@ -155,8 +158,13 @@ const initializeAllMarketSubscribers = async (driftClient: DriftClient) => {
|
|||||||
await phoenixSubscriber.subscribe();
|
await phoenixSubscriber.subscribe();
|
||||||
markets[market.marketIndex].phoenix = phoenixSubscriber;
|
markets[market.marketIndex].phoenix = phoenixSubscriber;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (market.serumMarket) {
|
if (market.serumMarket) {
|
||||||
|
const serumConfigAccount = await driftClient.getSerumV3FulfillmentConfig(
|
||||||
|
market.serumMarket
|
||||||
|
);
|
||||||
|
if (isVariant(serumConfigAccount.status, 'enabled')) {
|
||||||
const serumSubscriber = getSerumSubscriber(
|
const serumSubscriber = getSerumSubscriber(
|
||||||
driftClient,
|
driftClient,
|
||||||
market,
|
market,
|
||||||
@@ -166,6 +174,7 @@ const initializeAllMarketSubscribers = async (driftClient: DriftClient) => {
|
|||||||
markets[market.marketIndex].serum = serumSubscriber;
|
markets[market.marketIndex].serum = serumSubscriber;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return markets;
|
return markets;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user