The Mempool and Lightning

Routing nodes are always looking for a bargain and if you know how to read the mempool, you’ll be able to get a little more schwing for your sats.
Keeping your node online is the easiest way to earn income, but sometimes you need a few extra channels to keep your sats flowing if you’re running out of liquidity.

[paywall price=”100″]

Reading the Mempool

Just to keep an eye on the mempool, I really like to use Johoe’s Bitcoin Mempool Statistics (why not tip them a few sats?). Johoe’s has been around for a while, but I really like the colorful display and the really useful tooltip information as you hover the mouse over the dynamic chart.

The really important information for us is the third chart, the mempool size in MB. That chart tells us the MB size of the transactions that are paying a higher fee than us. If we assume that the next block will be full, it should be close to 1MB of transactions (SegWit makes this slightly larger than 1MB, but let’s take the conservative approach here and assume smaller blocks).

Mempool Size Chart with an added arrow examining the fee level for the next block.

If you hover the mouse (or tap at a certain point on mobile), you should see a little donut indicator showing where you’re examining on the graph. I’ve highlighted that region with a purple arrow since the green donut is a little hard to see. A tooltip will also show that at the highlighted point in the mempool, there is 1.039 MB of transactions above the 40 sat/vByte level. That means that there’s about zero chance that we’re going to get our 40 sat/vByte transaction in the next block.

On the other hand, look at how many times that the mempool has completely cleared out in the past few hours. I will enjoy these times while they last. I don’t need to open my channel in the next block, so I’m comfortable choosing a lower fee to get my transaction confirmed.

I went with a 2 sat/byte transaction to deposit to my lightning node since I have a wallet that supports Replace-By-Fee (RBF). RBF allows me to “bump” the fee with a subsequent transaction that increases the reward for miners to include my transaction in a block.

Forecasting the Mempool

Watching the mempool is great if you like to see how the mempool has performed in the past and if there are any recurring patterns. One pattern that I’ve noticed is that the mempool typically is a lot lighter on the weekends, meaning we can do our channel opens then and save a bit on chain fees. There are often greater forces at play in Bitcoin, specifically energy costs, miners, bitcoin price, and the block difficulty which gives us a way to predict how the mempool might look in the near future (2-3 week outlook).

If we’re looking at a bunch of different metrics for bitcoin at once, look no further than Clark Moody’s Dashboard.

I’m going to assume that you’re already familiar with what bitcoin mining is generally, but the part we’re interested in is the Difficulty Adjustment. It’s maybe the most beautiful part of the Bitcoin protocol and it has the biggest effect on the mempool in the short term.

Bitcoin miners are always trying to solve a similar math problem to get the block reward. They have to solve the math problems by brute force, which means that the time it takes to solve a problem (to mine a block) is a random variable. The difficulty of the math problem is determined by the last 2016 blocks and how long it took to mine those blocks, on average. If the blocks were solved faster than 10 minutes, the difficulty increases. If the blocks came in slower than every 10 minutes, the difficulty decreases. In general, the difficulty “retargets” every 2016 blocks.

Clark Moody’s dashboard on mining and difficulty.

From the snippet above, we can see that we’re 1,049 blocks away from the upcoming difficulty retarget. The estimated difficulty change is estimated to increase by 8.6%. That’s a huge change! That means that blocks will get solved slower and unconfirmed transactions are going to start piling up, which means higher transaction fees in the future.

(As a quick aside, this is when I bump up the fee on the still unconfirmed 2 sat/vbyte transaction I tried to send earlier. I set it to 5 sats/vbyte. Fingers crossed.)

The thing to know about the mining industry is that it takes a lot more effort to build and deploy a new miner than it does to shut a miner off. For us, that means that if there’s a downward difficulty adjustment coming up, we could see some less efficient miners quickly come back online, making blocks come in faster. And if there’s an upward difficulty adjustment coming up, some less efficient miners might get turned off, which means that blocks will come in even slower than every 10 minutes. So, I’m going to be a lot more eager than I otherwise would be to get this transaction confirmed. The next few weeks might be a very difficult time to get a low fee transaction confirmed.

With all that information, best of luck out there and may the sats be with you!

[/paywall]


Did you like what you read? If so, send a tip to support more educational lightning content and share this post with your friends.

bc1q9pggrfyssulf0cqlc8wqnp2y8h5ceka99akrn7

One thought on “The Mempool and Lightning

Comments are closed.