delvingbitcoin

Mempool Based Fee Estimation on Bitcoin Core

Mempool Based Fee Estimation on Bitcoin Core

Original Postby renepickhardt

Posted on: April 9, 2024 13:11 UTC

In a recent project supervised until February, the focus was on studying fee estimation through the analysis of the mempool, specifically through a student's work which can be found here.

The project aimed to understand the complexities of Bitcoin fee estimation, especially post-transaction fee spikes. It was observed that Bitcoin core's fee estimator often overestimates fees following these spikes. This observation was supported by a specific diagram illustrating the tendency of the estimator to keep fees high after sudden increases.

The project also delved into the selection of features for predicting transaction fees. The choice between using the median or average fee per byte as a feature was debated. Originally, the median fee seemed like an intuitive choice. However, considering scenarios where a significant portion of transactions in a block could be low fee due to mechanisms like CPFP (Child Pays for Parent), and miners' preference for maximizing total block fees, it was concluded that the average fee per byte might be more indicative of the true cost, correlating better with total fees collected by a block.

Another aspect explored was the potential predictive value of the distribution of mempool resting times for transactions before their confirmation. Transactions that had been in the mempool longer than the average block time and were included in the latest block indicated a lower demand and, hence, a falling fee market. This correlation suggested that periods during which older transactions are confirmed might signal declining fees, assuming no sudden increase in demand.

However, the team identified that the best predictor of fee changes was the block time itself. Shorter block times, indicating the inclusion of many long-waiting transactions, likely lead to decreased fees, whereas longer block times might cause users to increase their fees in hopes of quicker confirmations. Unfortunately, since block times cannot be predicted, this feature could not be utilized in real-time fee estimation.

Lastly, the project received recognition for its technical depth in a student competition, securing second place. The jury, however, recommended a different approach to understanding and improving fee estimation. They suggested viewing fee estimation akin to option pricing, where fees represent the price for the option to have a transaction included in the next block. For future research, they recommended using the Black-Scholes Equation, a fundamental concept in financial markets, to model fee estimation. This approach implies considering the behavior of all network participants rather than focusing solely on mempool statistics.