pull down to refresh

One thing to add about a script I find particuarly useful to dig into when trying to answer the most pressing question a node-runner has: How much should I charge for my new channel to X?
The script fee_adjuster.py can be run with --debug, resulting in no write changes, but just giving a terminal output on
  • fetching amboss fee data for the channel you added into feeConfig.json
  • following a waterfall fee-chart on what the proposed fee-setting would be, if we accept that the market currently charges that channel correctly
This is just an excerpt of what the script can do, eg fee-bands, group discounts, stuck adjustments etc. To see that in practice, below is the terminal output for my channel to Kraken 🐙⚡
.venv/bin/python ~/tools/Lightning-Python-Tools/Other/fee_adjuster.py --debug
--------------------------------------------------------------------------------
--- Stuck Check Debug for Peer 02f1a8c876... ---
  Configured stuck_time_period: 3 days
  Configured min_local_balance_for_stuck_discount: 25.0%
  API Check Window: 12 days
  Last outbound forward timestamp found: 2025-06-12 03:26:38
  Calculated days since last forward: 3
  Aggregate Outbound Ratio for Peer: 63.1%
  Calculated stuck bands down (after checks): 1
  Final Peer Status determination for stuck logic: Active (Recent Outbound Forward)
--- End Stuck Check Debug ---
--------------------------------------------------------------------------------
Alias: Kraken 🐙⚡
Pubkey: 02f1a8c87607f415c8f22c00593002775941dea48869ce23096af27b0cfdcc0b69
Channel ID: 837308890980417537
Capacity: 10,000,000
Local Balance: 6,311,206 | (Outbound: 63.1%)
Old Fee Rate (LNDg): 786

--- Fee Calculation Waterfall ---
  Start Fee (Amboss WEIGHTED_CORRECTED): 1,503.4 ppm
  +/- Base Adj (+0.0%): 1,503.4 ppm
  +/- Group Adj (-5.0%): 1,428.3 ppm
  +/- Trend Adj (+0.0%): 1,428.3 ppm
  * Fee Band Adj (-45.0%): 785.5 ppm
  Max Cap (3500 ppm): Not Applied
  Calculated Rate (Rounded): 786 ppm
---------------------------------

--- Context & Settings ---
  Group: Low Discount | Stuck ✅ | Weighted-Corrected
  Fee Base Used: weighted_corrected
  Trend Factor Used: 0.00 (Sensitivity: 0.60)
  Fee Bands: Enabled
    - Discount: -45.0%, Premium: 20.0%
    - Initial Band (Liquidity 63.1%): High Discount (60-80%)
    - Stuck Adjustment Applied: -1 bands
    - Final Band Used for Calc: Max Discount (80-100%)
    - Resulting Adjustment: -45.0%
  Stuck Adjustment: Enabled
    - Period: 3 days
    - Min Local Balance for Discount: 25.0%
    - Days Stuck: 3 days
    - Peer Status: Active (Recent Outbound Forward)
    - Adjustment Applied: 1 bands down

--- Inbound Auto Fee Adjustment ---
  Inbound Auto Fee Global Setting: Disabled

--- Amboss Peer Fee Data (Remote Perspective) ---
+-----------+---------+--------+--------+----------+-------------+
|    Time   |   Max   |  Mean  | Median | Weighted | W.Corrected |
+-----------+---------+--------+--------+----------+-------------+
|   TODAY   | 5000000 | 6475.7 |  500   |  4066.3  |    1503.4   |
|  ONE_DAY  | 5000000 | 6479.9 |  500   |  4061.5  |    1498.3   |
|  ONE_WEEK | 5000000 | 6527.8 |  500   |  3990.7  |    1409.4   |
| ONE_MONTH | 1500000 | 3450.8 |  500   |  3557.8  |    1650.2   |
+-----------+---------+--------+--------+----------+-------------+