A serverless function project for testing the fee.url option in LND.
The functions are deployed on Vercel: https://test-lnd-fee-url.vercel.app.
-
/api/mempool-fees: Mapping fee rates from mempool API:fee_by_block_target[3]:fastestFeefee_by_block_target[6]:halfHourFeefee_by_block_target[8]:hourFeefee_by_block_target[10]:economyFeemin_relay_feerate:minimumFee
-
/api/mempool-hill-fees: Mapping fee rates from mempool API, it aims to lower the commit_fee as low as possible, regardless of the actual mempool fee rates, when force-close happens, the participant can bump the transaction with a CPFP transaction:fee_by_block_target[3]:1012fee_by_block_target[4]:fastestFeefee_by_block_target[6]:halfHourFeefee_by_block_target[8]:hourFeefee_by_block_target[10]:economyFeemin_relay_feerate:1012
-
/api/mempool-min-fees: Mapping only theminimalFeefrom mempool API, it aims to give the commitment transaction a minimal chance to be pushed in the mempool:fee_by_block_target[3]:minimumFeemin_relay_feerate:minimumFee
-
/api/mempool-min-hill-fees: Mapping fee rates from mempool API, it aims to provide a balance that the commit fee is not too low by using theeconomyFeeas the commit fee rate, allowing force-close transactions to be stayed in the mempool without being purged immediately:fee_by_block_target[3]:economyFeefee_by_block_target[4]:fastestFeefee_by_block_target[6]:halfHourFeefee_by_block_target[8]:hourFeefee_by_block_target[10]:economyFeemin_relay_feerate:minimumFee
-
/api/mempool-custom-hill-fees: Mapping fee rates from mempool API, it works exactly like themempool-min-hill-feesby default, but you can passmaxCommitFeeRateto the querystring to limit the maximum commit fee rate:fee_by_block_target[3]:min(economyFee, query.maxCommitFeeRate)fee_by_block_target[4]:fastestFeefee_by_block_target[6]:halfHourFeefee_by_block_target[8]:hourFeefee_by_block_target[10]:economyFeemin_relay_feerate:min(minimumFee, query.maxCommitFeeRate)
-
/api/static-min-fees: All fee rates are fixed to1012:fee_by_block_target[3]:1012min_relay_feerate:1012
To apply the fee.url option in LND, you can edit your lnd.conf file and add the following line, then restart your LND node, the option should be applied in a random timeout:
fee.url=https://test-lnd-fee-url.vercel.app/api/mempool-fees
The project is open-source, and you can self-host it as serverless functions.
Or you can clone the project and deploy it on Vercel.