Inspiration

One of the biggest challenges in the Lightning Network today is managing nodes efficiently. Node operators often struggle to determine optimal inbound and outbound liquidity and when to rebalance. While there are existing products like Magma AI (Amboss) and Lightspark, these are closed-source services. We wanted to explore a more open, customizable, and community-driven alternative with simple access to state of the art ML models.

What it does

AutoLN is a library that allows node operators to plug directly into their Lightning nodes and train an AI model based on their own node’s behavior and network position. By analyzing gossip protocol data and liquidity patterns, AutoLN helps automate channel rebalancing in a personalized way — adaptive to each node’s unique connections and traffic flow.

How we built it

We used Polar to create a custom Lightning Network topology where we could collect synthetic data from the gossip protocol. Within this simulated environment, we integrated an LND node running with LDK (Lightning Development Kit) to gather insights about the node’s perception of the wider network. We then used this data to create LN-focused pipelines to train models through Microsoft FLAML, enabling lightweight AutoML experiments and efficient model tuning directly from network data.

Challenges we ran into

Setting up the node infrastructure was a major technical challenge. Initially, we tried connecting ldk-server to the Polar network to extract gossip data, but we quickly discovered that it doesn’t expose the crucial data we needed. We switched to LND + LNDK, which gave us the necessary access and more flexible APIs. We also explored extracting data from ldk-server’s SQLite3 database, but the schema and data format were too opaque to interpret efficiently — so we pivoted to using its CLI tools for more direct data access. We also explored several academic papers on Lightning Network optimization, simulation, and estimation (specially Rene Pickhardt's) to understand how we could bring this knowledge into practice.

Accomplishments that we're proud of

  • Successfully simulated a multi-node Lightning environment using Polar
  • Collected and processed gossip protocol data for training
  • Integrated AutoML (FLAML) to automatically optimize model parameters
  • Designed a modular architecture that can extend to multiple node implementations

What we learned

We learned a lot about how LND and gossip protocol work and the potential the information they return. have to transform lightning network environment.

What's next for AutoLN

  • improve integration with lightning nodes
  • improve UX: reduce the steps that the user need to accomplish to have a trained model
  • support to other lightning node implementations
  • add a way to tune the pre-trained model to get better results

Built With

Share this project:

Updates