Skip to content

Commit adde323

Browse files
committed
fix repay w coll and improved slippage
1 parent f0579c2 commit adde323

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/components/transactions/Swap/helpers/paraswap/misc.helpers.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,9 @@ export const getParaswapSlippage = (
1515
return (Number(baseSlippage) * 2).toString();
1616
}
1717

18+
if (swapType === SwapType.RepayWithCollateral) {
19+
return (Number(baseSlippage) * 5).toString();
20+
}
21+
1822
return baseSlippage;
1923
};

src/components/transactions/Swap/hooks/useSwapQuote.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,16 @@ const getTokenSelectionForQuote = (
4747
const srcToken =
4848
state.useFlashloan == false &&
4949
state.provider === SwapProvider.PARASWAP &&
50-
state.swapType !== SwapType.WithdrawAndSwap
50+
state.swapType !== SwapType.WithdrawAndSwap &&
51+
state.swapType !== SwapType.RepayWithCollateral
5152
? srcTokenObj.addressToSwap
5253
: srcTokenObj.underlyingAddress;
5354
const destTokenObj = invertedQuoteRoute ? state.sourceToken : state.destinationToken;
5455
const destToken =
5556
state.useFlashloan == false &&
5657
state.provider === SwapProvider.PARASWAP &&
57-
state.swapType !== SwapType.WithdrawAndSwap
58+
state.swapType !== SwapType.WithdrawAndSwap &&
59+
state.swapType !== SwapType.RepayWithCollateral
5860
? destTokenObj.addressToSwap
5961
: destTokenObj.underlyingAddress;
6062

0 commit comments

Comments
 (0)