From dbf061e8584665bfb126f0552d560e6a050295c6 Mon Sep 17 00:00:00 2001 From: 0xmDreamy <0xmDreamy@proton.me> Date: Fri, 3 Jan 2025 22:27:54 +0100 Subject: [PATCH] fix slippage calculation --- web3-functions/magicusd0pp/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/web3-functions/magicusd0pp/index.ts b/web3-functions/magicusd0pp/index.ts index 0a4aca6..5ddc5b8 100644 --- a/web3-functions/magicusd0pp/index.ts +++ b/web3-functions/magicusd0pp/index.ts @@ -185,8 +185,9 @@ Web3Function.onRun( args: [ quote.transaction.to, quote.transaction.data, - (quote.outputTokens[0].amount * WAD) / - parseEther(`${(10_000 - slippageLimitBps) / 10_000}`), + (quote.outputTokens[0].amount * + parseEther(`${(10_000 - slippageLimitBps) / 10_000}`)) / + WAD, ], }), });