Content pfp
Content
@
0 reply
0 recast
2 reactions

sean ๐Ÿ”น pfp
sean ๐Ÿ”น
@swabbie.eth
anyone know why the uniswapv3 example tries to find the next lower tick (w/ liquidity) as active tick rather than the next higher tick? also, i'm not seeing the interface repo find the next tick - perhaps current tick is good enough? https://github.com/Uniswap/examples/blob/main/v3-sdk/pool-data/src/libs/pool-data.ts
2 replies
0 recast
2 reactions

brendon pfp
brendon
@brendon
not sure about the example, but during a swap the next initialized tick will be less than or equal to the current tick if the swap is zero for one (trading token0 for token1).
1 reply
0 recast
1 reaction

sean ๐Ÿ”น pfp
sean ๐Ÿ”น
@swabbie.eth
right, but it seems like any assumption on direction for next active tick gives a buy/sell bias to the price, which in this case is displayed on the liquidity chart. i know the current tick isn't necessarily representative of the liquidity used in the next swap, but seems like a more neutral choice
1 reply
0 recast
1 reaction

brendon pfp
brendon
@brendon
ah, i see what you mean. i think they're just looking for an active tick and then iterating by the tick spacing to display the liquidity between ticks. liquidity only really makes sense in ranges between ticks.
1 reply
0 recast
1 reaction