2020-09-09 17:45:32 -07:00
|
|
|
|
# Lightning Pool
|
2020-06-23 20:24:48 -07:00
|
|
|
|
|
2020-10-30 18:36:01 -07:00
|
|
|
|
Lightning Pool is a non-custodial, peer-to-peer marketplace that allows node
|
|
|
|
|
|
operators that need inbound liquidity to pay node operators with available
|
|
|
|
|
|
capital to open channels in their direction while retaining full custody of
|
|
|
|
|
|
their funds. Pool’s first product is a Lightning Channel Lease - an inbound
|
|
|
|
|
|
channel with a pre-agreed duration.
|
|
|
|
|
|
|
|
|
|
|
|
Efficient capital allocation is one of the most widely felt pain points when
|
|
|
|
|
|
using the Lightning Network. Existing node operators do not have access to
|
|
|
|
|
|
pricing signals to help determine where in the network their outbound liquidity
|
|
|
|
|
|
should be allocated, and new node operators have no way to signal that they
|
|
|
|
|
|
need new inbound liquidity. Lightning Pool brings these two sides together into
|
|
|
|
|
|
a single market while allowing them to maintain custody of their funds.
|
|
|
|
|
|
|
|
|
|
|
|
Checkout our [documentation](https://pool.lightning.engineering/) to learn
|
|
|
|
|
|
more. For more [technical details, check out the technical white
|
|
|
|
|
|
paper](https://github.com/lightninglabs/pool-paper/blob/main/liquidity.pdf).
|
2020-06-23 20:24:48 -07:00
|
|
|
|
|
2020-10-30 18:36:01 -07:00
|
|
|
|
## How it works
|
|
|
|
|
|
Lightning Pool is a non-custodial auction for liquidity where bids are kept
|
|
|
|
|
|
private and trades clear periodically. Key aspects of Pool include:
|
2020-06-23 20:24:48 -07:00
|
|
|
|
|
2020-10-30 18:36:01 -07:00
|
|
|
|
- **Periodic clearing** - Market does not clear continuously, instead, it
|
|
|
|
|
|
clears every block (or after multiple blocks, if there are no bids that match
|
|
|
|
|
|
with existing asks).
|
2020-06-23 20:24:48 -07:00
|
|
|
|
|
2020-10-30 18:36:01 -07:00
|
|
|
|
- **Non-custodial** - Clients maintain an on-chain account that is a
|
|
|
|
|
|
timelocked, 2-of-2 multisig with the auctioneer. These funds are fully in the
|
|
|
|
|
|
user’s control at all times.
|
|
|
|
|
|
|
|
|
|
|
|
- **Sealed-bid** - All orders are submitted off-chain to the auctioneer, so
|
|
|
|
|
|
bidders don’t have visibility into the bids of other participants
|
2020-06-23 20:24:48 -07:00
|
|
|
|
|
2020-10-30 18:36:01 -07:00
|
|
|
|
- **Uniform clearing price** - All participants in a batch clear at the same
|
|
|
|
|
|
price. If your ask is for 2% annualized interest, you will receive >=2%. If
|
|
|
|
|
|
you bid 5%, you will pay <=5%.
|
|
|
|
|
|
|
|
|
|
|
|
- **Batched execution** - Due to the account structure, the auctioneer is able
|
|
|
|
|
|
to batch all completed orders into a single transaction, greatly reducing
|
|
|
|
|
|
individual chain fees.
|
2020-06-23 20:24:48 -07:00
|
|
|
|
|
2020-10-29 08:45:31 -10:00
|
|
|
|
## Installation
|
2020-10-30 18:36:01 -07:00
|
|
|
|
Download the latest binaries from the
|
|
|
|
|
|
[releases](https://github.com/lightninglabs/pool/releases) page.
|
2020-06-23 20:24:48 -07:00
|
|
|
|
|
2020-10-29 08:45:31 -10:00
|
|
|
|
## LND
|
2020-10-30 18:36:01 -07:00
|
|
|
|
|
|
|
|
|
|
Note that Pool requires `lnd` to be built with **all of its subservers** and
|
2022-07-13 09:32:00 +02:00
|
|
|
|
requires running at least `v0.14.3`. Download the latest [official release
|
2020-10-30 18:36:01 -07:00
|
|
|
|
binary](https://github.com/lightningnetwork/lnd/releases/latest) or build `lnd`
|
|
|
|
|
|
from source by following the [installation
|
|
|
|
|
|
instructions](https://github.com/lightningnetwork/lnd/blob/master/docs/INSTALL.md).
|
|
|
|
|
|
If you choose to build `lnd` from source, use the following command to enable
|
|
|
|
|
|
all the relevant subservers:
|
2020-06-23 20:24:48 -07:00
|
|
|
|
|
2020-10-29 08:45:31 -10:00
|
|
|
|
```
|
|
|
|
|
|
make install tags="signrpc walletrpc chainrpc invoicesrpc"
|
|
|
|
|
|
```
|
2020-06-23 20:24:48 -07:00
|
|
|
|
|
2020-10-29 08:45:31 -10:00
|
|
|
|
## Usage
|
2020-11-02 10:24:34 -05:00
|
|
|
|
Read our [quickstart guide](https://pool.lightning.engineering/quickstart) to
|
|
|
|
|
|
learn more about how to use Pool.
|
2020-10-30 14:22:40 -10:00
|
|
|
|
|
2020-11-02 10:24:34 -05:00
|
|
|
|
## Marketplace Fee
|
|
|
|
|
|
Fees are calculated based on the amount of liquidity purchased. During the
|
2021-12-16 10:42:47 +01:00
|
|
|
|
mainnet alpha, fees will range from 5-25 basis points of the matched amount.
|
2020-10-30 14:22:40 -10:00
|
|
|
|
|
2020-11-02 10:24:34 -05:00
|
|
|
|
## Development
|
|
|
|
|
|
The Pool client is currently in early alpha and offers a simple command line
|
|
|
|
|
|
application.
|
2020-10-30 14:22:40 -10:00
|
|
|
|
|
2020-10-30 18:36:01 -07:00
|
|
|
|
The Pool daemon exposes a [gRPC
|
|
|
|
|
|
API](https://lightning.engineering/poolapi/index.html#pool-grpc-api-reference)
|
|
|
|
|
|
and [REST
|
|
|
|
|
|
API](https://lightning.engineering/poolapi/index.html#pool-rest-api-reference).
|
2020-06-23 20:24:48 -07:00
|
|
|
|
|
2020-10-29 08:45:31 -10:00
|
|
|
|
## Troubleshooting
|
2020-10-30 18:36:01 -07:00
|
|
|
|
[Join us on Slack](https://lightning.engineering/slack.html) and we'd be happy
|
|
|
|
|
|
to help in any way we can. In the meantime please see our
|
|
|
|
|
|
[FAQs](https://pool.lightning.engineering/faq).
|
2020-09-07 14:45:52 +02:00
|
|
|
|
|
2020-10-29 08:45:31 -10:00
|
|
|
|
## Build from source
|
2022-07-13 09:32:00 +02:00
|
|
|
|
If you’d prefer to compile from source code, you’ll need at least `go 1.17` and
|
2020-10-30 18:36:01 -07:00
|
|
|
|
`make`.
|
2020-06-23 20:24:48 -07:00
|
|
|
|
|
2020-10-29 08:45:31 -10:00
|
|
|
|
Run the following commands to download the code, compile and install Pool:
|
|
|
|
|
|
|
2020-10-30 16:55:03 -07:00
|
|
|
|
```shell
|
|
|
|
|
|
$ git clone https://github.com/lightninglabs/pool
|
|
|
|
|
|
$ cd pool
|
|
|
|
|
|
$ make install
|
2020-10-29 08:45:31 -10:00
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
This will install the binaries into your `$GOPATH/bin` directory.
|
|
|
|
|
|
|
|
|
|
|
|
## Compatibility
|
2022-07-13 09:32:00 +02:00
|
|
|
|
Lightning Pool requires `lnd` version `0.14.3-beta` or higher (`v0.15.0-beta` or
|
2021-12-07 20:08:56 +01:00
|
|
|
|
later is recommended).
|