Content
@
0 reply
0 recast
0 reaction
fico
@fico23
is there a way to calculate 2% slippage on both tokens? like how many tokens0 we need to reach 2% slippage.
1 reply
0 recast
0 reaction
Haardik
@haardikkk
Given the current price P 2% slippage (depending on direction) will be hit when price is 1.02*P or 0.98*P Take the square root and convert to Q Notation to get the sqrtPriceLimitX96
1 reply
0 recast
1 reaction
fico
@fico23
yeah I figured that part, but there isnt any periphery or sdk function that does that? they're all either exact input or exact output. but i need something like: getInput(target_sqrPriceLimitX96)
2 replies
0 recast
0 reaction
Haardik
@haardikkk
Not sure about helper functions for that - I’ll try looking Tagging @poi as well if you know this
0 reply
0 recast
1 reaction