If you ever ran a routing lightning node, you have probably experienced how hard and time consuming it is to do it right.
From selecting good peers that would bring activity to your node, to crafting batch transactions to save on fees, or monitoring the channels' performance to close underperforming ones.
Many runners have scripts that gather routing statistics, monitor peer connections and even probe thousands of routes to see which ones run low on liquidity. These tasks are not trivial and require someone to be on top of them regularly. Furthermore, certainly not every node runner is able or capable of doing that.
Well, Hydrus is my attempt at automating all those operations into a single agent that handles channels opening, closing and splicing (once available in LND) by itself.
I believe it could save a lot of time and energy from bitcoiners, so they can dedicate them to funnier and more interesting tasks.
How does it work?
When opening channels, Hydrus ranks all nodes in the network graph to determine which ones are the best candidates to connect to and opens a channel to them in a single on-chain transaction. Hydrus will always respect the minimum and maximum channel size and number of channels configured.
When closing channels, Hydrus will evaluate the performance of all local channels and peers, and will close only those that fail to reach the minimum requirements. Closing a channel should be the last option, so it has to do really bad compared to the others to be closed.
Both algorithms can be tweaked by changing the heuristic weights in the configuration. For example, if you value a node's centrality more than its fees, you could set all centrality heuristics to 1 and fees to 0.5 or 0 (disabled).
The user may provide a list of nodes not to open channels with or a list of channels to keep no matter how they perform.
Dry run
If you just want see what Hydrus would have done in a real scenario, enable the
dry_run
option in the configuration. No channels will be opened, closed or re-sized.Getting nodes and channels ranking
Similarly, you could execute the binary with the
--nodes_scores
CLI flag to get a full list of the candidates ranked by their score, or with --channels_score
to get an overview of the node's active channels performance.Wrap up
Hydrus is free open-source software, its source code is at https://github.com/aftermath2/hydrus.
This project is still in beta phase and there is definitely a lot of room for improvement, I would really appreciate any feedback or suggestions. Please feel free to open an issue or submit a pull request at the repository.
If you want to support my work, you can follow me on nostr at npub1vg7rf9g8xmmyyxq3g75meltprz2ur6kkuudtjdf4j49d356evuyspt380h.
lncli describegraph
command, it will display all edges and two fieldsnode1_policy
andnode2_policy
indicating how much fees they charge, HTLC ranges, etc.agent.channel_manager.max_sat_vb
which is the maximum number of satoshis per virtual byte that you are willing to spend. If transaction fee is estimated to be higher than that value, no changes will be made.