-

@ arvin
2025-05-13 16:20:22
> fee is not calculated based on what you have on your mempool that's not correct. even core is using more advanced methods to estimate fee. its just an argument
I'm sorry, you must be joking
In core, fee estimates are calculated entirely from the mempool. This isn't even up for debate, it's literally in the code.
- The `TxConfirmStats` class ([here](https://github.com/bitcoin/bitcoin/blob/8309a9747a8df96517970841b3648937d05939a3/src/policy/fees.cpp#L77)) builds buckets of mempool transactions based on fee rates and then analyzes how long they take to be mined.
- If you unravel `TxConfirmStats::EstimateMedianVal` ([here](https://github.com/bitcoin/bitcoin/blob/8309a9747a8df96517970841b3648937d05939a3/src/policy/fees.cpp#L244)), the code scans buckets of stored feerates built **from the mempool** and gives you the median feerate for the bucket that most closely matches your confirmation criterion.
It's the same for other estimators as well. We rely primarily on the mempool.space estimator in the `bria` engine we use for Blink ([here](https://github.com/GaloyMoney/bria/blob/018f25b52f991886f1c6ee9713cee4ee641e8187/src/fees/client.rs#L23)) as it's the most reliable we've found from years of observed transaction activity. And if you go to the mempool.space repo and look at how they do fees, `getRecommendedFee` is called ([here](https://github.com/mempool/mempool/blob/cba4308447341725587c232f77c102efc834d488/backend/src/api/fee-api.ts#L22])) which if you follow the code uses mempool transactions and projected mempool blocks to estimate fees.
I think this is the issue lots of us are having with this "debate". Lots of things are being said that aren't even subjective, just objectively wrong.