Skip to content

Commit

Permalink
dont init pyth lazer subscriber if no pyth lazer ids
Browse files Browse the repository at this point in the history
  • Loading branch information
NourAlharithi committed Feb 25, 2025
1 parent b87aa36 commit b7edb6e
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions src/experimental-bots/filler/fillerMultithreaded.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit b7edb6e

Please sign in to comment.