Skip to content

Commit

Permalink
feat: gmx improvements (#574)
Browse files Browse the repository at this point in the history
  • Loading branch information
KedziaPawel authored Nov 28, 2024
1 parent 1db8e78 commit cee1200
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/spotty-buses-flash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@enzymefinance/sdk": patch
---

GMX improvements
4 changes: 3 additions & 1 deletion packages/sdk/src/Portfolio/Integrations/GMXV2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down

0 comments on commit cee1200

Please sign in to comment.