跳至主要內容
進階

流動性管理

了解閃電網路流動性的概念,以及如何有效管理通道餘額以確保支付順利。

15 分鐘

什麼是流動性?

在閃電網路中,「流動性」指的是你在通道中可用於支付的資金。 由於支付通道是雙向的,你的流動性決定了你能發送和接收多少資金。

流動性類型:

通道容量: 1,000,000 sats

通道總容量
本地餘額
600,000 sats
遠端餘額
400,000 sats
出站流動性
(可發送)
入站流動性
(可接收)

出站流動性 (Outbound) = 本地餘額
入站流動性 (Inbound) = 遠端餘額

關鍵洞見: 開啟通道時你提供的資金是「出站流動性」。 要獲得「入站流動性」,需要別人向你開通道,或者你先花掉一些資金。

流動性問題

缺乏入站流動性

剛開通道的節點只有出站流動性,無法接收大額支付。商家經常遇到這個問題。

通道不平衡

經常收款或付款會導致通道餘額偏向一側,影響雙向支付能力。

流動性碎片化

資金分散在多個小通道,單個通道無法處理大額支付。

路由節點耗盡

高流量的路由節點某一側流動性被耗盡,無法繼續轉發。

獲取入站流動性

1. 請求入站通道

Method: Ask others to open channel to you

Free methods:
• Join Lightning Network community
• Provide valuable node (good connectivity)
• Participate in liquidity swap groups

Paid methods:
• Liquidity markets (Magma, Pool, Amboss)
• LSP (Lightning Service Provider)
• Channel rental services

2. 使用 LSP

LSP (Lightning Service Provider):

Services:
• Auto-open inbound channels
• On-demand liquidity (JIT channels)
• Liquidity management

Common LSPs:
• ACINQ (Phoenix)
• Breez
• Voltage
• Zero Fee Routing

JIT (Just-In-Time) Channels:
1. Receive payment request
2. LSP opens channel instantly
3. Channel fee deducted from payment
4. User doesn't wait for confirmation

3. 流動性市場

Liquidity Market Platforms:

Lightning Pool (Lightning Labs):
• Auction model
• Buy/rent channels
• APY billing

Magma (Amboss):
• P2P liquidity market
• Fixed price or auction
• Reputation system

Pricing Factors:
• Channel size
• Rental period
• Peer node quality
• Market supply/demand

通道再平衡

當通道不平衡時,可以通過「再平衡」來調整餘額分布:

循環再平衡

Circular Rebalance Principle:

Goal: Move funds from channel A to channel B

Your Node --- ChannelA --- Node1
    |                        |
    |                        |
ChannelB                     |
    |                        |
    +---- Node2 -------------+

Steps:
1. Send to yourself via channel B
2. Route through Node2 -> Node1
3. Return from channel A to yourself

Result:
• Channel A local balance decreases
• Channel B local balance increases
• Pay routing fees

Tools:
• lncli: bos rebalance
• Core Lightning: rebalance plugin
• RTL, ThunderHub and other GUIs

潛水艇交換

Submarine Swap:

Loop Out (increase inbound):
Lightning -> On-chain
1. Send Lightning payment to swap service
2. Service sends on-chain BTC to you
3. Your outbound liquidity becomes inbound

Loop In (increase outbound):
On-chain -> Lightning
1. Send on-chain BTC to swap service
2. Service sends Lightning payment to you
3. You get more outbound liquidity

Service Providers:
• Loop (Lightning Labs)
• Boltz
• Deezy

Splicing

Splicing 允許在不關閉通道的情況下調整容量:

Splice-In (increase capacity):
1. Add more funds to existing channel
2. Create new funding tx
3. Channel continues operating, no interruption

Original: 1 BTC -> New: 2 BTC

Splice-Out (decrease capacity):
1. Extract partial funds from channel
2. Funds sent to on-chain address
3. Channel capacity reduced but continues

Original: 2 BTC -> New: 1.5 BTC + 0.5 BTC on-chain

Advantages:
• No need to close/reopen channel
• Save on-chain fees
• Maintain payment routing continuity

Status: Core Lightning supported, LND in development

路由節點策略

Routing Node Liquidity Strategy:

1. Dynamic Fees
   • Raise fees for low liquidity direction
   • Lower fees for high liquidity direction
   • Auto-guide traffic balance

2. Channel Selection
   • Choose high-traffic peers
   • Avoid dead-end nodes
   • Establish triangular connections

3. Rebalance Timing
   • Set thresholds (e.g. 20%-80%)
   • Auto-rebalance below threshold
   • Consider fee cost-effectiveness

4. Monitoring Tools
   • Track traffic per channel
   • Identify bottleneck channels
   • Analyze profit margins

流動性成本

Liquidity Cost Calculation:

Channel Opening Costs:
• On-chain fee (opening)
• Capital lock-up cost (opportunity cost)
• On-chain fee (closing)

Maintenance Costs:
• Rebalancing fees
• Monitoring and management time

Revenue:
• Routing fees
• Liquidity rental income

ROI Calculation:
Yield = (Routing Income - Costs) / Capital Invested

Typical Routing Node:
• APY 1-5% (market dependent)
• Requires active management

最佳實踐

多樣化連接

與不同類型的節點建立通道:大型路由節點、商家、交易所等。

適當的通道大小

通道太小無法處理正常支付,太大則資金效率低。根據需求選擇。

定期監控

使用工具監控通道餘額,在失衡嚴重前採取行動。

成本意識

再平衡有成本,只在必要時進行。考慮使用動態手續費替代。

下一步: 了解 通道管理 的具體操作和工具。

已複製連結
已複製到剪貼簿