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

wrong from address when fetching multiple swaps #171

Open
simple-marvin opened this issue Sep 18, 2024 · 1 comment
Open

wrong from address when fetching multiple swaps #171

simple-marvin opened this issue Sep 18, 2024 · 1 comment

Comments

@simple-marvin
Copy link

Hey guys, so i tried to fetch multiple swaps the from address is the null address (0x000...000), but when i just try to get one of those swaps where the from address is null and just try to fetch them directly by id, i get the correct from address.

While i wrote this i tried different stuff out and found out, its not about the query, its about the time when fetching it, so sometimes the multiple swaps query works and sometimes dont.
But when i first try to run the multiple swaps query and then the single swap query, it seems like i refresh it in a way which then returns me the correct from address.

i know my description is bit confusing, its because i am confused my self, sometimes it works and sometimes it doesnt, i dont get it, but its a problem when i try to fetch multiple swaps the from address is 0x000...000.

reduced query to replicate the issue:
{ swaps( first: 1, where: { id:"0xfb2580fdcea1a32800ca28d5e892ce495b5b24c5629f94daa99044aa8ca87a74-1" } ){ id from amount0In } }

result for that query:
{ "data": { "swaps": [ { "from": "0x0000000000000000000000000000000000000000", "id": "0xfb2580fdcea1a32800ca28d5e892ce495b5b24c5629f94daa99044aa8ca87a74-1", "amount0In": "294876321.807129226", } ] } }

Query to directly get that swap:
{ swap( id: "0xfb2580fdcea1a32800ca28d5e892ce495b5b24c5629f94daa99044aa8ca87a74-1" ){ id from amount0In } }

Result:
{ "data": { "swap": { "amount0In": "294876321.807129226", "from": "0x6e79bba75c5ceb1b33cadafc1f6c945e5795742c", "id": "0xfb2580fdcea1a32800ca28d5e892ce495b5b24c5629f94daa99044aa8ca87a74-1" } } }

Kind Regards
Marvin

@simple-marvin
Copy link
Author

Sorry, but again i have to change the way to replicate it, it has nothing to do with the query (it currently seems like to me), its all about the time, so when i firstly run "swaps" or "swap" query it shows me the null address in the from field, but when i wait 20-60 secs (maybe even a bit longer) and then run the query again, it shows me the correct address in the from field

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

1 participant