How I can calculate Estimated Confirmation Duration
Can someone give me a formula to calculate Estimated Confirmation Duration of a pending transaction like etherscan.io do?
Ethereum Stack Exchange is a question and answer site for users of Ethereum, the decentralized application platform and smart contract enabled blockchain. It only takes a minute to sign up.Sign up to join this community
There is no formula.
You are waiting for a miner to pick up your transaction and include it in a block. They are under no obligation to that. They are financially incentivized to do that by the
gasPrice you offered them. If it's taking too long, then offer isn't good enough.
The best you can do is compare to historical norms for similarly-priced transactions. As Nikita pointed out, EthGasStation reports such statistics. It will be a curve, with some completing faster than others.
In a situation like yours with a stalled transaction, you can't be sure it won't mine. You would want to be sure of that before you, say, send it again with a higher gas price.
Have a look over here for a way to get a confirmation that you have cancelled it. Canceling / overwriting a pending transaction using geth JSON RPC
Hope it helps.
At EthGasStation.info, they have this calculator. On youtube you can find many tutorials how to properly use this tool, although it should be self explanatory.