Giter Site home page Giter Site logo

dcrlnlpd's Introduction

DCR LN Liquidity Provider Daemon

This service allows running a Lightning Network Liquidity Provider in the Decred network.

This LP allows remote clients to request the node associated to the LP to open an LN channel back to the requesting client. This allows the requesting client to have some inbound bandwidth to receive LN payments.

To create the channel, the LP charges some amount, specified as a percentage of the desired channel size.

โš ๏ธ NOTE: This software takes control of the outbound channels created by this node, such that it will close any channels that do not conform to its policy, even ones not created by it (e.g. manually created channels). See below for a discussion on the closing policy.

Building & Running

Requires Go 1.17+. Download the code, then run

$ go install .
$ dcrlnlpd

Configuration

A default config file is created in ~/.dcrlnlpd/dcrlnlpd.conf if it does not exist. CLI parameters can be found by running -h/--help.

Channel Closing Policy

The policy to decide whether to close a channel is:

  (totalSentAtoms / lifetime) >= (requiredSentAtoms / requiredInterval)

This policy is evaluated every closepolicy.checkinterval (default: 1 hour) and only for channels which have a lifetime greater than closepolicy.minchanlifetime.

What this means is that every time the check is evaluated, every channel must have had some minimum amount of atoms sent through it, otherwise it is closed.

With the default settings, the channel must have had at least 0.001 DCR sent through it every 24 hours, otherwise it will be closed. This policy is easily tweaked by changing the appropriate config entries.

Client

A client implementation is available in the github.com/decred/dcrlnlpd/client package. A CLI client is also provided in the cmd/client subdir.

An example invocation of the CLI client is the following:

go run ./cmd/client/ \
  --lnrpchost localhost:20100 \
  --lntlscertpath ~/dcrlndsimnetnodes/dcrlnd1/tls.cert \
  --lnmacaroonpath ~/dcrlndsimnetnodes/dcrlnd1/chain/decred/simnet/admin.macaroon \
  --addr http://localhost:29130 \
  --chansize 0.001

License

dcrlnlpd is licensed under the copyfree ISC License.

dcrlnlpd's People

Contributors

dajohi avatar davecgh avatar matheusd avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

dcrlnlpd's Issues

feature request: implement fee tiers

At the moment any person requesting liquidity from the LP pays a set fee regardless of the channel size. If the Decred LN and services using it really take off the demand for liquidity is bound to go up. If that happens and the liquidity providers adjust the max channel sizes users are able to request they'll have to adjust the fee sizes in order to compensate for the lockup of larger and larger sums of DCR, but without tiered fees a person requesting 0.1 DCR will have to pay the same (higher) fee as a person requesting 10 DCR or 50 DCR.
I'm wondering if tiered fees are a viable solution (in terms of implementation) or if there's already a solution being cooked up to account for a possible scenario like the one above.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.