Open DanieleMDiNosse opened 1 month ago
Good spot.
We have not deeply vetted the code, so if you have insight what is causing this we are happy to fix.
I observed that in certain pools, such as USDC/WETH .05% ('0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640'), the liquidity gross column generated by first using create_tick_delta_csv and then create_tick_csv displays negative values. According to my knowledge of Uniswap v3's functionality, this should not be possible.
It all comes down to what is the range of events you have.
Breaking down the functionality of each function:
create_tick_delta_csv()
basically outputs all the mint and burn events and tick range of eachcreate_tick_csv()
uses data from tick delta to aggregate to have the liquidity delta, hence the name of the column is liquidity_gross_delta
, not liquidity_gross
So both functions above don't handle the fetching part of the source data: events. If your source data (events) only contains events in a certain range of blocks in history, then liquidity delta is possible to be negative (more burns than mints)
I observed that in certain pools, such as USDC/WETH .05% ('0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640'), the liquidity gross column generated by first using create_tick_delta_csv and then create_tick_csv displays negative values. According to my knowledge of Uniswap v3's functionality, this should not be possible.
It all comes down to what is the range of events you have.
Breaking down the functionality of each function:
create_tick_delta_csv()
basically outputs all the mint and burn events and tick range of eachcreate_tick_csv()
uses data from tick delta to aggregate to have the liquidity delta, hence the name of the column isliquidity_gross_delta
, notliquidity_gross
So both functions above don't handle the fetching part of the source data: events. If your source data (events) only contains events in a certain range of blocks in history, then liquidity delta is possible to be negative (more burns than mints)
I downloaded all the data since the first Uniswap V3 block via the official tutorial. If I am the only one that is experiencing this issue, I do not exclude the possibility that it can be a data fetching problem due to the Ethereum node. I will try using different sources and I will update this discussion.
If anyone has some other insight, please share it with us!
Good spot.
We have not deeply vetted the code, so if you have insight what is causing this we are happy to fix.
Of course!
I observed that in certain pools, such as USDC/WETH .05% ('0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640'), the liquidity gross column generated by first using create_tick_delta_csv and then create_tick_csv displays negative values. According to my knowledge of Uniswap v3's functionality, this should not be possible.