Content pfp
Content
@
0 reply
0 recast
0 reaction

Julie Shi pfp
Julie Shi
@julieshi
Hey guys, I have a question about sqrtPriceLimit. It seems that uniswap will do a partial swap if sqrt_p hits the sqrtPriceLimit rather than revert the whole swap - i wonder if my understanding is correct.
2 replies
0 recast
2 reactions

saucepoint pfp
saucepoint
@poi
did a quick lil investigation -- partial swaps can be supported! before we run swap logic, we'll check if sqrtPrice is within the user's specified limits assuming it passes, we reach this while loop where we swap until input has been fully used OR sqrtPriceLimit is reached in the latter case this is a partial swap!
0 reply
0 recast
0 reaction

saucepoint pfp
saucepoint
@poi
worth mentioning that the swap router (PoolSwapTest) can enforce whether or not partial swaps are supported in main, it will revert if the entirety of the input amount is *not* used
0 reply
0 recast
1 reaction