C-Otto / rebalance-lnd

A script that can be used to balance lightning channels of a lnd node
MIT License
343 stars 82 forks source link

min-local applying to both origin and destination channel balance #244

Open MEdGalo opened 2 years ago

MEdGalo commented 2 years ago

Hi,

I noticed that setting --min-local to a number like 2.000.000, does not only set this limit for the destination balance, but also for the balance where the sats are moved out of.

This give a problem when channels are not approx. equal in size. An extreme example: if I have a channels with Loop (min size 16m sats) and my other channels are 2M sats, then rebalance-lnd basically only lets me rebalance the Loop channel to an amount of <2M sats.

Would is be possible to make split the --min-local option into --min-local-destinination-channel and --min-local-origin-channel? This would make rebalance-lnd a lot more flexible I think. If I'm wrong here and there is a possibility to do that already, I would love to know how to do that.

C-Otto commented 2 years ago

I wrote a lot about this in #170, maybe you're interested in my thoughts. Long story short, I believe it's not necessary to have that many options. Users would be confused (most don't even bother to read the README, anyways), and I don't see the need for more detailled options.

However, you're absolutely right, and I didn't really consider this. The issue you reported makes the -A (--adjust-amount-to-limits) rather useless, I'm afraid. Thanks a lot for reporting this!

As a workaround you can determine the amount yourself, and leave --min-local at the default (or pick any other suitable value). On my node I call rebalance-lnd with -t Y -a X (i.e., for a specific channel, with an amount I computed outside of rebalance-lnd). Maybe that also helps in your case?

mrsieb commented 2 years ago

Well i would be helpful if it could be possible to set --min-local x%

This give a problem when channels are not approx. equal in size. An extreme example: if I have a channels with Loop (min size 16m sats) and my other channels are 2M sats, then rebalance-lnd basically only lets me rebalance the Loop channel to an amount of <2M sats.

I do as work around in this case -e and exclude loop