Estimate the fee rate required for a transaction to be included in the next block.

Synopsis

Declared in <policy/fees/mempool_estimator.h>

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

Name

Description

Percentiles

Block percentile fee rates (in sat/vB).

Enums

Name

Description

MempoolHealth

Health of the recent mined‐block window for fee rate estimation.

Member Functions

Name

Description

MemPoolFeeRateEstimator [constructor]

Constructs the estimator bound to a mempool and chainstate.

~MemPoolFeeRateEstimator [destructor]

Default destructor.

EstimateFeeRate

Estimates the fee rate for inclusion in the next block.

FlushMinedBlockStats

Persists the tracked mined‐block statistics to disk.

GetMempoolHealth

Assesses the health of the recent mined‐block window for fee rate estimation.

GetPrevBlockData

Returns the tracked statistics for recently mined blocks.

IsMempoolHealthy

Checks if recent mined blocks indicate a healthy mempool state.

MaximumTarget

Returns the maximum confirmation target supported by this estimator.

MempoolTxsRemovedForBlock

Records mempool coverage statistics for a newly connected block.

Read

Deserialize mined‐block stats without taking ownership of file.

Write

Serialize mined‐block stats without taking ownership of file.

Static Member Functions

Name

Description

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.

Created with MrDocs