From cee1200a5dd8d09a6afa5df11ac0d48e5287600e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20K=C4=99dzia?= <67273035+KedziaPawel@users.noreply.github.com> Date: Thu, 28 Nov 2024 10:06:57 +0100 Subject: [PATCH] feat: gmx improvements (#574) --- .changeset/spotty-buses-flash.md | 5 +++++ packages/sdk/src/Portfolio/Integrations/GMXV2.ts | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .changeset/spotty-buses-flash.md diff --git a/.changeset/spotty-buses-flash.md b/.changeset/spotty-buses-flash.md new file mode 100644 index 00000000..63019cba --- /dev/null +++ b/.changeset/spotty-buses-flash.md @@ -0,0 +1,5 @@ +--- +"@enzymefinance/sdk": patch +--- + +GMX improvements diff --git a/packages/sdk/src/Portfolio/Integrations/GMXV2.ts b/packages/sdk/src/Portfolio/Integrations/GMXV2.ts index 3abd0534..f9bcf9af 100644 --- a/packages/sdk/src/Portfolio/Integrations/GMXV2.ts +++ b/packages/sdk/src/Portfolio/Integrations/GMXV2.ts @@ -3464,7 +3464,9 @@ export async function getExecutionFee({ executionGasFeeMultiplierFactor, }); - return adjustedGasLimit * gasPrice; + const value = adjustedGasLimit * gasPrice; + + return value + multiplyBySlippage({ value, slippage: 0.3 }); // add 30% slippage to gas fee if gas price in block changes while order is being created } export function adjustGasLimitForEstimate({