From 33ff6be9697c636835fb917967b73dec96500918 Mon Sep 17 00:00:00 2001 From: Ha Quang Minh Date: Wed, 6 Nov 2024 15:15:31 +0700 Subject: [PATCH] env for testnet --- src/batcher-fee-reduction/configs.internal.ts | 74 ++++++++++++++----- 1 file changed, 56 insertions(+), 18 deletions(-) diff --git a/src/batcher-fee-reduction/configs.internal.ts b/src/batcher-fee-reduction/configs.internal.ts index 032ec93..05abcf1 100644 --- a/src/batcher-fee-reduction/configs.internal.ts +++ b/src/batcher-fee-reduction/configs.internal.ts @@ -37,13 +37,19 @@ export type BatcherFeeConfig = { export const FIXED_BATCHER_FEE = 2_000_000n; -const MIN_TESTNET = "e16c2dc8ae937e8d3790c7fd7168d7b994621ba14ca11415f39fed724d494e" -const ADA_MIN_LP_V1_TESTNET = "e4214b7cce62ac6fbba385d164df48e157eae5863521b4b67ca71d863bb0079303c57812462dec9de8fb867cef8fd3768de7f12c77f6f0dd80381d0d" -const ADA_MIN_LP_V2_TESTNET = "d6aae2059baee188f74917493cf7637e679cd219bdfbbf4dcbeb1d0b6c3ea488e6ff940bb6fb1b18fd605b5931d9fefde6440117015ba484cf321200" +const MIN_TESTNET = + "e16c2dc8ae937e8d3790c7fd7168d7b994621ba14ca11415f39fed724d494e"; +const ADA_MIN_LP_V1_TESTNET = + "e4214b7cce62ac6fbba385d164df48e157eae5863521b4b67ca71d863bb0079303c57812462dec9de8fb867cef8fd3768de7f12c77f6f0dd80381d0d"; +const ADA_MIN_LP_V2_TESTNET = + "d6aae2059baee188f74917493cf7637e679cd219bdfbbf4dcbeb1d0b6c3ea488e6ff940bb6fb1b18fd605b5931d9fefde6440117015ba484cf321200"; -const MIN_MAINNET = "29d222ce763455e3d7a09a665ce554f00ac89d2e99a1a83d267170c64d494e" -const ADA_MIN_LP_V1_MAINNET = "e4214b7cce62ac6fbba385d164df48e157eae5863521b4b67ca71d866aa2153e1ae896a95539c9d62f76cedcdabdcdf144e564b8955f609d660cf6a2" -const ADA_MIN_LP_V2_MAINNET = "f5808c2c990d86da54bfc97d89cee6efa20cd8461616359478d96b4c82e2b1fd27a7712a1a9cf750dfbea1a5778611b20e06dd6a611df7a643f8cb75" +const MIN_MAINNET = + "29d222ce763455e3d7a09a665ce554f00ac89d2e99a1a83d267170c64d494e"; +const ADA_MIN_LP_V1_MAINNET = + "e4214b7cce62ac6fbba385d164df48e157eae5863521b4b67ca71d866aa2153e1ae896a95539c9d62f76cedcdabdcdf144e564b8955f609d660cf6a2"; +const ADA_MIN_LP_V2_MAINNET = + "f5808c2c990d86da54bfc97d89cee6efa20cd8461616359478d96b4c82e2b1fd27a7712a1a9cf750dfbea1a5778611b20e06dd6a611df7a643f8cb75"; export namespace BatcherFeeConfig { export const CONFIG: Record< @@ -101,7 +107,7 @@ export namespace BatcherFeeConfig { minFee: 750_000n, startTime: new Date("2024-07-01T05:00:00.000Z"), endCondition: { - endTime: new Date("2024-10-10T08:00:00.000Z") + endTime: new Date("2024-10-10T08:00:00.000Z"), }, assets: [ { @@ -137,7 +143,7 @@ export namespace BatcherFeeConfig { maximumAmount: 5_000_000_000n, // 5B ADA-MIN LP V2 }, ], - } + }, ], }, }, @@ -167,7 +173,7 @@ export namespace BatcherFeeConfig { maxFee: 2_000_000n, minFee: 1_500_000n, startTime: new Date("2024-06-24T00:00:00.000Z"), - endCondition: undefined, + endCondition: { endTime: new Date("2024-11-04T11:00:00.000Z") }, assets: [ { asset: MIN_TESTNET, // MIN @@ -182,7 +188,23 @@ export namespace BatcherFeeConfig { maximumAmount: 100_000_000n, }, ], - } + }, + { + maxFee: 2_000_000n, + minFee: 1_500_000n, + startTime: new Date("2024-11-04T11:00:00.000Z"), + endCondition: undefined, + assets: [ + { + asset: MIN_TESTNET, // MIN + maximumAmount: 10_000_000n, + }, + { + asset: ADA_MIN_LP_V1_TESTNET, // ADA-MIN LP V1 + maximumAmount: 100_000_000n, + }, + ], + }, ], }, [DexVersion.STABLESWAP]: { @@ -210,7 +232,7 @@ export namespace BatcherFeeConfig { maxFee: 2_000_000n, minFee: 1_500_000n, startTime: new Date("2024-06-24T00:00:00.000Z"), - endCondition: undefined, + endCondition: { endTime: new Date("2024-11-04T11:00:00.000Z") }, assets: [ { asset: MIN_TESTNET, // MIN @@ -225,7 +247,23 @@ export namespace BatcherFeeConfig { maximumAmount: 100_000_000n, }, ], - } + }, + { + maxFee: 2_000_000n, + minFee: 1_500_000n, + startTime: new Date("2024-11-04T11:00:00.000Z"), + endCondition: undefined, + assets: [ + { + asset: MIN_TESTNET, // MIN + maximumAmount: 10_000_000n, + }, + { + asset: ADA_MIN_LP_V1_TESTNET, // ADA-MIN LP V1 + maximumAmount: 100_000_000n, + }, + ], + }, ], }, [DexVersion.DEX_V2]: { @@ -236,7 +274,7 @@ export namespace BatcherFeeConfig { minFee: 1_000_000n, startTime: new Date("2024-04-23T00:00:00.000Z"), endCondition: { - endTime: new Date("2024-06-24T00:00:00.000Z") + endTime: new Date("2024-06-24T00:00:00.000Z"), }, assets: [ { @@ -291,11 +329,11 @@ export namespace BatcherFeeConfig { export function getActiveConfig({ networkEnv, dexVersion, - currentDate + currentDate, }: { - networkEnv: NetworkEnvironment, - dexVersion: DexVersion, - currentDate: Date, + networkEnv: NetworkEnvironment; + dexVersion: DexVersion; + currentDate: Date; }): BatcherFeeReductionConfig | undefined { const batcherFeeConfig = CONFIG[networkEnv][dexVersion]; let activeReductionConfig: BatcherFeeReductionConfig | undefined; @@ -314,4 +352,4 @@ export namespace BatcherFeeConfig { } return activeReductionConfig; } -} \ No newline at end of file +}