Lightning Nodes

Liquidity Management

Liquidity Management

Managing Lightning Network liquidity is critical for successful node operation. This guide covers strategies for optimizing channel liquidity for routing, payments, and receiving.

Estimated reading time: 9 minutes

Managing Lightning Network liquidity is critical for successful node operation. This guide covers strategies for optimizing channel liquidity for routing, payments, and receiving.

Understanding Liquidity

Liquidity = ability to send and receive Bitcoin through payment channels.

Local vs Remote Balance

Every channel has fixed capacity divided between participants:

  • Local balance (outbound liquidity) - Your side, for sending payments

  • Remote balance (inbound liquidity) - Partner's side, for receiving payments

┌─────────────────────────────────────────────┐
Channel (1,000,000 sats)          
├──────────────────────┬──────────────────────┤
Local: 600k sats   Remote: 400k sats  
└──────────────────────┴──────────────────────┘
     Can send              Can receive


Key: Sending decreases local, increases remote. Receiving does opposite. Total capacity never changes.

Reserve Requirements

Channels enforce 1% reserve on each side to prevent cheating.

Example: 10M sat channel requires 100k sat minimum reserve per side.

  • Max send: 9.9M sats

  • Max receive: 9.9M sats

Common Liquidity Problems

Depleted Outbound Liquidity

Symptoms:

  • Cannot send payments through channels

  • "Insufficient local balance" errors

  • Channels show 0% local balance

Cause: Sent too many payments without receiving or rebalancing.

Insufficient Inbound Liquidity

Symptoms:

  • Lightning invoices fail

  • Customers cannot pay you

  • Channels show 100% local balance

Cause: New channels or too many received payments without sending.

Routing Failures

Symptoms:

  • Low routing volume

  • Frequent failures

  • Channels at 0% or 100% balance

Cause: Imbalanced channels prevent routing in one or both directions.

Liquidity Management Strategies

Opening Balanced Channels

Dual-Funded Channels

Both parties contribute funds when opening, providing immediate bi-directional liquidity.

Available via Dashboard: Channels → Open Channel → Enable "Dual-Funded" option, or via API.

Note: Requires LND 0.17.0+ and peer support.

Push Amount

Single-funded channel with immediate push to create balance.

Available via Dashboard: Channels → Open Channel → Specify push amount, or via API.

Cost: Routing fees paid to intermediate nodes.

Balance of Satoshis (Automated)

npm install -g balanceofsatoshis
bos credentials --node <your-node-id>
bos rebalance --channel <channel-id> --target 50&nbsp; # Target 50/50 balance</channel-id></your-node-id

Fee Management

Setting Channel Fees

Formula: Total fee = base_fee + (amount × fee_rate / 1,000,000)

Parameters:

  • Base fee: Fixed fee (millisatoshis)

  • Fee rate: Proportional fee (parts per million, ppm)

Example: Base 1000 msat, Rate 500 ppm

  • 100k sat payment: 1 + (100,000 × 500 / 1,000,000) = 51 sats

Set fees: Available via Dashboard: Channels → Select Channel → Edit Policy → Update Base Fee and Fee Rate, or via API.

Fee Optimization Strategies

Balanced Policy (Simple):

  • Base: 1000 msat

  • Rate: 100 ppm (0.01%)

  • Same across all channels

Directional Policy (Advanced):

  • Low local balance channel: High fees (5000 ppm) - discourage depletion

  • High local balance channel: Low fees (100 ppm) - encourage usage

Routing Optimization

Becoming a Routing Node

Requirements:

  • Channels to high-volume, well-connected nodes

  • Balanced liquidity (40-60% local)

  • Competitive fees

  • High uptime

Find good peers:

Channel Selection Criteria

Centrality: Nodes frequently in successful routes

Capacity: 5-10M sats for routing, 1-3M for personal

Uptime: Check peer reliability on Amboss/1ML

Fee Policies: Reasonable, consistent fees

Peer Management

Available via Dashboard:

  • Channels → View all channels with detailed statistics

  • Channels → Select Channel → Close Channel

Replace closed channels with connections to better peers.

Tools

Comet Dashboard

  1. Channel Balance Visualization - Bar charts

  2. Liquidity Alerts - Imbalance notifications

  3. Rebalancing Wizard - Guided interface

  4. Fee Policy Manager - Visual editor

  5. Routing Analytics - Performance metrics

Access: Dashboard → Channels → Liquidity Management

API Access

All liquidity management operations are available via the Comet Platform API. See API Reference for detailed documentation.

Third-Party Tools

Balance of Satoshis:

  • Automated rebalancing

  • Channel health reports

  • Routing analysis

ThunderHub:

  • Web-based management

  • Integrated rebalancing

  • Fee optimization

Ride the Lightning (RTL):

  • Channel visualization

  • Circular rebalancing

  • Fee management

Monitoring and Alerts

Setting Up Alerts

Configure in Dashboard:

  1. Monitoring → Alerts

  2. Low Inbound: inbound_liquidity < 10%

  3. Low Outbound: local_balance < 1000000 sats

  4. Channel Imbalance: abs(local_balance_pct - 50) > 40

Key Metrics

Channel-Level:

  • Local/remote balance percentages

  • Total capacity

  • Activity level

  • Last update timestamp

Node-Level:

  • Total outbound/inbound liquidity

  • Active channels count

  • Routing success rate

  • Fee revenue

Monitor via Dashboard:

  • Dashboard → Channels → View channel balances and percentages

  • Dashboard → Analytics → Liquidity metrics and reports

Or use the API for programmatic monitoring - see API Reference

Best Practices

Payment Nodes

  1. Open 2-5 channels to reliable, well-connected peers

  2. Request inbound liquidity from LSPs

  3. Use Loop Out regularly for excess outbound

  4. Monitor payment failures

  5. Keep emergency on-chain reserves

Routing Nodes

  1. Open 10-30 strategically selected channels

  2. Maintain 40-60% balance ratios

  3. Rebalance proactively

  4. Implement dynamic fee policies

  5. Monitor channel performance monthly

  6. Close underperforming channels

  7. Mix channel sizes (3-10M sats)

Merchant Nodes

  1. Maximize inbound liquidity via LSPs

  2. Automate Loop Outs to maintain capacity

  3. Monitor during peak traffic times

  4. Offer on-chain fallback for large payments

  5. Display available Lightning capacity to customers

Troubleshooting

Payment Failed: Insufficient Local Balance

Solutions:

  1. Check balances via Dashboard: Channels → View channel balances

  2. Rebalance to increase outbound liquidity

  3. Open additional channels

Invoice Cannot Be Paid: No Inbound

Solutions:

  1. Use Loop In

  2. Request LSP channel

  3. Ask peer to open channel to you

  4. Send payments to shift balance

Routing Failures

Solutions:

  1. Rebalance channels to 40-60% local

  2. Verify competitive fees

  3. Ensure high uptime

  4. Connect to better peers

High Rebalancing Costs

Solutions:

  1. Find lower-fee routes: bos rebalance --max-fee

  2. Use submarine swaps (Loop)

  3. Adjust fee policies for natural rebalancing

  4. Open channels with better-connected peers

Code Examples

Check Channel Balances (Python)

import requests, codecs

node_url = "https://api.comet.platform/lnd/<node-id>"
with open('admin.macaroon', 'rb') as f:
	macaroon = codecs.encode(f.read(), 'hex')

headers = {'Grpc-Metadata-macaroon': macaroon}
response = requests.get(f"{node_url}/v1/channels", headers=headers)

for channel in response.json()['channels']:
local = int(channel['local_balance'])
capacity = int(channel['capacity'])
local_pct = (local / capacity) * 100
status = "BALANCED" if 40 <= local_pct <= 60 else "IMBALANCED"
print(f"Channel {channel['chan_id'][:8]}: {local_pct:.1f}% local - {status}")</node-id

Automated Rebalancing (Node.js)

const axios = require('axios');
const fs = require('fs');
const api = axios.create({
baseURL: 'https://api.comet.platform/lnd/<node-id>',
headers: { 'Grpc-Metadata-macaroon': fs.readFileSync('admin.macaroon').toString('hex') }});
async function monitorAndRebalance() {
const { data } = await api.get('/v1/channels');
for (const channel of data.channels) {
const localPct = (parseInt(channel.local_balance) / parseInt(channel.capacity)) * 100;
if (localPct < 20) {
const rebalanceAmt = Math.floor(parseInt(channel.capacity) * 0.3);
console.log(`Rebalancing channel ${channel.chan_id}...`);
// Implement rebalance logic here
}
}
}
setInterval(monitorAndRebalance, 6 * 60 * 60 * 1000); // Every 6 hours</node-id>


Table of Contents

Copyright © 2025 Comet Cash

Czech Republic VASP License Registration Nº 22053751

info@cometcash.com

All rights reserved.

Copyright © 2025 Comet Cash

Czech Republic VASP License Registration Nº 22053751

info@cometcash.com

All rights reserved.