You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I was syncing the original Pool I need (WETH/ENS) I ran into the Sqrt error still. This is because in this pool, all the Liquidity was drained by a MEV transaction, and it does not return the same Sqrt as UniswapV3Pool.sol in this instance, however when liquidity is restored the value corrects.
Hence I suggest adding the following to your scripts to protect against this scenario, not sure what pools you are investigating but low liquidity pools will definitely run into this issue.
Note that you will need to add liquidity to the return tuple of querySwap & swap. I've not done this as I'm not using the TS code, but this bug will be present in your repo, especially on the WETH/ENS pool with this data set:
There's some corner case like soon after a pool was deployed, since liquidity at this time was relatively small, swap with large amountSpecified could lead price to the edge of the model and drain the liquidity from the pool. And of course that kind of swap can be suffered from MEV actions.
With the fix #56 Tuner will reproduce the full state of the pool like things happened in the mainnet, however we believe both LP providers and traders should be careful when Tuner says global liquidity equals 0, it's not a good time to make decisions unless you're an expert.
Thanks to @jamescarter-le , without him we can hardly find this case. For more details , see issue #51 .
Last one guys:
When I was syncing the original Pool I need (WETH/ENS) I ran into the Sqrt error still. This is because in this pool, all the Liquidity was drained by a MEV transaction, and it does not return the same Sqrt as UniswapV3Pool.sol in this instance, however when liquidity is restored the value corrects.
Hence I suggest adding the following to your scripts to protect against this scenario, not sure what pools you are investigating but low liquidity pools will definitely run into this issue.
Note that you will need to add liquidity to the return tuple of querySwap & swap. I've not done this as I'm not using the TS code, but this bug will be present in your repo, especially on the WETH/ENS pool with this data set:
Originally posted by @jamescarter-le in #51 (comment)
The text was updated successfully, but these errors were encountered: