# Mempool Based Fee Estimation on Bitcoin Core

**URL:** <https://delvingbitcoin.org/t/mempool-based-fee-estimation-on-bitcoin-core/703>\
**Category:** Implementation\
**Created:** [March 21, 2024, 2:45pm UTC](https://delvingbitcoin.org/t/mempool-based-fee-estimation-on-bitcoin-core/703 "2024-03-21T14:45:23Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![harding](https://delvingbitcoin.org/user_avatar/delvingbitcoin.org/harding/32/925_2.png) [@harding](https://delvingbitcoin.org/u/harding)\
**Post date:** [March 21, 2024, 5:33pm UTC](https://delvingbitcoin.org/t/mempool-based-fee-estimation-on-bitcoin-core/703/2 "2024-03-21T17:33:00Z")

</div>

If you haven’t seen it before, you may want to check out Kalle Alm’s previous research on this subject, e.g. as presented at Scaling Bitcoin 2017:

- [Slides](https://scalingbitcoin.org/stanford2017/Day2/Scaling-2017-Optimizing-fee-estimation-via-the-mempool-state.pdf)
- [Transcript](https://btctranscripts.com/scalingbitcoin/stanford-2017/optimizing-fee-estimation-via-mempool-state/)
- [Video](https://www.youtube.com/watch?v=QkYXPJMqBNk&t=2052s)

One of his points I recall finding particularly insightful was that, for anyone in a position to RBF, we can simply choose a feerate that is `min(confirmed_estimate,mempool_estimate)` where `confirmed_estimate` is based on non-gameable data (like the existing Bitcoin Core estimatesmartfee) and `mempool_estimate` is based on mempool stats like you describe (which has the risk of potentially being gameable and might also break accidentally, such as after a soft fork).

Using the minimum of the two returned values allows the feerate to adapt downwards very quickly without introducing any new risk that feerates could be manipulated upwards by miners or other third parties. If people only use the enhanced estimation for cases where they can RBF, then they can always fee bump if they end up underpaying. (Though it’s worth noting that RBFing has non-financial costs: it typically leaks which output is the change output and it requires the fee bumper either be online to bump or create presigned incremental fee bumps.)

---

_[View the full topic](https://delvingbitcoin.org/t/mempool-based-fee-estimation-on-bitcoin-core/703)._
