Skip to content
This repository has been archived by the owner on Dec 27, 2023. It is now read-only.

Fix: Update logic to sync UniswapV3 pool from swap log #88

Open
0xKitsune opened this issue Apr 18, 2023 · 4 comments
Open

Fix: Update logic to sync UniswapV3 pool from swap log #88

0xKitsune opened this issue Apr 18, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@0xKitsune
Copy link
Owner

Right now, the current logic is getting the amount_0 and amount_1 from log_data[1]. This is incorrect as the amount_0 should be retrieved from log_data[0]. All logic used to sync pools from logs should be checked and updated. Additionally, logic decoding logs should ensure that indexed arguments are handled correctly and not assumed to be in log data.

Snippet for reference

@0xKitsune 0xKitsune added the bug Something isn't working label Apr 18, 2023
@0xfourzerofour
Copy link

0xfourzerofour commented Jul 19, 2023

Yeh I also found a couple issues with this function as well, I will see if I can fix it and make a PR. I fixed most of it but I cant seem to get the tick value on any log that I decode with the topic of "Swap(address,address,int256,int256,uint160,uint128,int24)"

@0xKitsune

@0xfourzerofour
Copy link

0xfourzerofour commented Jul 22, 2023

so weird when I use into_int and then print the tick out it is way larger than an int24 size.

[Int(115792089237316195423570985008687907853269984665640564039160829387916780552215), Int(300000000000000000), Uint(2508392505382192306491947825), Uint(6059485725074018332389), Int(115792089237316195423570985008687907853269984665640564039457584007913129570878)]

this is one of the examples so I cannot convert it into an i32

@0xKitsune
Copy link
Owner Author

Thanks for the update and sorry for the delay in response (its been very busy recently!). I will be able to check this out early this week.

@0xfourzerofour
Copy link

no worries, I think it is a problem with the ethers library instead of your logic so i have reached out to gakonst

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants