Builder's Guide
  • Welcome to the Builder's Guide to the LND Galaxy!
  • The Lightning Network
    • Overview
    • Payment Channels
      • Lifecycle of a Payment Channel
      • Watchtowers
      • Understanding Sweeping
      • Etymology
    • The Gossip Network
      • Identifying Good Peers on the Lightning Network
    • Pathfinding
      • Finding routes in the Lightning Network
      • Channel Fees
      • Multipath Payments (MPP)
    • Lightning Network Invoices
      • Understanding Lightning Invoices
    • Making Payments
      • The Payment Cycle
      • Timelocks
      • ⭐Hashed Timelock Contract (HTLC)
      • Payment Etymology
      • ⭐What Makes a Good Routing Node
      • Understanding Submarine Swaps
      • Instant Submarine Swaps
    • Liquidity
      • ⭐Understanding Liquidity
      • Managing Liquidity on the Lightning Network
      • Liquidity Management for Lightning Merchants
      • How to Get Inbound Capacity on the Lightning Network
      • Lightning Service Provider
    • L402: Lightning HTTP 402 Protocol
      • Macaroons
      • L402
      • 📋Protocol Specification
      • Implementations and Links
    • Taproot Assets
      • Taproot Assets Protocol
      • Taproot Assets on Lightning
      • Edge Nodes
      • Taproot Assets Trustless Swap
      • FAQ
      • Glossary
  • Lightning Network Tools
    • LND
      • 🛠️Get Started
      • lnd.conf
      • First Steps With LND
      • Wallet Management
      • Sending Payments
      • Atomic Multi-path Payments (AMP)
      • Receiving Payments
      • Unconfirmed Bitcoin Transactions
      • Channel Fees
      • Inbound Channel Fees
      • Macaroons
      • Configuring Watchtowers
      • Pathfinding
      • Blinded Paths
      • Key Import
      • Secure Your Lightning Network Node
      • Configuration of a Routing Node
      • Quick Tor Setup
      • Configuring Tor
      • Enable ‘Neutrino mode’ in Bitcoin Core
      • Send Messages With Keysend
      • Partially Signed Bitcoin Transactions
      • Bulk onchain actions with PSBTs
      • Sweeper
      • Debugging LND
      • Fuzzing LND
      • LND API documentation
      • Channel Acceptor
      • RPC Middleware Interceptor
      • HTLC Interceptor
      • NAT Traversal
      • Recovery: Planning for Failure
      • Migrating LND
      • Disaster recovery
      • Contribute to LND
    • Lightning Terminal
      • What is Lightning Terminal?
      • 🛠️Get litd
      • Run litd
      • Integrating litd
      • Demo: Litd Speed Run
      • Connect to Terminal
      • Recommended Channels
      • Rankings
      • Health Checks
      • Liquidity Report
      • Opening Lightning Network Channels
      • Managing Channel Liquidity
      • Autofees
      • AutoOpen
      • LND Accounts
      • Loop and Lightning Terminal
      • Loop Fees
      • Pool and Lightning Terminal
      • Command Line Interface
      • Troubleshooting
      • Lightning Node Connect: Under the hood
      • LNC Node Package
      • LITD API Documentation
      • Privacy and Security
      • Privacy Policy
      • Terms of Use
    • Loop
      • 🛠️Get Started
      • The Loop CLI
      • Autoloop
      • Static Loop In Addresses
      • Instant Loop Outs
      • Peer with Loop
      • Loop API Documentation
    • Pool
      • Overview
      • Quickstart
      • 🛠️Installation
      • First Steps
      • Accounts
      • Orders and Asks
      • Sidecar Channels
      • Zero-confirmation Channels
      • Channel Leases
      • Batch Execution
      • Account Recovery
      • Pool API Documentation
      • FAQs
    • Taproot Assets
      • Get Started
      • First Steps
      • Taproot Assets Channels
      • Asset Decimal Display
      • Become an Edge Node
      • RFQ
      • Collectibles
      • Universes
      • Asset Loop
      • Debugging Tapd
      • Multisignature
      • Minting Assets With an External Signer
      • Lightning Polar
      • Operational Safety Guidelines
      • Taproot Assets API Documentation
    • Aperture
      • ⚒️Get Aperture
      • LNC Backend
      • LNC Mailbox
      • Pricing
    • Faraday
      • 🛠️Get Started
      • The Faraday CLI
      • Faraday API Documentation
  • LAPPs
    • Guides
      • Use Polar to Build Your First LAPP
        • Setup: Local Cluster with Polar
        • Setup: Run the Completed App
        • Setup: Run the App Without LND
      • Add Features
        • Feature 1: Connect to LND
        • Feature 2: Display Node Alias and Balance
        • Feature 3: Sign and Verify Posts
        • Feature 4: Modify Upvote Action
      • Make Your own LNC-powered Application
    • Next Steps
  • Community Resources
    • Resource List
    • Lightning Bulb 💡
    • Glossary
    • FAQ
Powered by GitBook
On this page
  • The algorithm
  • Security & Privacy
  • Configuration
  • How to enable Autofees

Was this helpful?

  1. Lightning Network Tools
  2. Lightning Terminal

Autofees

Autofees is a feature that sets fees for your channels based on how much they earn.

PreviousManaging Channel LiquidityNextAutoOpen

Last updated 17 days ago

Was this helpful?

Starting with litd v0.8.6 and the accompanying Lightning Terminal web release, users are able to choose dynamic, automatic channel fee adjustment over manually setting fees. This feature can help to reduce the maintenance overhead of a routing node while increasing fee revenue and help balance funds on a node.

By opting into Autofees, you give permission to Terminal to remotely read some information from your node and use it to programmatically set outbound fees for channels. You can set Autofees for all your channels, or limit it to only some.

Once Autofees has been enabled from Lightning Terminal, your node will automatically create a new dedicated session with its own through which fees will be set.

The algorithm

When Autofees is enabled, Terminal will use the forwarded traffic of the top five earning peers over 60 days as a reference for the entire node (in order to determine a target throughput per peer). It will then look at the forwarded traffic from the past days and decide whether to adjust fees upwards or downwards for each peer. The algorithm is designed to stabilize traffic and to prevent underpricing liquidity while adapting to changes in demand and routing flows.

If the forwarded traffic of a channel is lower than the target throughput, Terminal will lower fees. If the forwarded traffic is higher, then fees will be increased. Each fee adjustment is made in small increments once every three days, a tradeoff to limit gossip data on the network.

As a channel sees 7/8th of their liquidity depleted, fees are once again mildly raised to signal scarcity, to keep the channel balanced, and to keep liquidity for excess demand periods. This helps senders in the Lightning Network to reduce forwarding failures.

The algorithm can be enabled for all peers, or only for specific ones. It runs purely on historical forwarding data, current channel balancedness, and charged relative routing fees provided by LND, without a state or database on the litd side.

Results are expected to improve over time as the algorithm matures. By using Terminal the user always has access to the latest Autofee algorithm without the need to upgrade their node or litd client.

Security & Privacy

At its core, Autofees does not change of your Terminal session. By enabling Autofees for all or specific channels, you create a new additional session with the Autofees server, where the session is only allowed to access forwarding data, channel balances, and fee rate policies. Autofees has limited write permissions to only set new fee policies. The session is visible in litd and can be revoked at any time.

Due to the built-in rule mechanics enforced by litd, the Autofee feature has limited access to forwarding data (60 days into the past) and is only able to run in a predetermined frequency. The litd firewall rules limit algorithmically set fee rates by defining maximum values.

To improve privacy around data sharing, channel ids, channel points and node pubkeys are obfuscated by litd through a system called the "Privacy Mapper." Amounts and timestamps in forwarding data are randomly obfuscated to break amount and time correlation. Channel details only include randomized balance information such as to be still accurate enough for the algorithm to act. Per-peer aggregated forwarding data is stored to improve on the algorithm in the future to learn historic price-demand data pairs.

The privacy mapper can be interacted with manually through litcli for debugging purposes. litcli privacy can convert both strings and uint64 to the pseudo counter part and back.

Enabling Autofees will set your channels’ to 100.

Configuration

rpcmiddleware.enable=true

To make optimal use of Autofees, consider:

  • Only enable Autofees for peers you don’t know an accurate price of. For some peers, such as for example Loop, you can keep your manually set fees

  • Manual intervention in fee setting is possible

  • Avoid to restart Autofees as a new session will be created every time as there may be false double accounting for overlapping periods

How to enable Autofees

To make use of autofees, make sure the following has been added to your lnd.conf file. .

For guides on how to install litd, . If you already have litd installed, .

, so they can be lowered later without risk of seeing a channel depleted without adequate compensation (suggested value bitcoin.feerate=2500 in your lnd.conf)

You can enable Autofees in your Lightning Terminal under Liquidity -> Loop. .

Lightning Node Connect
Macaroon
the security model
CLTV delta
You can read more about the RPC Middleware interceptor here
follow this link
connect to Lightning Terminal
Set default high fee rates
Learn how to connect to Terminal here