GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Lunar-Rails/ep-liquidator: A daemon to monitor and automate the liquidity of your LND channels

BranchesTags
Open more actions menu

Latest commit

 

History

112 Commits
112 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
.vscode
.vscode
 
 
cache
cache
 
 
customerrors
customerrors
 
 
helper
helper
 
 
lndconnect
lndconnect
 
 
nodeguard
nodeguard
 
 
provider
provider
 
 
rpc
rpc
 
 
.dockerignore
.dockerignore
 
 
.env
.env
 
 
.gitignore
.gitignore
 
 
.justfile
.justfile
 
 
Dockerfile
Dockerfile
 
 
Dockerfile.loopserver
Dockerfile.loopserver
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
docker-compose.yml
docker-compose.yml
 
 
flags.go
flags.go
 
 
go.mod
go.mod
 
 
go.sum
go.sum
 
 
lightning_rpc_mock.go
lightning_rpc_mock.go
 
 
liquidator.code-workspace
liquidator.code-workspace
 
 
liquidator.go
liquidator.go
 
 
liquidator.png
liquidator.png
 
 
liquidator_test.go
liquidator_test.go
 
 
logger.go
logger.go
 
 
loopd.zip
loopd.zip
 
 
main.go
main.go
 
 
regtest.polar.zip
regtest.polar.zip
 
 
router_rpc_mock.go
router_rpc_mock.go
 
 
structs.go
structs.go
 
 
telemetry.go
telemetry.go
 
 

Repository files navigation

NodeGuard Liquidator

Go Report Card

Description

A CLI tool to monitor and automate the liquidity of your LND channels

Usage:
  liquidator [flags]

Flags:
      --backoffCoefficient float       Coefficient to apply to the backoff (default 0.95)
      --backoffLimit float             Limit coefficient of the backoff (default 0.1)
  -h, --help                           help for liquidator
      --limitFeesL2 float              Limit fee ratio for swaps max routing fee e.g. 0.01 = 1% (default 0.002)
      --limitQuoteFees float           Limit fee ratio for swaps quotes (e.g. onchain+service fee estimation) e.g. 0.01 = 1% (default 0.005)
      --lndconnecturis string          CSV of lndconnect strings to connect to lnd(s)
      --logFormat string               Log format from: {text, json} (default "text")
      --logLevel string                Log level from values: {trace, debug, info, warn, error, fatal, panic} (default "info")
      --loopdconnecturis string        CSV of loopdconnect strings to connect to loopd(s)
      --nodeguardHost string           Hostname:port to connect to nodeguard
      --pollingInterval string         Interval to poll data (default "15s")
      --retriesBeforeBackoff int       Number of retries before applying backoff to the swap (default 3)
      --swapLockTimeout string         Timeout for swap locks to automatically expire (default "30m")
      --swapPublicationOffset string   Swap publication deadline offset (Maximum time for the swap provider to publish the swap) (default "60m")
      --sweepConfTarget string         Target number of confirmations for swaps, this uses bitcoin core broken estimator, procced with caution (default "400")

Requirements

This project uses just with the following recipes

Available recipes:
    build
    build-loopserver arg=''
    compile-lnrpc-proto
    compile-loop-proto
    compile-nodeguard-proto
    compile-provider-mocks
    cover-test
    fmt
    init-submodules
    install-loopd-loop
    loop *args=''
    loopin sats='1000000'
    loopout chanid sats='500000'
    mine
    run *args=''
    start-all
    start-loopd-carol
    start-loopserver
    test
    unzip-loopd-datadir

Environment Variables / Flags

All the flags can be set as environment variables, with the following format, except stated, they are all mandatory:

  • LNDCONNECTURIS : CSV of lndconnect strings to connect to lnd(s)\
  • LIMITQUOTEFEES (optional) : Limit to total Max Quote Fees (L1+service fee) (default 0.007 -> 0.7% of the Swap size)
  • LIMITFEESL2 (optional) : Limit to total Max Routing Fees (L2) (default 0.002 -> 0.2% of the Swap size)
  • LOOPDCONNECTURIS : CSV of loopdconnect strings to connect to loopd(s)
  • POLLINGINTERVAL (optional) : Interval to poll data(default 15s)
  • LOGLEVEL (optional) : Log level (default info) from: {trace, debug, info, warn, error, fatal, panic}
  • LOGFORMAT (optional) : Log format (default json) from: {json, text}
  • SWAPPUBLICATIONOFFSET (optional) : Swap publication deadline offset (Maximum time for the swap provider to publish the swap) (default 30m)
  • SWAPLOCKTIMEOUT (optional) : Timeout for swap locks to automatically expire (default 30m)
  • RETRIESBEFOREBACKOFF (optional) : Number of retries before applying backoff to the swap (default: 3)
  • BACKOFFCOEFFICIENT (optional) : Coefficient to apply to the backoff (default: 0.95)
  • BACKOFFLIMIT (optional) : Limit coefficient of the backoff (default: 0.1)

Build & test

Build

just build

Testing

just test

Dev environment

  1. Launch a local regtest with polar from regtest.polar.zip
  2. Lauch with VS Code pre-defined configuration

Setup loop/loopd/loopserver regtest environment

  1. Make sure your regtest.polar.zip network in polar is running
  2. Unzip loopd datadir
just unzip-loopd-datadir
  1. Get git submodules
just init-submodules
  1. Compile and install loopd/loop binaries (Make sure your golang install bin dir is reachable from your PATH)
just install-loopd-loop
  1. Using just, run the following command:
just start-all
  1. This comand should have build a loopserver docker image, and started a loopserver container along with loopd as a native binary.

Loop just recipes

There are a few recipes using just -l to interact with loopd for loop in, loop out and calling loop CLI with args (just loop <args>).

Metrics

The following metrics are exposed in the /metrics endpoint on port 9000 (e.g. localhost:9000/metrics)):

  • liquidator_channel_balance: Channel balance ratio in 0 to 1 range, 0 means all the balance is on the local side of the channel, 1 means all the balance is on the remote side of the channel

Example:

liquidator_channel_balance{active="false",chan_id="118747255865345",local_node_alias="alice",local_node_pubkey="03b48034270e522e4033afdbe43383d66d426638927b940d09a8a7a0de4d96e807",remote_node_alias="",remote_node_pubkey="02f97d034c6c8f5ad95b1fe6abfe68ab154e85b1f5bb909815baeb5c8a46cdf622",initiator="false"} 0.99

liquidator_channel_balance{active="false",chan_id="125344325632000",local_node_alias="alice",local_node_pubkey="03b48034270e522e4033afdbe43383d66d426638927b940d09a8a7a0de4d96e807",remote_node_alias="",remote_node_pubkey="02f97d034c6c8f5ad95b1fe6abfe68ab154e85b1f5bb909815baeb5c8a46cdf622",initiator="false"} 0

liquidator_channel_balance{active="false",chan_id="131941395398656",local_node_alias="carol",local_node_pubkey="03485d8dcdd149c87553eeb80586eb2bece874d412e9f117304446ce189955d375",remote_node_alias="",remote_node_pubkey="02f97d034c6c8f5ad95b1fe6abfe68ab154e85b1f5bb909815baeb5c8a46cdf622",initiator="false"} 0

Other go-based metrics of the application are exposed for performance monitoring.

About

A daemon to monitor and automate the liquidity of your LND channels

Resources

Readme
MIT license
Activity
Custom properties

Stars

4 stars

Watchers

2 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.