phoenix fix

This commit is contained in:
Nour Alharithi
2023-12-12 14:14:47 -08:00
parent 6ee967933f
commit aa7df63625
2 changed files with 38 additions and 4 deletions

View File

@@ -168,7 +168,16 @@ const initializeAllMarketSubscribers = async (driftClient: DriftClient) => {
sdkConfig
);
await phoenixSubscriber.subscribe();
markets[market.marketIndex].phoenix = phoenixSubscriber;
// Test get L2 to know if we should add
try {
phoenixSubscriber.getL2Asks();
phoenixSubscriber.getL2Bids();
markets[market.marketIndex].phoenix = phoenixSubscriber;
} catch (e) {
logger.info(
`Excluding phoenix for ${market.marketIndex}, error: ${e}`
);
}
}
}
@@ -183,7 +192,15 @@ const initializeAllMarketSubscribers = async (driftClient: DriftClient) => {
sdkConfig
);
await serumSubscriber.subscribe();
markets[market.marketIndex].serum = serumSubscriber;
try {
serumSubscriber.getL2Asks();
serumSubscriber.getL2Bids();
markets[market.marketIndex].serum = serumSubscriber;
} catch (e) {
logger.info(
`Excluding phoenix for ${market.marketIndex}, error: ${e}`
);
}
}
}
}