From 919aebf10dabfe2c696089d108487081178e75ec Mon Sep 17 00:00:00 2001 From: Nour Alharithi Date: Sun, 8 Dec 2024 10:38:09 -0800 Subject: [PATCH] remove phoenix subscribers from spot markets --- drift-common | 2 +- src/index.ts | 34 ---------------------------------- 2 files changed, 1 insertion(+), 35 deletions(-) diff --git a/drift-common b/drift-common index ebeabb3..e91ef8b 160000 --- a/drift-common +++ b/drift-common @@ -1 +1 @@ -Subproject commit ebeabb37a30c326a4b6c0c30c7dadc9994710575 +Subproject commit e91ef8b3ea8ca61bba760e4b8804cd9d12c1f26d diff --git a/src/index.ts b/src/index.ts index 7e50057..c6711f5 100644 --- a/src/index.ts +++ b/src/index.ts @@ -17,8 +17,6 @@ import { initialize, isVariant, OrderSubscriber, - PhoenixSubscriber, - BulkAccountLoader, isOperationPaused, PerpOperation, DelistedMarketSetting, @@ -157,38 +155,6 @@ const initializeAllMarketSubscribers = async (driftClient: DriftClient) => { openbook: undefined, }; - if (market.phoenixMarket) { - const phoenixConfigAccount = - await driftClient.getPhoenixV1FulfillmentConfig(market.phoenixMarket); - if (isVariant(phoenixConfigAccount.status, 'enabled')) { - const bulkAccountLoader = new BulkAccountLoader( - driftClient.connection, - stateCommitment, - 5_000 - ); - const phoenixSubscriber = new PhoenixSubscriber({ - connection: driftClient.connection, - programId: new PublicKey(sdkConfig.PHOENIX), - marketAddress: phoenixConfigAccount.phoenixMarket, - accountSubscription: { - type: 'polling', - accountLoader: bulkAccountLoader, - }, - }); - await phoenixSubscriber.subscribe(); - // 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}` - ); - } - } - } - if (market.openbookMarket) { const openbookConfigAccount = await driftClient.getOpenbookV2FulfillmentConfig(market.openbookMarket);