Skip to content

Commit 83872e2

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

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const getParaswapSlippage = (
1111

1212
const baseSlippage = inputGroup === outputGroup ? '0.10' : '0.20';
1313

14-
if (swapType === SwapType.DebtSwap) {
14+
if (swapType === SwapType.DebtSwap || swapType === SwapType.RepayWithCollateral) {
1515
return (Number(baseSlippage) * 2).toString();
1616
}
1717

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)