You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
The text was updated successfully, but these errors were encountered:
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
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,
My suggestion is to keep it as is, but amend the docs for
calculate_fee_rate()
andto_sat_per_vb_floor()
so that devs can quickly implement that rather than usecalculate_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).The text was updated successfully, but these errors were encountered: