MoralisWeb3 / issue-tracker

25 stars 7 forks source link

POST /{address}/events from_block -> to_block not working properly #100

Closed cryptassic closed 3 years ago

cryptassic commented 3 years ago

I'm trying to implement the logic for my code to return more than 200K Events using /{address}/events endpoint in Web3 API. Request queries are executed async with max 20 threads simultaneously.

After the result list reaches ~150K zone I'm starting to get random errors 500/504.

So I'm trying to implement slicing. from_block -> to_block . I just found out that from_block and to_block filters don't work properly on /{address}/events.

Params used:

limit:100 from_block:13274001 to_block:13274101 topic:Swap(address,address,int256,int256,uint160,uint128,int24) address:0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640 abi: { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "sender", "type": "address" }, { "indexed": true, "internalType": "address", "name": "recipient", "type": "address" }, { "indexed": false, "internalType": "int256", "name": "amount0", "type": "int256" }, { "indexed": false, "internalType": "int256", "name": "amount1", "type": "int256" }, { "indexed": false, "internalType": "uint160", "name": "sqrtPriceX96", "type": "uint160" }, { "indexed": false, "internalType": "uint128", "name": "liquidity", "type": "uint128" }, { "indexed": false, "internalType": "int24", "name": "tick", "type": "int24" } ], "name": "Swap", "type": "event" }

The results I get are way above to_block limit.

cryptassic commented 3 years ago

Now it's filtering correctly. Thank you!