Don't calculate funding fees if we're not going to use them.

This commit is contained in:
Matthias 2022-09-02 20:55:13 +02:00
parent df50b1928d
commit 0c6a02687a

View File

@ -726,10 +726,11 @@ class FreqtradeBot(LoggingMixin):
fee = self.exchange.get_fee(symbol=pair, taker_or_maker='maker')
base_currency = self.exchange.get_pair_base_currency(pair)
open_date = datetime.now(timezone.utc)
funding_fees = self.exchange.get_funding_fees(
pair=pair, amount=amount, is_short=is_short, open_date=open_date)
# This is a new trade
if trade is None:
funding_fees = self.exchange.get_funding_fees(
pair=pair, amount=amount, is_short=is_short, open_date=open_date)
trade = Trade(
pair=pair,
base_currency=base_currency,