Skip to content

Commit

Permalink
env for testnet
Browse files Browse the repository at this point in the history
  • Loading branch information
m1n999999 committed Nov 6, 2024
1 parent a61d20b commit 33ff6be
Showing 1 changed file with 56 additions and 18 deletions.
74 changes: 56 additions & 18 deletions src/batcher-fee-reduction/configs.internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<
Expand Down Expand Up @@ -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: [
{
Expand Down Expand Up @@ -137,7 +143,7 @@ export namespace BatcherFeeConfig {
maximumAmount: 5_000_000_000n, // 5B ADA-MIN LP V2
},
],
}
},
],
},
},
Expand Down Expand Up @@ -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
Expand All @@ -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]: {
Expand Down Expand Up @@ -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
Expand All @@ -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]: {
Expand All @@ -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: [
{
Expand Down Expand Up @@ -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;
Expand All @@ -314,4 +352,4 @@ export namespace BatcherFeeConfig {
}
return activeReductionConfig;
}
}
}

0 comments on commit 33ff6be

Please sign in to comment.