<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:26:05.020Z
2021-01-29T22:26:05.020Z
Dave
<p>I have at least two open channels, one of which has inbound capacity and the other has outbound capacity. How can I find a route and construct a payment to rebalance my channels against each other just using the LND commandline?</p>

<p>As in, what steps are necessary to stitch two routes together to form a cycle?</p>

CC BY-SA 4.0
2019-04-26T04:56:18.543Z
Just to make sure: the lnd commandline means any commandline using a chain of lnd commands? Because if it was just about command line you could use lndmanage ( https://github.com/bitromortac/lndmanage ) I would post this as an answer if you are happy with this.
Rene Pickhardt
CC BY-SA 4.0
2019-04-26T20:13:23.187Z
I've seen multiple third-party tools that would construct these transactions automatically for me, but I don't want to introduce more review/trust. We've succeeded at sending a two-hop by manually editing route information, and I was hoping that there would be a better way to do it without quite as much manual intervention but without third party tools.
Murch
<lightning-network-daemon><ln-channel-balance-management>
How can you construct a cycle with LND to rebalance one of your channels with another?
Murch
# How can you construct a cycle with LND to rebalance one of your channels with another?

(Asked by: username_0 on 2019-04-25)

I have at least two open channels, one of which has inbound capacity and the other has outbound capacity. How can I find a route and construct a payment to rebalance my channels against each other just using the LND commandline?

As in, what steps are necessary to stitch two routes together to form a cycle?

**Tags:** lightning-network-daemon, ln-channel-balance-management

> **Comments:**
> **username_1**: Just to make sure: the lnd commandline means any commandline using a chain of lnd commands? Because if it was just about command line you could use lndmanage ( https://github.com/bitromortac/lndmanage ) I would post this as an answer if you are happy with this.  
> **username_0**: I've seen multiple third-party tools that would construct these transactions automatically for me, but I don't want to introduce more review/trust. We've succeeded at sending a two-hop by manually editing route information, and I was hoping that there would be a better way to do it without quite as much manual intervention but without third party tools.  

---

## 1 answers

### Answer by username_2 on 2021-01-29. Score: 3 | Accepted answer

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!


---

