File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -748,7 +748,7 @@ export const Swap: React.FC<ISwap> = ({
748
748
749
749
onSwap (
750
750
simulateResult . poolKey ,
751
- BigInt ( ( + slippTolerance * Number ( PERCENTAGE_DENOMINATOR ) ) / 100 ) ,
751
+ BigInt ( Math . round ( ( + slippTolerance * Number ( PERCENTAGE_DENOMINATOR ) ) / 100 ) ) ,
752
752
simulateResult . targetSqrtPrice ,
753
753
tokenFrom ,
754
754
tokenTo ,
@@ -777,7 +777,7 @@ export const Swap: React.FC<ISwap> = ({
777
777
778
778
onSwap (
779
779
simulateResult . poolKey ,
780
- BigInt ( ( + slippTolerance * Number ( PERCENTAGE_DENOMINATOR ) ) / 100 ) ,
780
+ BigInt ( Math . round ( ( + slippTolerance * Number ( PERCENTAGE_DENOMINATOR ) ) / 100 ) ) ,
781
781
simulateResult . targetSqrtPrice ,
782
782
tokenFrom ,
783
783
tokenTo ,
Original file line number Diff line number Diff line change @@ -303,7 +303,7 @@ export function* handleGetSimulateResult(action: PayloadAction<Simulate>) {
303
303
byAmountIn ,
304
304
xToY ? MIN_SQRT_PRICE : MAX_SQRT_PRICE
305
305
)
306
- console . log ( result )
306
+
307
307
if ( result . maxSwapStepsReached || result . globalInsufficientLiquidity ) {
308
308
if (
309
309
byAmountIn
@@ -312,7 +312,6 @@ export function* handleGetSimulateResult(action: PayloadAction<Simulate>) {
312
312
) {
313
313
insufficientLiquidityAmountOut = byAmountIn ? result . amountOut : result . amountIn
314
314
fee = pool . poolKey . feeTier . fee
315
- priceImpact = 1
316
315
errors . push ( SwapError . MaxSwapStepsReached )
317
316
}
318
317
@@ -351,7 +350,7 @@ export function* handleGetSimulateResult(action: PayloadAction<Simulate>) {
351
350
actions . setSimulateResult ( {
352
351
poolKey : swapPossible ? poolKey : null ,
353
352
amountOut : validatedAmountOut ,
354
- priceImpact,
353
+ priceImpact : swapPossible ? priceImpact : 1 ,
355
354
targetSqrtPrice,
356
355
fee,
357
356
errors
You can’t perform that action at this time.
0 commit comments