bitcoind.app
CommandsGuidesContact ↗
Home/Guides/Bitcoin Mempool Monitoring and Analysis
Network

Bitcoin Mempool Monitoring and Analysis

How to monitor and analyze the Bitcoin mempool using RPC commands. Track unconfirmed transactions, estimate congestion, and build real-time fee market dashboards.

In this guide
What is the Mempool?Mempool Overview with getmempoolinfoAnalyzing Individual TransactionsBuilding a Fee DashboardTesting Before Broadcasting

What is the Mempool?

The mempool (memory pool) is where your Bitcoin node holds unconfirmed transactions waiting to be included in a block. Each node maintains its own mempool, so mempool contents vary slightly across the network.

When you broadcast a transaction, it enters your local mempool and propagates to connected peers. Miners build blocks by selecting transactions from their mempool, prioritizing those with higher fee rates. Transactions remain in the mempool until they're confirmed in a block, replaced by a higher-fee version (RBF), or evicted if the mempool grows too large.

Monitoring the mempool gives you real-time insight into network congestion and the fee market.

Mempool Overview with getmempoolinfo

The getmempoolinfo command returns a snapshot of your mempool's current state. Key fields:

size — number of unconfirmed transactions. During quiet periods, this might be a few thousand. During congestion events, it can exceed 100,000.

bytes — total size of all mempool transactions in bytes. When this approaches the maxmempool limit (default 300MB), low-fee transactions start getting evicted.

mempoolminfee — the minimum fee rate a transaction needs to enter the mempool. When the mempool is not full, this equals the minrelaytxfee (default 1 sat/vB). When the mempool fills up, this rises, effectively pricing out low-fee transactions.

This single command gives you a quick read on network congestion.

Analyzing Individual Transactions

Use getmempoolentry with a txid to inspect a specific unconfirmed transaction. This returns the fee, virtual size, time the transaction entered your mempool, and dependency information.

The ancestor and descendant fields are particularly useful. getmempoolancestors shows all unconfirmed parent transactions that must be confirmed first, while getmempooldescendants shows all child transactions that depend on this one.

This dependency data is critical for understanding transaction chains. A transaction with many unconfirmed ancestors might get delayed if any ancestor has a low fee rate, because miners evaluate package fee rates — the effective fee rate of a transaction includes its ancestors.

Building a Fee Dashboard

To build a real-time fee estimation dashboard, combine several RPC calls:

Poll getmempoolinfo every few seconds for high-level congestion metrics. Use getrawmempool with verbose=true to get fee rate distributions — bucket transactions by fee rate to visualize where the market is trading.

Combine this with getblockstats on recent blocks to show what fee rates actually got confirmed. The avgfeerate and minfeerate fields tell you the market-clearing price.

For historical context, track these metrics over time. Fee markets have strong daily and weekly patterns — typically lowest on weekends and highest during US business hours on weekdays.

Testing Before Broadcasting

The testmempoolaccept command lets you verify a transaction would be accepted by the mempool without actually broadcasting it. This is invaluable for applications that construct transactions programmatically.

Pass in your signed transaction hex, and the command tells you whether it would be accepted, the virtual size, and the fee. If it would be rejected, you get the reason — common issues include insufficient fee, missing inputs, or script validation failures.

Always test before broadcasting, especially for high-value transactions or complex scripts.

Related RPC Commands

getmempoolinfoReturns details on the active state of the TX memory pool.getrawmempoolReturns all transaction ids in memory pool.getmempoolentryReturns mempool data for given transaction.getmempoolancestorsIf txid is in the mempool, returns all in-mempool ancestors.getmempooldescendantsIf txid is in the mempool, returns all in-mempool descendants.savemempoolDumps the mempool to disk in the data directory.testmempoolacceptReturns result of mempool acceptance tests for raw transactions without adding to mempool.
← Previous Guide
Bitcoin Core Wallet Management Guide
Next Guide →
Working with Raw Bitcoin Transactions

bitcoind.app — Bitcoin Core RPC Reference

Contact ↗