# 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:** 4

<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:12am UTC](https://delvingbitcoin.org/t/liquidity-provider-utxo-management/600/4 "2024-03-20T09:12:04Z")

</div>

> [@murch](#):
>
> > [@remyers](#):
> >
> > When fee rates are low, or a bucket is extremely depleted, we should proactively create change outputs to refill buckets. Initially I propose adding the largest utxo that is not in a bucket as an additional input to the transaction.
> 
> I’m confused here by the phrasing of an _additional_ input? If the feerate is higher and you still need to refill, why not just pick a single large non-bucketed UTXO and create a several change outputs for the bucket you want to refill? If the feerate is low enough that you are proactively refilling buckets, why not sum up the amounts of several or all of the UTXOs you want to create and create all of those UTXOs alongside the liquidity transaction output by picking as many of the large non-bucketed UTXOs as necessary to create them?

By _additional_ input I do just mean I select a large non-bucketed UTXO as an input - just as you suggest.

### Improvement 1

When the current feerate is low and buckets are depleted, that is a good suggestion to target the spend for what we need to refill our buckets . I’ll add code to select only the non-bucketed UTXOs as inputs and also avoid trying to refill more buckets than we have available to spend from non-bucketed UTXOs. I’ll add it to my list of improvements to try.

---

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