diff --git a/packages/agents/sdk-wrapper/src/lib/helpers/shared.ts b/packages/agents/sdk-wrapper/src/lib/helpers/shared.ts index fb8ab34264..a42cabbfdb 100644 --- a/packages/agents/sdk-wrapper/src/lib/helpers/shared.ts +++ b/packages/agents/sdk-wrapper/src/lib/helpers/shared.ts @@ -16,7 +16,7 @@ import { providers } from "ethers"; import { UriInvalid, ApiRequestFailed, ParseConnextLogFailed } from "../errors/index"; -export const relayerBufferPercentage = 20; // 20% bump on total estimated relayer fee +export const relayerBufferPercentage = 40; // 40% bump on total estimated relayer fee export const getChainData = _getChainData; export const domainToChainId = _domainToChainId; diff --git a/packages/agents/sdk/src/lib/helpers/shared.ts b/packages/agents/sdk/src/lib/helpers/shared.ts index cbd5cc2850..0190aa4f80 100644 --- a/packages/agents/sdk/src/lib/helpers/shared.ts +++ b/packages/agents/sdk/src/lib/helpers/shared.ts @@ -16,7 +16,7 @@ import { providers } from "ethers"; import { UriInvalid, ApiRequestFailed, ParseConnextLogFailed } from "../errors/index"; -export const relayerBufferPercentage = 20; // 20% bump on total estimated relayer fee +export const relayerBufferPercentage = 40; // 40% bump on total estimated relayer fee export const getChainData = _getChainData; export const domainToChainId = _domainToChainId; diff --git a/packages/utils/src/peripherals/relayer.ts b/packages/utils/src/peripherals/relayer.ts index cf3506bced..99a510d276 100644 --- a/packages/utils/src/peripherals/relayer.ts +++ b/packages/utils/src/peripherals/relayer.ts @@ -8,7 +8,7 @@ import { Logger, createLoggingContext, RequestContext } from "../logging"; import { ChainData } from "./chainData"; import { safeGetConversionRate, getGelatoEstimatedFee } from "./gelato"; -const relayerBufferPercentage = 20; // 20% bump on total estimated relayer fee +const relayerBufferPercentage = 40; // 40% bump on total estimated relayer fee export const calculateRelayerFee = async ( params: { diff --git a/packages/utils/test/peripherals/relayer.spec.ts b/packages/utils/test/peripherals/relayer.spec.ts index a2fb4c08f5..6547f3b57f 100644 --- a/packages/utils/test/peripherals/relayer.spec.ts +++ b/packages/utils/test/peripherals/relayer.spec.ts @@ -42,8 +42,8 @@ describe("Peripherals:Relayer", () => { logger, ); // estimatedRelayerFee = (estimatedGelatoFee + estimatedGelatoFee x buffer_percentage / 100) x ( destinationTokenPrice / originTokenPrice ) - // ==> (10000 + 10000 x 20 / 100) x ( 1.5 / 1 ) = 18000 - expect(estimatedRelayerFee).to.be.deep.eq(BigNumber.from("18000")); + // ==> (10000 + 10000 x 40 / 100) x ( 1.5 / 1 ) = 18000 + expect(estimatedRelayerFee).to.be.deep.eq(BigNumber.from("21000")); }); it("should return correct value when provided token prices", async () => { @@ -59,8 +59,8 @@ describe("Peripherals:Relayer", () => { logger, ); // estimatedRelayerFee = (estimatedGelatoFee + estimatedGelatoFee x buffer_percentage / 100) x ( destinationTokenPrice / originTokenPrice ) - // ==> (10000 + 10000 x 20 / 100) x ( 1500 / 1000 ) = 18000 - expect(estimatedRelayerFee).to.be.deep.eq(BigNumber.from("18000")); + // ==> (10000 + 10000 x 40 / 100) x ( 1500 / 1000 ) = 18000 + expect(estimatedRelayerFee).to.be.deep.eq(BigNumber.from("21000")); }); it("should return correct value when provided gas price", async () => { @@ -79,8 +79,8 @@ describe("Peripherals:Relayer", () => { // fallbackRelayerFee = gasPrice x executeGasAmount // ==> 50 x 400000 = 20000000 // estimatedRelayerFee = (fallbackRelayerFee + fallbackRelayerFee x buffer_percentage / 100) x ( destinationTokenPrice / originTokenPrice ) - // ==> (20000000 + 20000000 x 20 / 100) x ( 1.5 / 1 ) = 36000000 - expect(estimatedRelayerFee).to.be.deep.eq(BigNumber.from("36000000")); + // ==> (20000000 + 20000000 x 40 / 100) x ( 1.5 / 1 ) = 36000000 + expect(estimatedRelayerFee).to.be.deep.eq(BigNumber.from("42000000")); }); it("should add l1Gas for optimism network", async () => { @@ -133,8 +133,8 @@ describe("Peripherals:Relayer", () => { logger, ); // estimatedRelayerFee = (estimatedGelatoFee + estimatedGelatoFee x buffer_percentage / 100) x ( destinationTokenPrice / originTokenPrice ) - // ==> (10000 + 10000 x 20 / 100) x ( 1.5 / 1 ) = 108000 - expect(estimatedRelayerFee).to.be.deep.eq(BigNumber.from("18000")); + // ==> (10000 + 10000 x 40 / 100) x ( 1.5 / 1 ) = 108000 + expect(estimatedRelayerFee).to.be.deep.eq(BigNumber.from("21000")); }); }); });