# LND's Deadline-Aware Budget Sweeper

**URL:** <https://delvingbitcoin.org/t/lnds-deadline-aware-budget-sweeper/1512>\
**Category:** Implementation\
**Tags:** lightning\
**Created:** [March 11, 2025, 4:33pm UTC](https://delvingbitcoin.org/t/lnds-deadline-aware-budget-sweeper/1512 "2025-03-11T16:33:45Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![morehouse](https://delvingbitcoin.org/letter_avatar_proxy/v4/letter/m/df705f/32.png) [@morehouse](https://delvingbitcoin.org/u/morehouse)\
**Post date:** [March 13, 2025, 3:31pm UTC](https://delvingbitcoin.org/t/lnds-deadline-aware-budget-sweeper/1512/4 "2025-03-13T15:31:06Z")

</div>

> [@ismaelsadeeq](#):
>
> Calling `estimateSmartFee` with `n`, and expecting it to confirm ASAP is not not ideal, and would likely not confirm ASAP. Instead, they should call `estimateSmartFee` with a `conf_target` of `1`. If the transaction does not confirm within the next 1–2 blocks, they can then call the fee function to determine the fee rate they are willing to pay at that target based on the available budget (curve).

Generally LN nodes want the transaction to confirm within `n` blocks but they don’t want to pay more fees than necessary. Confirming ASAP is generally not needed, unless deadlines are getting close.

But I think you make a good point that there is probably a mismatch here between the fee estimator’s intended use and what LN nodes do. If the estimator says a certain fee rate should get the transaction confirmed within `n` blocks and then confirmation takes `n+1` blocks, that’s probably not considered a big deal from the estimator’s point of view. But for LN nodes there’s a huge (and expensive) difference.

Presumably this is why eclair switches to exponential bumping once the deadline gets close, and why LDK uses exponential bumping whenever the estimator does not return an increased fee rate.

> [@ismaelsadeeq](#):
>
> See the API proposal for Bitcoin Core’s improved fee estimator response, which provides the state of the mempool in the past with respect to miner’s mempool. This information could help clients make more informed decisions: [Fee Estimation via Fee rate Forecasters tracking issue · Issue #30392 · bitcoin/bitcoin · GitHub](https://github.com/bitcoin/bitcoin/issues/30392#issuecomment-2717491587)

Improving Bitcoin Core’s estimator is great and should decrease the number of LN node operators that rely on third-party estimators such as mempool.space or Blockstream.

But fundamentally, estimators are still estimators and cannot guarantee that transactions confirm before deadlines, especially when directed attacks are in play (pinning, censorship, etc.). In such situations a naive budget-based fee bumping strategy is much more reliable.

---

_[View the full topic](https://delvingbitcoin.org/t/lnds-deadline-aware-budget-sweeper/1512)._
