Uniswap / v2-subgraph

Uniswap V2 subgraph 📊
https://thegraph.com/explorer/subgraph/uniswap/uniswap-v2
GNU General Public License v3.0
403 stars 736 forks source link

wrong from address when fetching multiple swaps #171

Open simple-marvin opened 1 week ago

simple-marvin commented 1 week ago

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 commented 1 week ago

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