Author

Topic: How to use dynamic fee through Electrum console [SOLVED] (Read 253 times)

sr. member
Activity: 501
Merit: 283
[КУПЛЮ] bitcoin
As I understand dynamic fee should be calculated by already formed tx, i.e. how many inputs, outputs, so from here we can find the size of tx that can be used for fee calculating.

You are right with the fee (in satoshis) being set depending on the inputs and outputs.

But since the amount of inputs and outputs do have an direct influence on the size and the number you get when calling getfeerate is a feerate (sat / KB; depending on the size), it is perfectly fine to do it this way.

So, following Abdussamad's advice is the correct way to get the fee rate. You'll simply have to set this feerate in your transaction.
Since the unit is sat/ KB, the actual total fee (satoshi) will be calculated when creating the transaction (based on the transaction size).
Ah, finally I got it! The problem was in wrong understanding of getfeerate return. So we just leave fee=none in payto method but getfeerate already have rate (5989 kb for 0.5 lvl), so now tx have right fee, calculated based on size and rate. Thank you bob123 and Abdussamad!
legendary
Activity: 1624
Merit: 2481
As I understand dynamic fee should be calculated by already formed tx, i.e. how many inputs, outputs, so from here we can find the size of tx that can be used for fee calculating.

You are right with the fee (in satoshis) being set depending on the inputs and outputs.

But since the amount of inputs and outputs do have an direct influence on the size and the number you get when calling getfeerate is a feerate (sat / KB; depending on the size), it is perfectly fine to do it this way.

So, following Abdussamad's advice is the correct way to get the fee rate. You'll simply have to set this feerate in your transaction.
Since the unit is sat/ KB, the actual total fee (satoshi) will be calculated when creating the transaction (based on the transaction size).
legendary
Activity: 3710
Merit: 1586
electrum getfeerate --fee_method eta
sr. member
Activity: 501
Merit: 283
[КУПЛЮ] bitcoin
Ok, another question - how to simulate the same ETA fees as desktop app does?
legendary
Activity: 3710
Merit: 1586
It tells you the fee per kb in satoshis. You then find out the size of your transaction and set a fee accordingly.

If you do `electrum help getfeerate` it displays some useful info: http://termbin.com/7d62

You can also see the code here: https://github.com/spesmilo/electrum/blob/3.2.3/electrum/commands.py#L660

The options for fee method are eta, mempool or static. Not sure how the static fee is set.

Another thing I found is that if you set the fee estimation option under tools > preferences > fees tab to mempool you don't have to supply a fee when using `electrum payto`. Just the destination address and amount are sufficient. It sets a suitable dynamic fee itself.
sr. member
Activity: 501
Merit: 283
[КУПЛЮ] bitcoin
Hi everyone, I trying to understand how to spend btc with electrum's dynamic ETA fee, using tx generation in console. I confused by few things.
As I understand dynamic fee should be calculated by already formed tx, i.e. how many inputs, outputs, so from here we can find the size of tx that can be used for fee calculating.
I create signed tx, where I should set fee. From now I want to set middle comission for tx so I using next code:
Code:
electrum getfeerate —lvl 0.5
But what fee is calculated here? I tried to compare received data of middle commsion with fee in desktop app, and they are different even with 1 in and 1 out.
So the question is - what the right way to set dynamic ETA fee for transaction and how getfeerate actually works.
Thanks.
Jump to: