Skip to content

Commit

Permalink
set slippage to default instead of 0
Browse files Browse the repository at this point in the history
  • Loading branch information
brianshattuck committed Jan 23, 2025
1 parent 597cc7e commit 5db5f48
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/state/swap/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import { GlobalData, RouterTypes, SmartRouter } from 'constants/index';
import useFindBestRoute from 'hooks/useFindBestRoute';
import { useAutoSlippageTolerance } from 'hooks/useAutoSlippageTolerance';
import { formatAdvancedPercent } from 'utils/numbers';
import { SLIPPAGE_DEFAULT } from 'state/user/reducer';

export function useSwapState(): AppState['swap'] {
return useSelector<AppState, AppState['swap']>((state) => state.swap);
Expand Down Expand Up @@ -310,7 +311,7 @@ export function useDerivedSwapInfo(): {
) {
setUserSlippageTolerance(10);
} else {
setUserSlippageTolerance(0);
setUserSlippageTolerance(SLIPPAGE_DEFAULT);
setUserSlippageAuto(true);
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/state/swap/v3/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import { WrappedTokenInfo } from 'state/lists/v3/wrappedTokenInfo';
import { ChainId } from '@uniswap/sdk';
import { GlobalData } from 'constants/index';
import { useAutoSlippageTolerance } from 'hooks/useAutoSlippageTolerance';
import { SLIPPAGE_DEFAULT } from 'state/user/reducer';

export function useSwapState(): AppState['swapV3'] {
return useAppSelector((state) => {
Expand Down Expand Up @@ -273,7 +274,7 @@ export function useDerivedSwapInfo(): {
) {
setUserSlippageTolerance(10);
} else {
setUserSlippageTolerance(0);
setUserSlippageTolerance(SLIPPAGE_DEFAULT);
setUserSlippageAuto(true);
}
}
Expand Down

0 comments on commit 5db5f48

Please sign in to comment.