# Setting Up Liquidity Ads in c-lightning

Source URL: https://blog.blockstream.com/setting-up-liquidity-ads-in-c-lightning
Updated: 2026-11-19T20:10:40.000Z
Author: Blockstream Team
Published: Aug 12, 2021
Category: Lightning Network

---

_by Lisa Neigut_

The v0.10.0 version of c-lightning introduced the [dual-funding protocol](https://medium.com/blockstream/c-lightning-opens-first-dual-funded-mainnet-lightning-channel-ada6b32a527c), which allows either channel peer to put funds into the channel funding transaction. This is a great addition to the Lightning protocol, as it cuts down on the number of on-chain transactions required to deploy capital into Lightning contracts.

However, dual-funding introduces a coordination problem. This is because it’s impossible to know if a peer will put funds into a channel with you unless you ask them. You can explicitly signal that your node is setup to automatically dual-fund a channel, like [this tweet](https://twitter.com/niftynei/status/1389328732377255938) I put out. But, that requires node operators to agree to use the same centralized communication network.

## Solving the Dual-Funding Coordination Problem

Liquidity ads solve the coordination problem by allowing your node to advertise its willingness to contribute funds to a channel open request from a peer directly over the Lightning gossip network. This means that every node on the Lightning Network can broadcast their intention to contribute funds to a channel, as well as see all the nodes that are currently offering up liquidity directly, without any added services or software.

With c-lightning, you can see these advertisements via the node information returned in `listnodes` .

Here’s the node listing for my node, `02cca6c5966fcf61d121e3a70e03a1cd9eeeea024b2626ea666ce974d43b242e636` , which is currently advertising that it will lease you funds.

![](https://storage.googleapis.com/dxp-staging-assets/blog/body/setting-up-liquidity-ads-in-c-lightning/image-3.png)

Note: You can filter for nodes that are just advertising liquidity with the following `grep` addition:

![](https://storage.googleapis.com/dxp-staging-assets/blog/body/setting-up-liquidity-ads-in-c-lightning/image-4.png)

Let’s walk through the information that this liquidity ad is displaying, show how to setup your node (running c-lightning v0.10.1 or later) to advertise this information, and finally walk through leasing some liquidity from a peer that’s advertising it.

## Dissecting a Liquidity Ad

The node entry for a liquidity ad shows six fields.

![](https://storage.googleapis.com/dxp-staging-assets/blog/body/setting-up-liquidity-ads-in-c-lightning/image-5.png)

- `lease_fee_base_msat` : This is the base fee that my node will charge for a liquidity lease; in this example it’s set to 1k sats.
- `lease_fee_basis` : This is the basis points that my node will charge for a liquidity lease. It’s calculated as “sats you’d like to lease” \* “lease\_fee\_basis” \* 1 / 10,000\. For example, if you’d like to lease 1M sats, I’m going to charge you 1M \* 10 / 10k, or 1k sats. This plus the `lease_base_fee_msat` is the total amount you’ll be compensated for the funds lease.
- `funding_weight` : This is the weight that I’ll expect your node to pay for in the opening transaction. The opener picks the feerate that the funding transaction uses, so the total satoshi charge for this `funding_weight` will be calculated using the rate the opener chooses. For example, if the opener uses a 50 sat/vbyte rate, then they’ll need to pay my node 666 / 4 \* 50, or 8,325 sats, to cover my cost of contributing inputs to the funding transaction. In c-lightning, this value defaults to the expected weight of 2 P2WPKH inputs and a P2WPKH output.
- `channel_fee_max_base_msat` \+ `chanel_fee_max_proportional_thousandths` : These are promises. Specifically, the leasing node promises not to charge users rates greater than these values when routing payments through the leased channel. In effect, these fields are a cap on the routing fees the leasing node will collect on the leased funds. Note that ‘thousandths’ is quite large — it’s a 1,000 times larger than the typical ‘ppm’ number that fee rates are expressed in. In this example, my node is currently advertising that the max `fee_per_millionth` it will charge is 100,000\. This is really high (10%)! (A value of `1` for the `channel_fee_max_proportional_thousandths` is equal to `1,000ppm` ).
- `compact_lease` : This is a compact representation of the above five fields. It’s used for signaling the rates you expect when you call `fundchannel` to take advantage of a lease, so make note of it.

Given the current settings, a channel lease of 1M sats opened at a feerate of 50 sats/vbyte would cost an opening peer a total of 10,325 sats. (1k sats for the base fee, 1k sats for the basis fee, and 8,325 for the on-chain fees for the funding transaction).

## Setting up Your c-lightning Node to Advertise Liquidity

The v0.10.1 release of `c-lightning` introduces a new plugin, `funder` . `Funder` gives you some knobs for setting up a policy for fudning incoming channel requests, as well as a way to set the rates that you want to charge for liquidity. It allos you to both contribute funds to v2 opens **without** advertising liquidity as well as charging for the liquidity that you provide.

By default, it only hands out liquidity to opens that offer to pay for a lease.

Also, note that you’ll need to enable `--experimental-dual-fund` to be able to actually fund any advertisement that you offer.

You can see the current settings of `funder` using the `funderupdate` command. Here’s what my node is currently set to.

![](https://storage.googleapis.com/dxp-staging-assets/blog/body/setting-up-liquidity-ads-in-c-lightning/image-6.png)

Note that you won’t see the `lease` parameters until you set at least one of them.

### Funder Policy

For funding liquidity offers, you’re most likely going to want to set your policy and the accompanying `modifier` to `match (100%)`. This will provide as much liquidity as the peer requests, no more no less. You’ll also want to turn off the fuzzing, as `c-lightning` clients who are requesting liquidity currently fail the open if the node offering the liquidity doesn’t match or exceed the requested funding amount.

Here’s how you’d set these parameters using the `funderupdate` command.

![](https://storage.googleapis.com/dxp-staging-assets/blog/body/setting-up-liquidity-ads-in-c-lightning/image-7.png)

### Setting Up Your Liquidity Ad

OK, our policy is set to `match (100%)`. Let’s go ahead and add a liquidity ad that will be broadcast to the network.

I’m going to set the fees for the lease, the rest of the parameters will be the default.

![](https://storage.googleapis.com/dxp-staging-assets/blog/body/setting-up-liquidity-ads-in-c-lightning/image-8.png)

Those channel\_fee parameters look a bit high to me (5000sats base, 100,000ppm), so I’ll adjust them downwards to 100sat base and 2000ppm.

![](https://storage.googleapis.com/dxp-staging-assets/blog/body/setting-up-liquidity-ads-in-c-lightning/image-9.png)

If you want to check what you’re currently advertising, run `listnodes <your_node_id>`. It might take a few minutes for any recent changes to be reflected here, as we rate limit how frequently node\_announcements can be updated. (Since I updated it twice in a row, it took a moment for the second set of changes to appear.)

### Configs

To make these settings persist across a restart, you’ll need to set them in your lightning configs. You can do this by adding the following lines to your config file.

![](https://storage.googleapis.com/dxp-staging-assets/blog/body/setting-up-liquidity-ads-in-c-lightning/image-10.png)

## Leasing Funds

Now that you’ve got a channel lease set up, it’s a matter of waiting for a peer to take you up on the offer. You might check that your on-chain funds balance is large enough to accept any incoming requests, with `listfunds`. The funds in `outputs` will be what’s used to fund the requests.

Let’s try being the other side of the trade now, and request to lease funds from a node that’s advertising liquidity.

Here’s how you’d request a 1M sat channel from my node on mainnet. Note that we’re also putting in 1M sats, which means this channel will be balanced to start (provided the open happens without issue).

![](https://storage.googleapis.com/dxp-staging-assets/blog/body/setting-up-liquidity-ads-in-c-lightning/image-11.png)

Note that you’ll need to connect to my node before you can open a channel, which you can accomplish with the following:

![](https://storage.googleapis.com/dxp-staging-assets/blog/body/setting-up-liquidity-ads-in-c-lightning/image-12.png)

And that should be it!

A few caveats. If the lease terms have changed, the open should fail. You’ll need to get the latest `compact_lease` from `listnodes` before trying again. If the peer doesn’t have enough capital available, or if your request doesn’t pass the parameters they’ve set for peers (see the other options available on `funderupdate`), then your open request will fail.

Please note that as with all \` `experimental`\` features, leases are to be considered a `#reckless`.

## Want to learn more?

If you’d like to take a look at the draft spec proposal, it can be found on [Github](https://github.com/lightningnetwork/lightning-rfc/pull/878). Be sure to check out the `[c-lightning](https://github.com/elementsproject/lightning)`[ Github repo](https://github.com/elementsproject/lightning) if you’re interested in contributing! You can also chat with us on Libera IRC in #c-lightning and in the [c-lightning Telegram group](http://t.me/lightningd).

_Note: This blog was originally posted at <https://medium.com/p/54e4c59c091d>_

## Blog Categories

- [All Posts](https://blog.blockstream.com/)
- [Blockstream Finance](https://blog.blockstream.com/blockstream-finance)
- [Company](https://blog.blockstream.com/company)
- [Lightning Network](https://blog.blockstream.com/lightning-network)
- [Blockstream Mining](https://blog.blockstream.com/blockstream-mining)
- [Blockstream Explorer](https://blog.blockstream.com/blockstream-explorer)
- [Blockstream Satellite](https://blog.blockstream.com/blockstream-satellite)
- [Liquid Network](https://blog.blockstream.com/liquid-network)
- [Blockstream Jade](https://blog.blockstream.com/blockstream-jade)
- [Blockstream AMP](https://blog.blockstream.com/blockstream-amp)
- [Blockstream App](https://blog.blockstream.com/blockstream-app)
- [Blockstream Research](https://blog.blockstream.com/blockstream-research)
- [Cryptocurrency Data Feed](https://blog.blockstream.com/cryptocurrency-data-feed)
- [Elements](https://blog.blockstream.com/elements)
- [Layer-2 Roundup](https://blog.blockstream.com/layer-2-roundup)
- [Quarterly Report](https://blog.blockstream.com/quarterly-report)
- [Layer-2 Report](https://blog.blockstream.com/layer-2-report)
- [Simplicity Language](https://blog.blockstream.com/simplicity-language)
- [Quarterly Update](https://blog.blockstream.com/quarterly-update)
- [Quantum](https://blog.blockstream.com/quantum)
- [Enterprise](https://blog.blockstream.com/enterprise)
- [Insights](https://blog.blockstream.com/insights)
- [Simplicity](https://blog.blockstream.com/simplicity)
- [Developer](https://blog.blockstream.com/developer)
- [Security](https://blog.blockstream.com/security)
- [Jade](https://blog.blockstream.com/jade)
- [Liquid](https://blog.blockstream.com/liquid)
- [Lightning](https://blog.blockstream.com/lightning)
- [Research](https://blog.blockstream.com/research)
- [Core Lightning](https://blog.blockstream.com/core-lightning)
