From 2e5c451a3695d1387cb099f94426a1403702f32b Mon Sep 17 00:00:00 2001 From: doomsower <12031673+doomsower@users.noreply.github.com> Date: Wed, 25 Dec 2024 08:38:14 -0300 Subject: [PATCH] fix: compressor batch size config --- src/attachSDK.ts | 2 +- src/config/env.ts | 1 + src/config/schema.ts | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/attachSDK.ts b/src/attachSDK.ts index 0fa4453..ce76f32 100644 --- a/src/attachSDK.ts +++ b/src/attachSDK.ts @@ -63,7 +63,7 @@ export default async function attachSDK(): Promise { // }, // ); const service = new CreditAccountsService(sdk, { - batchSize: config.batchSize, // TODO: technically, this is different batch size, needs to be changed + batchSize: config.compressorBatchSize, }); return service; diff --git a/src/config/env.ts b/src/config/env.ts index e87d903..6344e21 100644 --- a/src/config/env.ts +++ b/src/config/env.ts @@ -8,6 +8,7 @@ const envConfigMapping: Record = { debugAccount: "DEBUG_ACCOUNT", debugManager: "DEBUG_MANAGER", batchSize: "BATCH_SIZE", + compressorBatchSize: "COMPRESSOR_BATCH_SIZE", castBin: "CAST_BIN", deployPartialLiquidatorContracts: "DEPLOY_PARTIAL_LIQUIDATOR", deployBatchLiquidatorContracts: "DEPLOY_BATCH_LIQUIDATOR", diff --git a/src/config/schema.ts b/src/config/schema.ts index abf2022..1b604cb 100644 --- a/src/config/schema.ts +++ b/src/config/schema.ts @@ -109,6 +109,10 @@ export const ConfigSchema = z.object({ * Number of accounts to liquidate at once using batch liquidator */ batchSize: z.coerce.number().nonnegative().default(10), + /** + * Limit number of accounts to load from compressor. 0 = unlimited, let compressor decide + */ + compressorBatchSize: z.coerce.number().nonnegative().default(0), /** * Slippage value for pathfined */