Skip to content

FeeRate calculation returns value inconsistent with mempool.space, making it hard to set the appropriate fee rate #96

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

Open
matthiasdebernardini opened this issue Jun 3, 2024 · 0 comments
Labels
new feature New feature or request

Comments

@matthiasdebernardini
Copy link

If you calculate fee rate using the wallet api, like in #100

you end up getting a value that is completely different from what you'd expect (assuming your expectations are set by mempool.space), that it seems like its incorrect.

In reality, its 100% correct but the difference stems from how weight and virtual bytes are calculated.

In any case, if you want your feerate to match what you see in mempool.space then you want the fee rate but actually the sats_per_vb_floor value.

like so,

            let fee_rate = wallet.calculate_fee_rate(tx).unwrap().to_sat_per_vb_floor();

My suggestion is to keep it as is, but amend the docs for calculate_fee_rate() and to_sat_per_vb_floor() so that devs can quickly implement that rather than use calculate_fee_rate and get thrown for a loop trying to figure out why it doesn't match what they see in mempool.space (if that is what they are expecting).

@matthiasdebernardini matthiasdebernardini added the new feature New feature or request label Jun 3, 2024
@matthiasdebernardini matthiasdebernardini changed the title FeeRate returns a value that is inconsistent with user expectations, amend docs to easily explain which one they should use FeeRate calculation returns value inconsistent with mempool.space, making it hard to set the appropriate fee rate Jun 3, 2024
@notmandatory notmandatory moved this to Discussion in BDK Wallet Jun 23, 2024
@notmandatory notmandatory transferred this issue from bitcoindevkit/bdk Apr 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature New feature or request
Projects
Status: Discussion
Development

No branches or pull requests

1 participant