joinmarket-clientserver icon indicating copy to clipboard operation
joinmarket-clientserver copied to clipboard

Transaction fee for sweep: xxxxx too far from expected: xxxx check the setting 'max_sweep_fee_change' in joinmarket.cfg. Aborting this attempt.

Open fossil opened this issue 2 years ago • 1 comments

Hi,

I cannot execute the sweep due to getting the following message: "Transaction fee for sweep: 14xxx too far from expected: 4xxx; check the setting 'max_sweep_fee_change' in joinmarket.cfg. Aborting this attempt." The same time this fee is pretty good. If I do transfer without sweep just like transfer with small change-out, it works fine. BUT I want to do exactly the sweep without leaving this rest on JM wallet. What can I do to make it running? Which value of max_sweep_fee_change value will be good in this case, if the estimated fee is 3 times lower, than the actual fee?

Take care

fossil avatar Sep 14 '22 10:09 fossil

Sorry this was not answered yet.

If you want to understand why this issue occurs with sweeps specifically, I suggest reading this comment: https://github.com/JoinMarket-Org/joinmarket-clientserver/issues/784#issuecomment-761057922

It's a little unintuitive, but there is a concrete reason why this happens. The max_sweep_fee_change variable is to stop you getting hit with a shockingly high fee that you didn't expect (as you probably know).

Here is the section of the config that talks about that setting:

https://github.com/JoinMarket-Org/joinmarket-clientserver/blob/84a605c05e81b63bc031dd3aabdfda09f825a39e/jmclient/jmclient/configure.py#L298-L312

So in a concrete case where the requested fee rate was 4000 sats/kvB, if the feerate ends up being 14000 sats/kvB, then it is not 1.8 x higher (that would be 7200 sats/kvB), but 3.5 times higher. If you're OK with that, you can set max_sweep_fee_change to 4.0 or something like that.

Your gut reaction might be "damn, I don't want to pay so much in fees like 3.5x what I expected" - but, it's confusing - what's actually happening here is you chose a fee upfront (see above comment - the code guessed the total fee needed based on about 3 input utxos per Maker), and then it turned out that the coinjoin Makers needed less transaction space than you expected for that fixed fee, meaning the fee rate was a lot higher than expected. So it's like: fixed, normal coinjoin fee, but less tx inputs, so high fee rate.

Honestly for myself I feel like the 0.8 default was a bit too small. 2.0 might be better but it's up to you. If it still fails at 2.0 or 3.0 you can try again, but you can also always fall back on non-coinjoin sweeps (they have no way of similarly going wrong).

AdamISZ avatar Oct 08 '22 15:10 AdamISZ