spesmilo / electrumx

Alternative implementation of spesmilo/electrum-server
MIT License
436 stars 349 forks source link

Weird fee estimation #79

Closed Overtorment closed 3 years ago

Overtorment commented 3 years ago

Im constantly comparing result of estimatefee with https://mempool.space and electrumx always provides way higher values. And occasionally I use Electrum-desktop - I think I noticed if offers incorrect (too high) fee as well.

bitcoind ver: 0.20.1 electrumx ver: 1.15.0 (from this repo)

SomberNight commented 3 years ago

Do you mean the blockchain.estimatefee RPC? ElectrumX just forwards those calls to bitcoind estimatesmartfee ("conservative" mode)

SomberNight commented 3 years ago

If you want mempool based fee estimates, you should compute your own in the client, as Electrum does in mempool mode. The client can get a view of the mempool calling mempool.get_fee_histogram.

Overtorment commented 3 years ago

thanks! will dig in that direction

SomberNight commented 3 years ago

Note that blockchain.estimatefee can take an optional second parameter for the mode for bitcoind (so you can set it to economical), since https://github.com/kyuupichan/electrumx/pull/1001. It was not added to the protocol documentation in that PR and the protocol version was not bumped either, so you cannot be sure if the server supports it :/ I am making it part of protocol version 1.5 though (https://github.com/spesmilo/electrumx/pull/80).

benma commented 8 months ago

@SomberNight are there still plans to add a protocol version 1.5 that officially documents the 2nd argument of estimatefee()?

SomberNight commented 8 months ago

Yes. The protocol 1.5/2.0 (https://github.com/spesmilo/electrumx/pull/90) stuff is still on my TODO list, but realistically I don't know when I can get to it.