Change the Block Confirmations when data is indexed

I see that the no of block confirmations before the confirmed field is changed to true is different for each blockchain as seen here. Like Ethereum has 12 Block confirmations, Avalanche has 100 etc. I want the number of block confirmations to be configurable, so I can work with fewer block confirmations say for Avalanche.

I checked the MongoDB table fields but couldn’t find any field for block confirmations count change.
How can I achieve this?

you can not change that number, what you could do could be get the unconfirmed event and somehow to wait a fewer number of blocks until you consider it as confirmed, or to consider it confirmed directly when you receive it as unconfirmed (it may be enough for avalanche in particular, you could check avalanche documentation to see if it makes sense)

1 Like

I understand if it can’t be changed but it would be nice if there was some way that it can be made configurable, maybe in the Moralis SDK with a self-hosted Server?

The reason I am asking this is, say I have some 10k events populated and I only want to act upon quality data and confirmed transactions in real-time and time-sensitive use cases. 100 confirmations seem quite large for Avalanche.

Now for each of the 10k events, if I try to do block confirmations until only say 12 confirmations, it is not going to be performance efficient. Since Moralis is already keeping track of each and every transaction confirmations, if that can be made configurable, that would really help a lot

I think that a user considered in the past in particular for avalanche that 1 confirmation is enough for him. You can read more about how avalanche works to see if it is good enough for you to use the original unconfirmed event.

When you self host or use the streams api if you are also tracking somehow the latest block number then you could do your own implementation for when to consider it as confirmed.

1 Like