From b7edb6e765cf9289854f957826031ae6689ae100 Mon Sep 17 00:00:00 2001 From: Nour Alharithi Date: Tue, 25 Feb 2025 10:56:05 -0800 Subject: [PATCH] dont init pyth lazer subscriber if no pyth lazer ids --- .../filler/fillerMultithreaded.ts | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/experimental-bots/filler/fillerMultithreaded.ts b/src/experimental-bots/filler/fillerMultithreaded.ts index ff467c78..4616af0d 100644 --- a/src/experimental-bots/filler/fillerMultithreaded.ts +++ b/src/experimental-bots/filler/fillerMultithreaded.ts @@ -410,14 +410,20 @@ export class FillerMultithreaded { ) .filter((market) => market.pythLazerId !== undefined); const pythLazerIds = markets.map((m) => m.pythLazerId!); - const chunkSize = config.pythLazerChunkSize || 2; - const pythLazerIdsChunks = chunks(pythLazerIds, chunkSize); - this.pythLazerSubscriber = new PythLazerSubscriber( - this.globalConfig.lazerEndpoints, - this.globalConfig.lazerToken, - pythLazerIdsChunks, - this.globalConfig.driftEnv - ); + if (pythLazerIds.length > 0) { + const chunkSize = config.pythLazerChunkSize || 2; + const pythLazerIdsChunks = chunks(pythLazerIds, chunkSize); + this.pythLazerSubscriber = new PythLazerSubscriber( + this.globalConfig.lazerEndpoints, + this.globalConfig.lazerToken, + pythLazerIdsChunks, + this.globalConfig.driftEnv + ); + } else { + logger.info( + 'No pyth lazer ids found, skipping initting PythLazerSubscriber' + ); + } } async init() {