v3-sdk
v3-sdk copied to clipboard
UNI V3 Invariant failed: TICK_LOWER
Can anyone help me to solve this issue "Invariant failed: TICK_LOWER"
You tick is probably not according to the tick spacing. Try using nearestUsableTick
to get a valid tick.
Or the pool you are trying to use is at the minimum tick and cannot get "TICK_LOWER" because there is no lower usable tick.
@SaltySousChef How to get the pool fee?
What is the best way to calculate underlying assets of univ3 pool?
The easiest way to get both of those values is via Uniswap's graph. If you want to do it in code you can create an instance of the pool in your language of choice and call Slot0 which will return the global state for the pool and contains the fee, current tick, liquidity and sqrtPrice which can allow you to figure out the virtual reserves. The math for this and figuring out the real reserves is in the whitepaper.
Probably you have not used the correct pool address or pool hash code