This is a transcript of a great thread on Twitter (see at the end the credits).
When it comes to lightning node maintenance one common practice is channel rebalancing. The idea is to keep half of the liquidity on each side. This state allows your node send & receive at the same time over that channel.
Do all lightning channels need to be balanced?
I don’t think that every channel needs to be balanced. Some cases justify one sided liquidity. This is especially important for merchants and on the other side of the spectrum those who need to be able to pay rather than receive.
So if one finds themself in the middle of the spectrum, how to keep lightning channels balanced?
There are a few ways to balance your channels but which one to use depends on the situation.
Balancing can either come at a cost or can earn you more sats by doing so. Some methods are effective immediately, others take a while or may only happen by chance.
- Circular Rebalancing
It is the act of paying yourself by choosing an outgoing and incoming channel. This is the quickest way but can come at a cost. You most often have to pay at least one routing node to route your payment.
Remember, what is rebalancing for you might unbalance another channel of theirs.
Choose this method if you value a quick solution and can afford the price.
- Just spend or receive sats
Do you have a lot of liquidity on your side? Just spend your sats through the channel you have the most sats to be spent. UIs like RTL allow you to chose the outgoing channel
To bring liquidity to u side, u can just buy sats (1788 sats/$ !!), offer a service or work a job that pays out in sats over lightning. You can also find micro tasks on http://microlancer.io, play
@thndrgames to win, crowdfund art on http://sparkshot.io, the list goes on…
- Adjust your fees to encourage routing in specific directions (this is the topic I want to dig deeper into.)
You can set the routing fee policy for each channel. You can set a base fee that always applies no matter how big the payment (default 1 sat on LND) and a fee rate which is applied as satoshi per million (1 satoshi for 1 million routed).
There are many combinations of these two values and depending how you set them, you encourage some kind of payments and discourage another kind.
Who do you charge those fees? You charge them to the node that asks you to forward a payment.
Say you have Node A and I have node B, we both have a channel. There’s also your friend’s node C, who also has a channel with me but not with you.
One day you want to send your friend 1000 sats. Your node asks my node to forward the payment. My node’s charges you a 1 sats fixed rate + 0.1% fee rate, in total 2 sats.
Base fee, the fee that always applies per payment. It is expressed as a thousands of a thousands of a satoshi (mili msats) or as fee per million.
If you set it low, micropayments become economical, if you set them high, micropayments are probably a bad idea (imagine paying 10 sats fees for a 10 sats payment). Bigger payments will be less affected by a relatively small base fee (10 sats for 1 million sats routed is cheap).
Fee rate relative to the payment size. Less noticable for small payments but very important for big payments. A 0.1% fee for a million sats is 1000 sats while for 10 sats a mere 0,01 sats (or 10msats).
I think the fee rate is very important for smaller channels ( < 1M sats) because if you have it too low, a 300-700k payment (not too uncommon) can smash your channel right out of balance.
So what should these two values be? That depends entirely on your intentions and situation. If you have a smaller channel or want to facilitate micropayments or help streaming sats or both, then set your base fee low (near 0 msats) and your flexible fees higher (>100 mili msats)
If you want to help big payments, set your fee rate low, base fee doesn’t effect big payments as much unless you set it really high that it starts to matter.
Fees can also be changing according to liquidity on your side of the channel. If you have a good feel it you can encourage natural rebalancing, i. e. you happen to route a payment that balances your channel at the same time.
The more sats are on u side, the less inbound liquidity you have. On the routing market, inbound liq. is what u sell for a fee. Nodes that look for routes consider all the fees & choose in most cases the cheapest route they know (but they also do consider other metrics)
So if you want to get rid of inbound liquidity, you can lower your prices. The opposite is the case if you have little inbound liquidity but need it you might only part with it for a higher price.
This can be even automated. One tool I know of is Balance of Satoshis by @alexbosworth
One challenge in this approach is that it matters what the other nodes charge you.
For the greatest natural balancing effect both nodes should dance the same dance.