Skip to content

Commit

Permalink
Merge pull request #76 from gnoswap-labs/GSW-430-fix-swap-logic-when-…
Browse files Browse the repository at this point in the history
…amount-specified-is-negative

GSW-430 fix: swap logic when `amountSpecified` is negative
  • Loading branch information
r3v4s authored Oct 16, 2023
2 parents 5730d00 + 665ca6f commit 7b8d21d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pool/pool.gno
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7b8d21d

Please sign in to comment.