Trade fee optimisation (make explicit refund fee) for swaps v1 #2124
Labels
improvement: swap
priority: medium
Moderately important tasks that should be completed but are not urgent.
For swaps MM2 maintains trade fee variable calculated both for the taker and maker. It indicates tx fee to spend on swap payment and refund transactions (see maker_payment_trade_fee and taker_payment_trade_fee vars).
The trade fee vars contain sum of both payment tx and refund tx fee. However it may not be always accurate.
Consider where trade fee is used:
Before PR #2051 swap trade fee always included refund fee.
In the PR #2051 the trade_preimage rpcs now return trade fee w/o the refund fee. But inside those rpcs check balance is called for which refund fee is needed. So it's better to have both payment and refund fee values separate.
Above is for swaps v1.
(For swaps v2, in currently implemented utxo case, trade fee var is used to check max balance for the swap. Actual tx fee is auto estimated in tx creation process, so no need to break trade fee into payment and refund tx fee.)
A related issue is #1848 with a more general task to reduce tx fees.
The text was updated successfully, but these errors were encountered: