[#MemPoolFeeRateEstimator] = MemPoolFeeRateEstimator :mrdocs: Estimate the fee rate required for a transaction to be included in the next block. == Synopsis Declared in `<policy/fees/mempool_estimator.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class MemPoolFeeRateEstimator; ---- == Description Uses Bitcoin Core's block‐building algorithm to generate a block template from the mempool, then calculates percentile fee rates from the selected chunks: the 75th percentile is returned as the economical estimate and the 50th percentile as the conservative estimate. == Types [cols="1,4"] |=== | Name| Description | xref:MemPoolFeeRateEstimator/Percentiles.adoc[`Percentiles`] | Block percentile fee rates (in sat/vB). |=== == Enums [cols="1,4"] |=== | Name| Description | xref:MemPoolFeeRateEstimator/MempoolHealth.adoc[`MempoolHealth`] | Health of the recent mined‐block window for fee rate estimation. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:MemPoolFeeRateEstimator/2constructor.adoc[`MemPoolFeeRateEstimator`] [.small]#[constructor]# | Constructs the estimator bound to a mempool and chainstate. | xref:MemPoolFeeRateEstimator/2destructor.adoc[`~MemPoolFeeRateEstimator`] [.small]#[destructor]# | Default destructor. | xref:MemPoolFeeRateEstimator/EstimateFeeRate.adoc[`EstimateFeeRate`] | Estimates the fee rate for inclusion in the next block. | xref:MemPoolFeeRateEstimator/FlushMinedBlockStats.adoc[`FlushMinedBlockStats`] | Persists the tracked mined‐block statistics to disk. | xref:MemPoolFeeRateEstimator/GetMempoolHealth.adoc[`GetMempoolHealth`] | Assesses the health of the recent mined‐block window for fee rate estimation. | xref:MemPoolFeeRateEstimator/GetPrevBlockData.adoc[`GetPrevBlockData`] | Returns the tracked statistics for recently mined blocks. | xref:MemPoolFeeRateEstimator/IsMempoolHealthy.adoc[`IsMempoolHealthy`] | Checks if recent mined blocks indicate a healthy mempool state. | xref:MemPoolFeeRateEstimator/MaximumTarget.adoc[`MaximumTarget`] | Returns the maximum confirmation target supported by this estimator. | xref:MemPoolFeeRateEstimator/MempoolTxsRemovedForBlock.adoc[`MempoolTxsRemovedForBlock`] | Records mempool coverage statistics for a newly connected block. | xref:MemPoolFeeRateEstimator/Read.adoc[`Read`] | Deserialize mined‐block stats without taking ownership of file. | xref:MemPoolFeeRateEstimator/Write.adoc[`Write`] | Serialize mined‐block stats without taking ownership of file. |=== == Static Member Functions [cols="1,4"] |=== | Name| Description | xref:MemPoolFeeRateEstimator/CalculateMaxWeightPercentiles.adoc[`CalculateMaxWeightPercentiles`] | Calculate the 50th and 75th percentile fee rates from block template chunks, sorted in descending mining‐score order. A percentile is left empty when the chunks cannot cover the corresponding fraction of a block. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#