Add "high fee rate" blocker to fees from trades

part of #5415 (potentially fixing this)
This commit is contained in:
Matthias 2021-08-22 14:37:45 +02:00
parent 34456b9798
commit 56759cea7b

View File

@ -1381,6 +1381,8 @@ class FreqtradeBot(LoggingMixin):
if fee_currency:
# fee_rate should use mean
fee_rate = sum(fee_rate_array) / float(len(fee_rate_array)) if fee_rate_array else None
if fee_rate is not None and fee_rate < 0.02:
# Only update if fee-rate is < 2%
trade.update_fee(fee_cost, fee_currency, fee_rate, order.get('side', ''))
if not isclose(amount, order_amount, abs_tol=constants.MATH_CLOSE_PREC):