Circular Rebalance
Lightning Network

Circular Rebalance

Key Takeaways

  • Circular rebalancing moves liquidity without external transactions. By sending a payment from your node back to yourself through other nodes, you shift sats between your channels without opening new channels or using on-chain transactions.
  • It costs routing fees but keeps channels balanced. You pay fees to the intermediate nodes that route your self-payment. The trade-off is maintaining usable channel capacity versus the cumulative cost of frequent rebalancing.
  • Automated tools make rebalancing practical at scale. Manual rebalancing is tedious for active routing nodes. Tools like rebalance-lnd, Balance of Satoshis, and charge-lnd automate the process based on configurable thresholds and fee budgets.

What Is Circular Rebalancing?

Circular rebalancing is a liquidity management technique used by Lightning Network node operators to redistribute funds between their payment channels. The process involves sending a payment from your node, through the network, and back to your own node via a different channel. The payment travels in a circle, hence the name.

When you open a Lightning channel, all the funds start on your side (local balance). As you send payments, your local balance decreases and the remote balance increases. Over time, channels become imbalanced: some channels have mostly local balance (good for sending), while others have mostly remote balance (good for receiving). Circular rebalancing lets you shift liquidity from channels with excess local balance to channels that need it.

Unlike opening new channels or using submarine swaps, circular rebalancing operates entirely within the Lightning Network. No on-chain transactions are required. You are simply moving existing sats from one of your channels to another by routing through intermediate nodes who charge fees for forwarding the payment.

Why Rebalance Channels?

Channel balance directly affects routing capability. A completely one-sided channel can only route payments in one direction. For routing nodes earning fees, balanced channels mean more routing opportunities.

Routing Node Economics

Routing nodes earn fees by forwarding payments between other nodes. To forward a payment, the node needs sufficient local balance in the outgoing channel. If a popular route drains all local balance from a channel, that channel becomes useless for further routing in that direction until payments flow back.

Consider a node connected to a major exchange and a popular wallet provider. Payments frequently flow from the wallet toward the exchange (users depositing). This drains local balance on the exchange channel. Without rebalancing, the node eventually cannot route any more deposits, losing fee revenue.

End User Experience

Even non-routing nodes benefit from balanced channels. If you want to receive payments, you need inbound capacity (remote balance). If your channels are all local balance, you cannot receive until you spend or rebalance. Circular rebalancing converts outbound capacity to inbound capacity without on-chain operations.

Capital Efficiency

Opening new channels requires on-chain fees and locks capital for the channel duration. Rebalancing makes existing capital work harder. Rather than opening a new channel to gain inbound capacity somewhere, you can rebalance existing channels to achieve the same result with lower on-chain costs.

How Circular Rebalancing Works

A circular rebalance is mechanically identical to any Lightning payment, except the sender and receiver are the same node. The process uses HTLCs just like regular payments.

Step-by-Step Process

  1. Identify imbalanced channels. Find a channel with excess local balance (source) and a channel that needs local balance (destination).
  2. Find a route. Discover a path from your node, out through the source channel, through other nodes, and back into your node via the destination channel.
  3. Send the payment. Create an HTLC with yourself as both sender and receiver. Since you control both ends, you can use keysend or generate an invoice to yourself.
  4. Payment settles. The HTLC propagates through the route. Intermediate nodes forward it, deducting their fees. When it reaches your node via the destination channel, you claim the payment.
  5. Balance shifted. Your source channel now has less local balance (you sent funds out). Your destination channel has more local balance (you received funds in). The total balance across all channels remains the same minus routing fees.

Example

Your node has two channels: Channel A with 900,000 sats local / 100,000 remote, and Channel B with 100,000 sats local / 900,000 remote. You want to send 400,000 sats from A to B.

You find a route: Your Node → Channel A → Node X → Node Y → Channel B → Your Node. You send 400,000 sats through this route, paying perhaps 100-400 sats in routing fees depending on the intermediate nodes' fee policies.

After the rebalance: Channel A has 500,000 local / 500,000 remote. Channel B has 500,000 local / 500,000 remote (minus the small fee leakage). Both channels are now well-balanced for bidirectional routing.

Cost Analysis and Trade-offs

Circular rebalancing is not free. Understanding the economics helps determine when rebalancing makes sense.

Direct Costs

Every rebalance pays routing fees to intermediate nodes. These fees vary based on route length, intermediate node fee policies, and payment amount. A rebalance might cost anywhere from 10 sats for a short, low-fee path to thousands of sats for larger amounts through expensive routes.

The base fee plus proportional fee structure means larger rebalances cost proportionally more. Rebalancing 1 million sats might cost 500 sats (0.05%), while a 100,000 sat rebalance might cost 100 sats (0.1%) due to base fees being a larger percentage.

Opportunity Cost

Time spent on rebalancing (manual or computational for automation) has opportunity cost. Rebalancing also temporarily locks HTLCs in channels, reducing available capacity during the operation.

When Rebalancing Pays Off

Rebalancing makes economic sense when the expected routing fee revenue from a balanced channel exceeds the rebalancing cost. If balancing a channel enables 10,000 sats in routing fees before it needs rebalancing again, paying 200 sats to rebalance is profitable.

For non-routing nodes, the calculation is different. The value is receiving payments or maintaining payment flexibility, which may not have a direct sat-denominated value.

When to Avoid Rebalancing

Avoid rebalancing channels that consistently flow in one direction. If a channel always drains toward a specific peer, rebalancing is fighting the natural flow. Better solutions include adjusting fees to slow the drain or accepting the flow pattern.

Rebalancing Strategies

Threshold-Based Rebalancing

Set minimum and maximum balance thresholds. When a channel exceeds the threshold (too depleted or too full), trigger a rebalance to bring it within range. Common thresholds are 20-80%: rebalance when local balance falls below 20% or exceeds 80%.

Fee-Budget Rebalancing

Set a maximum fee rate you are willing to pay for rebalancing. Only execute rebalances when a route is found within your fee budget. This prevents overpaying during periods of network congestion or when cheap routes are unavailable.

Proactive vs Reactive

Proactive rebalancing maintains balances before they become problematic. Reactive rebalancing waits until a channel is actually depleted. Proactive approaches have smoother operations but higher cumulative fees. Reactive approaches minimize fees but may miss routing opportunities.

Time-Based Scheduling

Routing fees vary throughout the day and week. Some operators schedule rebalancing during off-peak periods when fees are typically lower and routes are less congested.

Tools and Automation

rebalance-lnd

A popular Python script for LND nodes that finds circular routes and executes rebalances. It supports fee limits, amount targets, and can exclude specific nodes from routes.

# Basic rebalance from channel A to channel B
rebalance-lnd --from CHANNEL_A_ID --to CHANNEL_B_ID --amount 100000

# With fee limit (max 0.1% = 1000 ppm)
rebalance-lnd --from CHANNEL_A_ID --to CHANNEL_B_ID --fee-limit 1000

Balance of Satoshis (bos)

A comprehensive LND management tool that includes rebalancing capabilities. The bos rebalance command finds routes and executes circular payments with extensive configuration options.

# Rebalance with fee rate limit
bos rebalance --max-fee-rate 500 --out CHANNEL_ID --in CHANNEL_ID

# Auto-rebalance to target ratio
bos rebalance --out-target-inbound 50

charge-lnd

While primarily a fee management tool, charge-lnd can integrate with rebalancing workflows by automatically adjusting fees on imbalanced channels, reducing the need for active rebalancing.

Lightning Loop

Loop from Lightning Labs provides submarine swaps rather than circular rebalances. Loop Out moves funds from Lightning to on-chain, while Loop In moves on-chain funds to Lightning. This is an alternative when circular routes are expensive or unavailable.

Automated Rebalancing Services

Some Lightning service providers offer automated rebalancing as a service. These services continuously monitor your channels and execute rebalances when needed, often with optimized route-finding and fee management.

FAQ

Costs vary widely based on route length, intermediate node fees, and payment amount. Typical costs range from 0.01% to 0.5% of the rebalanced amount. Short routes through low-fee nodes can cost as little as 10 sats for small amounts, while longer routes or larger amounts might cost several hundred sats. Most tools let you set a maximum fee rate to control costs.

Integrate Lightning the Easy Way

The simplest, cheapest, and fastest way to add Lightning payments to your app with the Spark SDK.

View SDK Docs →