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
  • Start pool
  • Open an account
  • Buy incoming liquidity
  • Add funds
  • Close an account

Was this helpful?

  1. Lightning Network Tools
  2. Pool

First Steps

Open a Pool account and buy your first channel using the command line.

PreviousInstallationNextAccounts

Last updated 18 days ago

Was this helpful?

This article discusses how to get started with Pool using the command line. To learn how to use Pool as part of the Lightning Pool user interface, .

Start pool

We can start the Pool daemon with the command poold

Depending on your LND installation, you may have to specify its RPC port, Macaroon, and TLS path.

You will need some funds in your LND’s on-chain wallet and at least one channel with enough outgoing capacity to pay 1000 satoshis for API access to Pool.

Open an account

Once the Pool daemon is running, we can create a new account with the command pool accounts new <amount in satoshis>. We can also define when this account should expire, either by using an absolute block height or a period expressed in blocks. Please note that orders typically can no longer be matched 144 blocks before its expiration time.

pool accounts new 5000000 --expiry_blocks 12960 --conf_target 12

Once executed, you will be asked to confirm the opening of your account, including the amount and the miner fee. Upon confirmation, you will receive your trader key and transaction ID.

We can now inspect the status of the account with pool accounts list. This will inform us about the available balance, the account expiration, the utxo that the funds are currently held in and the state that the account is in. We will have to wait for two confirmations for the account to be open.

{
    "accounts": [
   	 {
   		 "trader_key": "0389f9aad3e08ae5065985049428eb8d862455060b429e2ad42fda52830673e3c1",
   		 "outpoint": "76718c68111911e98100e88da62ccf4c0ba84569219f279b47cdfd4bcfb8b880:0",
   		 "value": 500000,
   		 "available_balance": 500000,
   		 "expiration_height": 787738,
   		 "state": "PENDING_OPEN",
   		 "latest_txid": "76718c68111911e98100e88da62ccf4c0ba84569219f279b47cdfd4bcfb8b880",
   		 "version": "ACCOUNT_VERSION_TAPROOT"
   	 }
    ]
}

Buy incoming liquidity

We can now buy an incoming channel through Pool. This gives us the opportunity to receive satoshis over the Lightning Network and can help us bootstrap a routing node.

To buy an incoming channel, we will submit a bid. We will have to specify the desired channel size (amount), our account key (as obtained above), and a rate we are willing to pay, in percent.

pool orders submit bid –amt 100000 –acct_key 0389f9aad3e08ae5065985049428eb8d862455060b429e2ad42fda52830673e3c1 --interest_rate_percent 2 --max_batch_fee_rate 7 --lease_duration_blocks 2016

Additionally, we may find it useful to define whether the channel should be announced to the network or not, for example if we are not interested in routing payments. The self-channel balance flag can be used to create balanced channels. This balance will have to come out of our pool account too.

--self_chan_balance --unannounced_channel

Add funds

We can add funds at any time using the command below. This gives us also the opportunity to extend the validity of our account.

pool accounts deposit –amt 100000 –trader_key 0389f9aad3e08ae5065985049428eb8d862455060b429e2ad42fda52830673e3c1 --sat_per_vbyte 7 --expiry_height 774774

Similarly, we can withdraw from our pool account whenever we need them.

pool accounts withdraw –amt 100000 –acct_key 0389f9aad3e08ae5065985049428eb8d862455060b429e2ad42fda52830673e3c1 --addr bc1qlrz7ehzn4fad3hhdzku6ucauzks8d0sa2ksmtl

Close an account

We can close our pool account at any time with the command below. If we do not specify an address, the funds are returned to our internal LND wallet.

pool accounts close –trader_key 0389f9aad3e08ae5065985049428eb8d862455060b429e2ad42fda52830673e3c1 --sat_per_vbyte 7

follow this link