# Liquidity provider utxo management

**URL:** <https://delvingbitcoin.org/t/liquidity-provider-utxo-management/600>\
**Category:** Implementation\
**Tags:** coinselection, lightning\
**Created:** [February 22, 2024, 2:49pm UTC](https://delvingbitcoin.org/t/liquidity-provider-utxo-management/600 "2024-02-22T14:49:26Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![remyers](https://delvingbitcoin.org/user_avatar/delvingbitcoin.org/remyers/32/159_2.png) [@remyers](https://delvingbitcoin.org/u/remyers)\
**Post date:** [March 20, 2024, 9:43am UTC](https://delvingbitcoin.org/t/liquidity-provider-utxo-management/600/5 "2024-03-20T09:43:24Z")

</div>

> [@murch](#):
>
> Perhaps you could make a few attempts at trying to find a “changeless solution” to creating the liquidity transaction output plus one, two, or three amounts that your buckets are missing. You could perhaps generate a dozen or so different target amounts by combining various missing amounts and try to build transactions for each of them independently, and then use whatever gets a hit. I’m surprised that you consider using bucketed UTXOs for this—I expect that bucketed UTXOs would only be a fallback if you cannot fulfill the amount from non-bucketed UTXOs?

The reason I considered spending bucketed UTXOs is that I assumed that all of the wallet value would be in bucketed UTXOs except for a few original funding UTXOs larger than the largest bucket. But that mental model may not be correct because when channels are closed they create UTXOs with random amounts that may fall outside of our buckets.

### suggestion 2

I think what you’re suggesting here is that when we cannot create a change-less funding transaction we should try to target change that can exactly refill a set of depleted buckets without creating any additional change output.

In my simulations refilling always comes from the largest non-bucketed UTXO. These UTXOs can initially refill all depleted buckets, but eventually either generates a change output that is in a bucket or between buckets.

Outputs that are between buckets are similar to what can be created when we close channels. Perhaps these UTXOs can be consolidated when fees are low? See also **suggestion 1**.

---

_[View the full topic](https://delvingbitcoin.org/t/liquidity-provider-utxo-management/600)._
