Open iurii2002 opened 1 year ago
Is there a solution for this? I also experience the same on a WMATIC/USDC 0.3% pool for v3 on polygon.
This assertion error is being triggered because, when finding the nearest viable tick to the one derived from the bitmap, an "out of bounds" tick is being returned.
May be some weird edge case - my solution to calculating tvl on-chain at the time was a bit hacky and had to do with reverse engineering how the tick-bitmap was built for each pool.
Using the subgraph for now is probably your best proxy for TVL data.
Edit: I have not been active in maintaining my contributions to this project lately so this would be a great first issue for someone else to tackle!
Just stumbled into the same issue when trying to use mint_liquidity
.
AssertionError: Provided tick is out of bounds: (-887200, 887200)
Edit: I managed to fix it by doing the proper tick calculation with encode_sqrt_ratioX96
and the new get_tick_at_sqrt
in https://github.com/uniswap-python/uniswap-python/commit/7f4d5c740fefd8355c2837ee2e7e3c6f0c455980
I am trying to use get_tvl_in_pool to get the best option between 0.3% and 1% pools on UniV3 When I use it for WETH/USDC pair 0.3% pair it gets reverted with "Provided tick is out of bounds: (-887220, 887220)" error.
My code:
Error
However, for the WETH/APE pool it works just fine. So this is probably some corner case that makes script fail. Not really sure how to fix it