Avalanche Speedy Nodes Connection Filter Error

I took the avalanche node’s url into a provider and then wrote the filter below. However, it gives the error:
ValueError: {‘code’: -32000, ‘message’: ‘filter not found’}. I am using web3.py and trying to get all transactions made by a smart contract involving a specific event. By the way, this code runs with avalanche’s public api. How can i solve this?

.... import ContractAddress
.... import abi

web3 = Web3(Web3.HTTPProvider('https://speedy-nodes-nyc.moralis.io/asfasdfsdf/avalanche/mainnet'))
contract = web3.eth.contract(address=ContractAddress, abi=abi)
my_filter = contract.events.StartGame.createFilter(fromBlock='latest', toBlock='latest')
entries = my_filter.get_all_entries()

you may not be able to solve it, you could try to use a Moralis Server to sync the events: https://docs.moralis.io/moralis-server/automatic-transaction-sync/smart-contract-events

or you can try to use another node provider

you could also try different values for these parameters

Thank you! I have found an alternative way getting the latest block and searching through it. It seems the moralis nodes are also lagging behind the network like avalanche’s own api. Do you know anyway to get real time data from c chain?

how big is the lag that you see?

It is around 10-15 seconds

Sorry for newbie questions but is it related to my internet connection? But in my opinion it should not make that kind of difference. I guess i should run my own node to reduce that lag below 5 seconds?

can you try multiple times to see if every time is 15 seconds delay?

Not every time but it is mostly 10 seconds. How can i get realtime event data?

I don’t know, did you try another node provider?

in what kind of data are you interested?

I haven’t tried any other before moralis, this is the first one. Actually i am trying to build a bot which needs two hexes from the data field of the transaction by finding the relevant event. So far, it is a total disaster, maybe i am not that competent to build one as i have not enough experience in coding :frowning: . I am just trying new things and enchance my skills in the process :slight_smile: