Intermediate Channel Management
In the previous guide we talked about opening a channel and basic management of the channel. Now you can make payments for services and other things. But what if you want to receive payments? That is what inbound liquidity is for. Let's go back to the previous channel and have a look at it again.
With this channel, you can receive up to 1,400,000 sats from other Lightning users. You don't want your payments to fail but you also don't want payments for you to fail as well. This management is called balancing. So, if your channel balance is 100% on your local side when you open a channel, how do you get inbound? There are a few ways but here are the most common:
- Spend your sats. Once you spend sats out of a channel, the balance transitions to the other side, which now allows you to receive up to that much. Actions such as buying giftcards at bitrefill.com or buying a ticket to a conference will increase your inbound liquidity.
- There are paid services that open channels with your node to give you inbound liquidity. LNBIG, for example is one of these services.
- Loop out, powered by lightning labs. A Loop out will allow you to transition liquidity in your channel from local to remote and receive the funds back on chain for a fee. You can do this in Lightning Terminal or command line.
- You can ask the community for inbound liquidity. Telegram groups and twitter are great places to ask for liquidity.
So how much inbound liquidity should you have? That is different for everyone. But a good rule of thumb is to have 1 sat of remote liquidity for every 2 sats of local at a minimum. You can see this ratio on your Thunderhub dashboard:
With inbound liquidity across fairly balanced channels, you will be more likely to route payments for other people and be paid a fee for the service! Here is how this works:
In the above example, Alice wants to pay Dan. Alice and Dan do not have a channel with each other. However, Alice does have a channel with Bob. Unfortunately, Bob does not have a channel with Dan, either. Bob has a channel with Carol. And Carol has a channel with Dan. The network just found a way to route a payment from Alice to Dan! Here are the steps of this process:
- 1.For Alice, the local balance of her channel with Bob gets reduced by 10,002 sats.
- 2.Bob's local balance of his channel with Carol get's reduced by 10,001 sats. Bob keeps 1 sat for the service of forwarding the payment for Alice as a fee.
- 3.Carol's local balance with Dan get's reduced by 10,001 sats. Carol keeps 1 sat for the service of forwarding the payment for Bob as a fee.
- 4.Dan's channel with Carol increases by 10,000 sats.
Next we will talk about Rebalancing:
Rebalancing is a self payment. You pay yourself out of one channel and into another one of your channels. This can be a way of balancing that maximizes the probability of receiving payments.
Example: If you have a channel with 5,000,000 sats on the local side, and a separate channel with a different peer with 5,000,000 on the remote side, you can "pay yourself" 2,500,000 sats, from the first channel to the second channel and will now have two channels both evenly balanced. Sometimes these channel balancing transactions fail because they payments have to go out into the network and sometimes there is not a path. Trial and error is required when rebalancing. To do this in Thunderhub, click the rebalance button in the primary menu on the left side:
This will bring up the following screen:
Simply choose your outgoing and incoming channels from the drop down options. The outgoing channel is the one you want to REDUCE the local liquidity of. The incoming channel is the channel you want to INCREASE the local liquidity of. The max fee and fee rate is what you are choosing to pay to the wider lightning network to route your payment out and then back into your channel.
Fixed means that the rebalance MUST do the defined amount or it will fail. Target means it will do the most it can up to the amount specified. For example, if running target and you input 5,000,000 sats, and the network can only do 4,800,000 sats, it will go ahead and do 4,800.000.
You can also avoid nodes. This is used when you want to possibly avoid nodes that charge very high forwarding fees, for example. This information can be found on amboss.space or 1ml.com.
Go ahead and click rebalance. There may be a wait up to a few minutes. Please be patient and let it run. You will either get a success or fail message.