From 665ca6f034af84babc927b3a5b811b4fb88b52b5 Mon Sep 17 00:00:00 2001 From: n3wbie Date: Mon, 16 Oct 2023 18:02:58 +0900 Subject: [PATCH] GSW-430 fix: swap logic when `amountSpecified` is negative --- pool/pool.gno | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pool/pool.gno b/pool/pool.gno index ad8ce31f..f332dbfd 100644 --- a/pool/pool.gno +++ b/pool/pool.gno @@ -249,7 +249,7 @@ func Swap( } } - for state.amountSpecifiedRemaining != 0 && state.sqrtPriceX96 != sqrtPriceLimitX96 { + for state.amountSpecifiedRemaining != 0 && state.amountSpecifiedRemaining != -1 && state.sqrtPriceX96 != sqrtPriceLimitX96 { var step StepComputations step.sqrtPriceStartX96 = state.sqrtPriceX96