<p>Lnd itself does as far as I remember not provide an api for rebalancing channels.</p>

<p>However there is the lndmanage repository that uses the lnd api to provide a pretty strong rebalancing tool</p>

<p><a href="https://github.com/bitromortac/lndmanage" rel="nofollow noreferrer">https://github.com/bitromortac/lndmanage</a></p>

<p>Such rebalancing will cost you routing fees as they are regular (circular) payments. </p>

<p>That being said it is not clear why you would want to rebalance your channels before an onion on them actually fails. There is currently the <a href="https://lists.linuxfoundation.org/pipermail/lightning-dev/2019-March/001891.html" rel="nofollow noreferrer">discussion about JIT routing</a> (which rebalance just in time if a channel such should be used can't be used) and <a href="https://lists.linuxfoundation.org/pipermail/lightning-dev/2019-July/002055.html" rel="nofollow noreferrer">fee free rebalancing</a> taking place on the lightning-dev Mailinglist.</p>

CC BY-SA 4.0
2019-08-08T03:44:20.027Z
Thanks for your response Rene. It doesn't appear I'm sophisticated enough to run this tool in the short run or really make real use out of the theoretical things you're talking on the Lightning-dev mailinglist. I'm just curious if there was anything that I could do as a relative newbie to be able to continue to make fees from these specific channels.
Chaz
CC BY-SA 4.0
2020-10-02T00:29:24.023Z
Hey Rene, I was wondering if this answer is still up-to-date?
Murch
CC BY-SA 4.0
2019-07-03T07:15:37.347Z
2019-07-03T07:15:37.347Z
Rene Pickhardt
<p>In addition to <code>lndmanage</code> you can also use this script (I'm the author):</p>
<p><a href="https://github.com/C-Otto/rebalance-lnd" rel="nofollow noreferrer">https://github.com/C-Otto/rebalance-lnd</a></p>
<p>Using the <code>-f</code> parameter you can select a channel with more than 50% of the funds on the remote side. The script then sends funds to one of your channels (with at most 50% of the funds on the local side, after receiving the transaction), resulting in a 50-50 balance on the channel you specified.</p>
<p>There are some tweaks (channel selection, amount absolute/percentage, ...) that you may want to look into.</p>

CC BY-SA 4.0
2020-11-21T14:25:08.517Z
2020-11-21T14:25:08.517Z
C-Otto
<ol>
<li>Create an invoice for yourself: <code>lncli addinvoice &lt;amt&gt;</code></li>
<li>Pay the invoice specifying the outgoing channel and the last hop to take before paying you: <code>lncli payinvoice --allow_self_payment --outgoing_chan_id &lt;outgoing_chan&gt; --last_hop &lt;last_hop&gt; &lt;payreq_from_1&gt;</code></li>
</ol>
<p>To get the outgoing channel id use <code>lncli listchannels --active_only</code>. I usually have to grep for the <code>remote_pubkey</code> that I get from Zeus interface and then look for the <code>chan_id</code> string.</p>
<p>The last hop is the <code>remote_pubkey</code> of the node associated with the channel you want to increase the local balance on.</p>
<p>I learned this from this pull request documentation: <a href="https://github.com/lightningnetwork/lnd/pull/3736" rel="nofollow noreferrer">https://github.com/lightningnetwork/lnd/pull/3736</a></p>
<p>Good luck rebalancing!</p>

CC BY-SA 4.0
2021-01-29T22:07:40.330Z
2021-01-29T22:07:40.330Z
Dave
<p>I'm running an LND node that has a few dozen channels open to various relevant vendors/routing nodes. There are a couple specific channels that are open with stores that are getting used with most of the balance being on the remote side. I'm unsure how to manually rebalance these specific channels without closing them.</p>

<p>Is it possible to manually rebalance the channels from within my own LND node using the command line or some other way?</p>

CC BY-SA 4.0
2019-07-03T05:22:33.700Z
related: https://bitcoin.stackexchange.com/q/87297/5406
Murch
CC BY-SA 4.0
2019-07-03T05:44:27.383Z
@murch I tried my best to find a related question but I failed. Thanks!

It's a bit disappointing that there's not a lot of responses.
Chaz
<lightning-network><channels>
How to manually rebalance Lightning Network channels?
Chaz
# How to manually rebalance Lightning Network channels?

(Asked by: username_0 on 2019-07-03)

I'm running an LND node that has a few dozen channels open to various relevant vendors/routing nodes. There are a couple specific channels that are open with stores that are getting used with most of the balance being on the remote side. I'm unsure how to manually rebalance these specific channels without closing them.

Is it possible to manually rebalance the channels from within my own LND node using the command line or some other way?

**Tags:** lightning-network, channels

> **Comments:**
> **username_1**: related: https://bitcoin.stackexchange.com/q/87297/5406  
> **username_0**: @murch I tried my best to find a related question but I failed. Thanks!  It's a bit disappointing that there's not a lot of responses.  

---

## 3 answers

### Answer by username_2 on 2019-07-03. Score: 3 | Accepted answer

Lnd itself does as far as I remember not provide an api for rebalancing channels.

However there is the lndmanage repository that uses the lnd api to provide a pretty strong rebalancing tool

<https://github.com/bitromortac/lndmanage>

Such rebalancing will cost you routing fees as they are regular (circular) payments.

That being said it is not clear why you would want to rebalance your channels before an onion on them actually fails. There is currently the [discussion about JIT routing](https://lists.linuxfoundation.org/pipermail/lightning-dev/2019-March/001891.html) (which rebalance just in time if a channel such should be used can't be used) and [fee free rebalancing](https://lists.linuxfoundation.org/pipermail/lightning-dev/2019-July/002055.html) taking place on the lightning-dev Mailinglist.

> **Comments:**
> **username_0**: Thanks for your response Rene. It doesn't appear I'm sophisticated enough to run this tool in the short run or really make real use out of the theoretical things you're talking on the Lightning-dev mailinglist. I'm just curious if there was anything that I could do as a relative newbie to be able to continue to make fees from these specific channels.  
> **username_1**: Hey Rene, I was wondering if this answer is still up-to-date?  

---

### Answer by username_3 on 2020-11-21. Score: 1

In addition to `lndmanage` you can also use this script (I'm the author):

<https://github.com/username_3/rebalance-lnd>

Using the `-f` parameter you can select a channel with more than 50% of the funds on the remote side. The script then sends funds to one of your channels (with at most 50% of the funds on the local side, after receiving the transaction), resulting in a 50-50 balance on the channel you specified.

There are some tweaks (channel selection, amount absolute/percentage, ...) that you may want to look into.


---

### Answer by username_4 on 2021-01-29. Score: 0

1. Create an invoice for yourself: `lncli addinvoice`
2. Pay the invoice specifying the outgoing channel and the last hop to take before paying you: `lncli payinvoice --allow_self_payment --outgoing_chan_id  --last_hop`

To get the outgoing channel id use `lncli listchannels --active_only`. I usually have to grep for the `remote_pubkey` that I get from Zeus interface and then look for the `chan_id` string.

The last hop is the `remote_pubkey` of the node associated with the channel you want to increase the local balance on.

I learned this from this pull request documentation: <https://github.com/lightningnetwork/lnd/pull/3736>

Good luck rebalancing!


---

