Post
Topic
Board Bitcoin Discussion
Re: Algorithm for selecting a low-fee transaction from the mempool
by
o_e_l_e_o
on 21/05/2023, 10:39:20 UTC
Not sure how corefeehelper computes those estimates, but I don't think it makes those estimates with the "hope" of the mempool somehow magically clearing in the next days. After all, its estimates dynamically change as the mempool size fluctuates, so I think corefeehelper publishes those estimates periodically under the assumption that the mempool size remains the same at the time of those estimates are published.
I don't think either of those scenarios would be accurate. As I said above 11.7 sats/vbyte was 90 MvB from the tip. If the mempool stayed the same size as in no new transactions were broadcast, then you would hit that level in about 15 hours, which is far less than 3-7 days. Similarly, if the mempool stayed the same size as in every block which was found was replaced by the same weight of new transactions paying the same fee, then we would never hit 11.7 sats/vbyte because the mempool would never empty.

Every fee estimator has its own method. Some are better than others. Some simply place your transaction within x MvB from the tip, while others pay attention to recent trends, whether the mempool is filling or emptying, incoming transactions over the last x hours, variance in the hashrate, and so forth.

Also some wallets e.g. electrum provide an estimate themselves based on mempool size and selected fee, so maybe someone pointing to their code on computing this estimate would be also interesting.
The static and mempool fee from Electrum requires no estimation. You simply pick either a flat fee or the set number of MvB from the tip. The code for the ETA fee on the other hand can be found here: https://github.com/spesmilo/electrum/blob/fda408e4e47f3093cf8da6713174bfc1cb5bac63/electrum/simple_config.py#L423