[#MemPoolFeeRateEstimator]
= MemPoolFeeRateEstimator
:mrdocs:

Estimate the fee rate required for a transaction to be included in the next block&period;

== Synopsis

Declared in `&lt;policy&sol;fees&sol;mempool&lowbar;estimator&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class MemPoolFeeRateEstimator;
----

== Description

Uses Bitcoin Core&apos;s block&hyphen;building algorithm to generate a block template from the mempool, then calculates percentile fee rates from the selected chunks&colon; the 75th percentile is returned as the economical estimate and the 50th percentile as the conservative estimate&period;

== Types

[cols="1,4"]
|===
| Name| Description
| xref:MemPoolFeeRateEstimator/Percentiles.adoc[`Percentiles`] 
| Block percentile fee rates (in sat&sol;vB)&period;
|===


== Enums

[cols="1,4"]
|===
| Name| Description
| xref:MemPoolFeeRateEstimator/MempoolHealth.adoc[`MempoolHealth`] 
| Health of the recent mined&hyphen;block window for fee rate estimation&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:MemPoolFeeRateEstimator/2constructor.adoc[`MemPoolFeeRateEstimator`]         [.small]#[constructor]#
| Constructs the estimator bound to a mempool and chainstate&period;
| xref:MemPoolFeeRateEstimator/2destructor.adoc[`&#126;MemPoolFeeRateEstimator`] [.small]#[destructor]#
| Default destructor&period;
| xref:MemPoolFeeRateEstimator/EstimateFeeRate.adoc[`EstimateFeeRate`] 
| Estimates the fee rate for inclusion in the next block&period;
| xref:MemPoolFeeRateEstimator/FlushMinedBlockStats.adoc[`FlushMinedBlockStats`] 
| Persists the tracked mined&hyphen;block statistics to disk&period;
| xref:MemPoolFeeRateEstimator/GetMempoolHealth.adoc[`GetMempoolHealth`] 
| Assesses the health of the recent mined&hyphen;block window for fee rate estimation&period;
| xref:MemPoolFeeRateEstimator/GetPrevBlockData.adoc[`GetPrevBlockData`] 
| Returns the tracked statistics for recently mined blocks&period;
| xref:MemPoolFeeRateEstimator/IsMempoolHealthy.adoc[`IsMempoolHealthy`] 
| Checks if recent mined blocks indicate a healthy mempool state&period;
| xref:MemPoolFeeRateEstimator/MaximumTarget.adoc[`MaximumTarget`] 
| Returns the maximum confirmation target supported by this estimator&period;
| xref:MemPoolFeeRateEstimator/MempoolTxsRemovedForBlock.adoc[`MempoolTxsRemovedForBlock`] 
| Records mempool coverage statistics for a newly connected block&period;
| xref:MemPoolFeeRateEstimator/Read.adoc[`Read`] 
| Deserialize mined&hyphen;block stats without taking ownership of file&period;
| xref:MemPoolFeeRateEstimator/Write.adoc[`Write`] 
| Serialize mined&hyphen;block stats without taking ownership of file&period;
|===


== 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&hyphen;score order&period; A percentile is left empty when the chunks cannot cover the corresponding fraction of a block&period;
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
