One of the greatest challenges of running a Lightning Network node is liquidity management. For those that are not familiar with this concept, liquidity means having sats available to be pushed to, or pulled from, the other peer in a lightning channel. You need enough sats ready to be pushed in order to complete a payment. This is “liquidity”, and making sure you have enough sats available when needed is the “management” part of it.
A node operator has to maintain his public channels to allow for payment routing to happen constantly. Rebalancing needs to happen as payments are completed and sats are moved. Rebalancing means adjusting the channel balances so that a lightning node has enough satoshis in the right configuration to forward payments. Most lightning node operators use specific services or have to manually monitor their channel balances to keep them liquid.
What if there was a project that could allow a user to put the Lightning node on autopilot?
Enters CLBOSS
CLBOSS is an automated liquidity manager for Core-lightning routing nodes. The program uses a set of heuristics that continuously monitor the node’s channel balances and the state of its peers to adapt to changes in available liquidity as payment are routed through its channels. CLBOSS’s goal is to make it such that running a Lightning Network node is as simple as installing some software, funding a wallet, and provide internet and power to some hardware. That’s it.
CLBOSS is built from many components, called modules. Each module handles a specific responsibility and communicates over a shared event bus. A bus is a a communication channel that allows different parts of a program to exchange information and data. Components publish messages to the bus and subscribe to the messages they need for their internal processing, allowing them to remain loosely coupled while coordinating their behavior.
As of 2025, the project, originally designed by Lightning developer ZmnSCPxj, is being maintained by Ken Sedgwick and a small group of Lightning enthusiasts.
While CLBOSS does not allow for complete automatic management (yet), it can already perform some impressive operations on a CLN node:
It can open channels to other nodes when on-chain fees are low and funds are available. A specific set of modules in CLBOSS can propose a candidate node to open a channel to. CLBOSS then assess the health of the proposed node based on its uptime.
It can buy inbound liquidity through boltz.exchange, swapping off-chain funds with on-chain bitcoins swaps. This feature is triggered when CLBOSS detects that the total amount of inbound liquidity is lower than a desired threshold.
It can rebalance open channels by leveraging circular self-payments, using either just-in-time rebalancing, which rebalances liquidity on-demand right before forwarding, or earnings rebalancing, which proactively looks for rebalancing opportunities based on earnings. This means it’ll initiate a payment to itself along a route, pushing the sats in the nodes inbound and outbound channels into a new configuration.
It can adjust forwarding fees to support channel balance and to be competitive on the market. It monitors both the current fee market and its internal state through a set of heuristics, which will be discussed below.
Let’s take a deeper look at how these fee adjustments get made.
Adjusting Fees
The last point above is, in my personal opinion, the most interesting. CLBOSS performs a series of actions to maintain the fees to an optimal price, based on both market signals and internal states.
Basically, CLBOSS works as an automated market actor, adapting the price of its liquidity to changes in competitors fees, relative size of capacity with respect to its peers, channel balance, and past earnings.
There are four aspects of the pricing algorithm: baseline fees, a size multiplier, a balance multiplier, and something ZmnSCPxj called the “Price Theory” multiplier. Let’s break these down.
Baseline Fees
The baseline fee rates for a channel are decided by looking at channel fees set by all the other channels of your partner. CLBOSS checks all the incoming directions of every channel of the peer and computes the median of their baseline and proportional fee rates weighted by each inspected channel’s size.
Here, CLBOSS is working as an entrepreneur. It checks what the competition is charging for their liquidity and sets a baseline price for its own node. This way it is making sure to enter the market with a price that is deemed attractive by the network, compared to its competitors.
Size Multiplier
There are three multipliers that are then applied to the baseline fees.
The first multiplier is based on the relative size of the node’s total capacity with respect to its peers’. CLBOSS will apply a lower multiplier when the node is smaller compared to its peers, and a higher one if it is bigger.
In particular, CLBOSS discriminates according whether the node is larger or smaller than the median. In the former case, the resulting multiplier will be determined by a logarithmic function, in the latter by a square root function.
The idea is to apply a discount on the fee rate to drive more demand to the node if you’re smaller than your peers. On the other hand, a bigger node could leverage its higher routing capabilities (i.e. being able to route large payments without issues) to earn more from fees, so we charge a bit more, comparatively.
Balance Multiplier
Another multiplier used to modulate the fee rate is based on the balance of the channel.
The balance multiplier allows the fees to swiftly react to changes in the channel liquidity, following a simple supply-demand principle. CLBOSS will apply a premium in case the channel has low balance while applying a discount on the fee rate when the balance is almost full.
CLBOSS is applying the law of diminishing marginal utility. In fact, CLBOSS finds more utility in the last sats left on the channel balance, selling them at a premium, than in the sats belonging to a full channel, which can be discounted to obtain more inbound liquidity.
Price Theory Multiplier
The last pricing strategy used by CLBOSS to determine fees is based on an iterative feedback mechanism which tries to maximize routing profits. The algorithm is based on price theory which presumes that there are no local optima but rather a single global optimum price.
The algorithm works in the following way:
At the first iteration, the
priceis set to0;A small “deck of cards” is initialized with
price - 2,price - 1,price,price + 1, andprice + 2values and shuffled. Shuffling is necessary to prevent locking onto some regular periodic phenomenon on the network:The topmost card is picked and the multiplier is set according to
priceon the card. It will be equal to0.8^ (-price)in case of negative value and1.2^pricein case of positive one. Every forwarding fee earned while the card is active, is recorded;After 2 days, another card is picked and the multiplier is set according to the new
price;When the deck is empty, the card with highest earnings is chosen as the new central
pricepoint, a new deck is created and the algorithm starts over.
CLBOSS is actively doing price discovery. Once the deck is empty we set the new central price point on the level that maximized our earnings, which means on the fee rate at which our node performed better in terms of profits. This means that in the successive iteration, we will explore the space around the new price , trying to converge to the global optimum.
While the effect of this approach tends to be slower with respect to the other strategies, it allows to correct the behavior of the fee rate to maximize for earnings.
Principles of Economics in Action
According to the theory of the Austrian school of economics, prices are nothing more than signals, a mechanism to convey information about what actors are willing to pay for resources or services.
In this context, CLBOSS works as an automated market actor, adapting the price of liquidity (the fee rate) to signal the rest of the network about changes in the market and in its internal state or willingness to exchange liquidity. In the following image is possible to visualize when each of the different adjustments acts to modulate the advertised fee for the node.
CLBOSS does so while minimizing the amount of internal information about the node leaked to the public. In fact, peers will not need to know that the balance of the node dropped, they will just receive the signal given by the change in the fee rate and will react deciding either to find a cheaper path or to accept the higher fee.
Interested in learning more about how open protocols are building free markets? Join us in Vienna, Austria this coming May 27+28 for our first ever bitcoin++ economics edition.








