-
Notifications
You must be signed in to change notification settings - Fork 11
units: add consolidate_feerate as cli arg #77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
rustaceanrob
merged 1 commit into
kernel-node:master
from
yancyribbens:0701-add-long-term-fee-rate
Jul 18, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still lost as to what this value is for. Can we explain how this interacts with the
fee_rate_sat_per_vbhere? I think that is what most users would care aboutThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To add a little more to the docs comment, the consolidation fee (also known as long_term_fee_rate) helps to determine if the current fee_rate is high or low. So, if fee_rate > consolidation_fee_rate, then the current fee_rate is high based on historical trends, and if consolidation_fee_rate > fee_rate then the current fee_rate level is considered cheap. The reason this matters is that BnB will select more inputs to build a transaction when fees are cheap to consolidate the utxo set. Likewise, if the current environment is a low fee_rate environment, BnB will try to find a solution with the least number of UTXOs possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is why hard_coding the long_term_fee_rate to 1.0 is bad, because it will direct the selection algorithms to think that we are always in a high fee environment, since it's fairly likely that fee_rate is greater than 1 sat/vB.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, by adding this as a parameter, its possible you could do a curl or wget request from some external API to find this value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok much clearer now. Would you be able to condense that a bit and add that logic in the doc comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, done, with the caveat that this is how the bitcoin core selection works, as well as rust bitcoin coin-selection. However, I'm reasonably sure that's how bdk coin-select works as well. Although, as stated before, I'm not really as well versed on that project.