Content
@
0 reply
0 recast
2 reactions
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
@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
@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
@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
sean
@swabbie.eth
ah yea that makes sense. gotta choose some direction
0 reply
0 recast
1 reaction