Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

query surroundingTicks return wrong liquidityNet/liquidityGross value #187

Open
florije4ex opened this issue Sep 15, 2023 · 1 comment
Open

Comments

@florije4ex
Copy link

The chart of liquidity of pool USDC / ETH(https://info.uniswap.org/#/pools/0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640) show some highly amount liquidity

WX20230915-130656

And we read the source code of info.uniswap.org(https://github.com/Uniswap/v3-info), and find the core code of query: https://github.com/Uniswap/v3-info/blob/03d02f17f74e1953d31f309c132edef9cec2fa2d/src/data/pools/tickData.ts#L69C38-L69C38
, and deal with data at:
https://github.com/Uniswap/v3-info/blob/03d02f17f74e1953d31f309c132edef9cec2fa2d/src/data/pools/tickData.ts#L257

So we query subgraph api and get the same result as info.uniswap.org data:

WX20230915-131201

!!!!!BUT, when we query ticks from etherscan.io or from ethereum node rpc, we get tick data as follow:
WX20230915-130728

liquidityGross is 7597427743119697 and liquidityNet is -7597427743119697.
We think there should be something wrong with subgraph api, and it give wrong data on some tick.
Can you explain why will some tick data is not correct, and will tick data be modified in future?

@stefanmsy
Copy link

There is some calculation required to have the liquidity from the tick data. You may refer to https://github.com/atiselsts/uniswap-v3-liquidity-math

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants