Merge pull request #483 from tecnovert/feerate

fix: raise default max fee rate from 2 to 4x estimated fee
This commit is contained in:
tecnovert
2026-05-31 10:59:58 +00:00
committed by GitHub
6 changed files with 27 additions and 15 deletions
+3 -2
View File
@@ -399,8 +399,9 @@ class XmrOffer(Table):
swap_id = Column("integer", primary_key=True, autoincrement=True) swap_id = Column("integer", primary_key=True, autoincrement=True)
offer_id = Column("blob") offer_id = Column("blob")
a_fee_rate = Column("integer") # Chain a fee rate # TODO: rename to from/to - values are not switched for reverse swaps
b_fee_rate = Column("integer") # Chain b fee rate a_fee_rate = Column("integer") # Chain from fee rate
b_fee_rate = Column("integer") # Chain to fee rate
# Delay before the chain a lock refund tx can be mined # Delay before the chain a lock refund tx can be mined
lock_time_1 = Column("integer") lock_time_1 = Column("integer")
+2 -2
View File
@@ -23,7 +23,7 @@ class FeeValidator:
def __init__(self, **kwargs): def __init__(self, **kwargs):
default_low_fee_conf_target: int = 24 default_low_fee_conf_target: int = 24
default_low_fee_rate: int = 0 default_low_fee_rate: int = 0
default_high_estimated_feerate_multiplier: float = 2.0 default_high_estimated_feerate_multiplier: float = 4.0
default_high_fee_rate: int = self.defaultMaxFeeRate() default_high_fee_rate: int = self.defaultMaxFeeRate()
if self._sc: if self._sc:
chain_client_settings = self._sc.getChainClientSettings( chain_client_settings = self._sc.getChainClientSettings(
@@ -82,7 +82,7 @@ class FeeValidator:
if self._high_estimated_feerate_multiplier >= 1.0: if self._high_estimated_feerate_multiplier >= 1.0:
max_feerate, max_feerate_src = self.get_fee_rate() max_feerate, max_feerate_src = self.get_fee_rate()
max_feerate = ( max_feerate = int(
self.make_int(max_feerate) * self._high_estimated_feerate_multiplier self.make_int(max_feerate) * self._high_estimated_feerate_multiplier
) )
else: else:
+1 -1
View File
@@ -863,5 +863,5 @@ class XMRInterface(CoinInterface):
self._log.error(f"listWalletTransactions failed: {e}") self._log.error(f"listWalletTransactions failed: {e}")
return [] return []
def validateFeeRate(self, fee_rate: int) -> bool: def validateFeeRate(self, fee_rate: int) -> None:
pass # Fee rate isn't used pass # Fee rate isn't used
+1 -1
View File
@@ -224,7 +224,7 @@
</tr> </tr>
<tr class="opacity-100 text-gray-500 dark:text-gray-100 hover:bg-coolGray-200 dark:hover:bg-gray-600"> <tr class="opacity-100 text-gray-500 dark:text-gray-100 hover:bg-coolGray-200 dark:hover:bg-gray-600">
<td class="py-3 px-6 bold">Chain A local fee rate</td> <td class="py-3 px-6 bold">Chain A local fee rate</td>
<td class="py-3 px-6">{{ data.a_fee_rate_verify }} (Fee source: {{ data.a_fee_rate_verify_src }}{% if data.a_fee_warn == true %} WARNING {% endif %})</td> <td class="py-3 px-6">{{ data.a_fee_rate_verify }} (Fee source: {{ data.a_fee_rate_verify_src }}{% if data.a_fee_warn == "high" %} WARNING - HIGH {% elif data.a_fee_warn == "low" %} WARNING - LOW {% elif data.a_fee_warn is defined %} WARNING {% endif %})</td>
</tr> </tr>
{% endif %} {% endif %}
</table> </table>
+14 -8
View File
@@ -768,24 +768,30 @@ def page_offer(self, url_split, post_string):
ci_leader = ci_to if reverse_bid else ci_from ci_leader = ci_to if reverse_bid else ci_from
if xmr_offer: if xmr_offer:
int_fee_rate_now, fee_source = ci_leader.get_fee_rate() a_fee_rate_now, fee_source = ci_leader.get_fee_rate()
a_fee_rate_now = ci_leader.make_int(a_fee_rate_now)
data["xmr_type"] = True chain_a_fee_rate: int = (
data["a_fee_rate"] = ci_leader.format_amount(xmr_offer.a_fee_rate) xmr_offer.b_fee_rate if reverse_bid else xmr_offer.a_fee_rate
data["a_fee_rate_verify"] = ci_leader.format_amount(
int_fee_rate_now, conv_int=True
) )
data["xmr_type"] = True
data["a_fee_rate"] = ci_leader.format_amount(chain_a_fee_rate)
data["a_fee_rate_verify"] = ci_leader.format_amount(a_fee_rate_now)
data["a_fee_rate_verify_src"] = fee_source data["a_fee_rate_verify_src"] = fee_source
data["a_fee_warn"] = xmr_offer.a_fee_rate < int_fee_rate_now
from_fee_rate = xmr_offer.b_fee_rate if reverse_bid else xmr_offer.a_fee_rate warning_threshold: float = 1.2
if chain_a_fee_rate * warning_threshold < a_fee_rate_now:
data["a_fee_warn"] = "low"
elif chain_a_fee_rate > a_fee_rate_now * warning_threshold:
data["a_fee_warn"] = "high"
lock_spend_tx_vsize = ( lock_spend_tx_vsize = (
ci_from.xmr_swap_b_lock_spend_tx_vsize() ci_from.xmr_swap_b_lock_spend_tx_vsize()
if reverse_bid if reverse_bid
else ci_from.xmr_swap_a_lock_spend_tx_vsize() else ci_from.xmr_swap_a_lock_spend_tx_vsize()
) )
lock_spend_tx_fee = ci_from.make_int( lock_spend_tx_fee = ci_from.make_int(
from_fee_rate * lock_spend_tx_vsize / 1000, r=1 chain_a_fee_rate * lock_spend_tx_vsize / 1000, r=1
) )
data["amt_from_lock_spend_tx_fee"] = ci_from.format_amount( data["amt_from_lock_spend_tx_fee"] = ci_from.format_amount(
lock_spend_tx_fee // ci_from.COIN() lock_spend_tx_fee // ci_from.COIN()
+6 -1
View File
@@ -5,7 +5,7 @@
- Prevent sending bids to offers - Prevent sending bids to offers
- Reject received offers, and - Reject received offers, and
- Prevent sending offers where the chain feerates are out of range. - Prevent sending offers where the chain feerates are out of range.
- Valid feerate range is the nodes estimated feerate for confirmation in 24 blocks to 2x the estimated feerate. - Valid feerate range is the node's estimated feerate for confirmation in 24 blocks to 4x the estimated feerate.
- The minimum feerate confirmation can be adjusted with the "low_fee_conf_target" setting. - The minimum feerate confirmation can be adjusted with the "low_fee_conf_target" setting.
- If "low_feerate" is set above 0 it is used instead of the dynamic feerate with "low_fee_conf_target" - If "low_feerate" is set above 0 it is used instead of the dynamic feerate with "low_fee_conf_target"
- The maximum feerate multiplier can be adjusted with the "high_estimated_feerate_multiplier" setting. - The maximum feerate multiplier can be adjusted with the "high_estimated_feerate_multiplier" setting.
@@ -13,6 +13,11 @@
- New setting "startup_delay" - New setting "startup_delay"
- Adjusts the time waited for coin daemons to start between "startup_tries". - Adjusts the time waited for coin daemons to start between "startup_tries".
- Valid as a base setting and can be overridden per coin with chainclients settings. - Valid as a base setting and can be overridden per coin with chainclients settings.
- UI:
- offer page:
- Fixed feerate from other chain displayed for reversed swaps
- Added warning text for fee above 1.2 x local estimate.
0.14.5 0.14.5