Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/trezorhannes/bash-rebalancer
Rebalancing Channels on Lightning can be intimidating, or laboursome, or both. This light bash-script should allow some guidance with a menu, and allows up to 7 channels per run to be handed over to the rebalance-lnd script
https://github.com/trezorhannes/bash-rebalancer
bitcoin lightning lnd rebalancing
Last synced: 17 days ago
JSON representation
Rebalancing Channels on Lightning can be intimidating, or laboursome, or both. This light bash-script should allow some guidance with a menu, and allows up to 7 channels per run to be handed over to the rebalance-lnd script
- Host: GitHub
- URL: https://github.com/trezorhannes/bash-rebalancer
- Owner: TrezorHannes
- License: mit
- Created: 2021-10-25T15:33:47.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2024-03-09T20:30:22.000Z (8 months ago)
- Last Synced: 2024-04-21T00:57:06.201Z (7 months ago)
- Topics: bitcoin, lightning, lnd, rebalancing
- Language: Shell
- Homepage:
- Size: 63.5 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# bash-rebalancer
With bash-rebalancer as a wrapper, you can use Carsten Otto's rebalance-lnd with > more than one channel in a batch system.
It'll allow to add a bunch of channels when calling the script, and then a menu will guide you through the next steps.The prerequisits are
- Installed Python Environment
- Rebalance-lnd https://github.com/C-Otto/rebalance-lnd
Optional but helpful to retrieve the right channels to rebalance
- LNDManage https://github.com/bitromortac/lndmanage
`lndmanage listchannels rebalance`### Key Feature Set
- Add **more than one channel** to rebalance
- Incrementally start the ratio to rebalance with **10%, 30%, 50%, 70%** and remainder ratio to rebalance
- For < 2M sats channels, the script will strive to achieve a 50:50 ratio. For > 2M Channel size, it'll aim to get 1M at either side
- Alternatively, it allows to set a fixed amount of satoshis, and tries that _amount_ divided into a set amount of attempts for every selected channel
- Allows a PPM-limit ceiling for Fee-Factor, to avoid rebalancing high PPM sets by charge-lnd
- Offers 'Reckless'-Mode, ignoring profitability settings### Installation
```
$ git clone https://github.com/TrezorHannes/bash-rebalancer
$ nano bash-rebalancer/my_rebalancer.sh
```
1) In case not successfully identifying your LND directory, add a direct link in the header
2) If your rebalance-lnd directory isn't stored in $HOME (~/rebalance-lnd/), add a direct link in the header, too#### Syntax for one channel
`$ ./bash-rebalancer/my_rebalancer.sh -j cidxxxxxxxxxxxxxxx`#### Syntax for one channel, excluding another
`$ ./bash-rebalancer/my_rebalancer.sh -j cidxxxxxxxxxxxxxxx -e cidxxxxxxxxxxxxxxx`
This command will try one _specific channel_ (j).#### Syntax for more than one channel
`$ ./bash-rebalancer/my_rebalancer.sh -j cidxxxxxxxxxxxxxxx -k cidxxxxxxxxxxxxxxx -l cidxxxxxxxxxxxxxxx -m cidxxxxxxxxxxxxxxx -n cidxxxxxxxxxxxxxxx -o cidxxxxxxxxxxxxxxx`
This command will try to rebalance _for 6 different channels_ (j-o).#### Syntax for one channel, excluding another, dividing your fixed amount of rebalances into 15 chunks
`$ ./bash-rebalancer/my_rebalancer.sh -j cidxxxxxxxxxxxxxxx -e cidxxxxxxxxxxxxxxx -c 15`
smaller chunks = higher probability of success### Attributes
```
- Fee-Setting
- Direction push (👉) outbound or pull (👈) inbound liquidity
- -j Single channel ID of first and required channel
- -k to -p arguments allow for passing additional optional channels to rebalance
- -e exclude a specific channel ID. Only one ID is allowed at this point
- -c allows for specifying how many chunks your total amount of satoshis are divided into
- Specify Automated or Defined Amount to be rebalanced
```### Hints
1. Since the process is going to take a long time, pending the number of channels you like to rebalance, it's generally advised to **run the bash script via TMUX**.
2. Get a list of target rebalancing channels with `$ lndmanage listchannels rebalance` before-hand, and identify the top 1-7 with too much outbound or too much inbound by hand
3. Focus on the **channels with reasonable fee-settings**. When you use charge-lnd, you may have channels with extra-ordinary high or low pricing to dis- or encourage balancing. Fee-Factor for those channels can have undersirable side-effects (too high or too low ppm).### Contribution
Please feel free to help this getting better, issues and pull requests @ https://github.com/TrezorHannes/bash-rebalancer
I'm always grateful for inbound, feel free to connect or message me for a joined channel opening:#### HODLmeTight:
- 037f66e84e38fc2787d578599dfe1fcb7b71f9de4fb1e453c5ab85c05f5ce8c2e3@z5keqdwlv7mr5bjudwczzfok775d4xfxlxh3bbp7ug5nyjrjkxup3cyd.onion:9735
- https://amboss.space/node/037f66e84e38fc2787d578599dfe1fcb7b71f9de4fb1e453c5ab85c05f5ce8c2e3