From 592b7e0ce38b4ba365414f96fb792856531359af Mon Sep 17 00:00:00 2001 From: Sam Germain Date: Thu, 11 Nov 2021 17:49:32 -0600 Subject: [PATCH] All test_update_funding_fees tests pass --- freqtrade/freqtradebot.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/freqtrade/freqtradebot.py b/freqtrade/freqtradebot.py index defc02a6c..335ae6052 100644 --- a/freqtrade/freqtradebot.py +++ b/freqtrade/freqtradebot.py @@ -276,6 +276,8 @@ class FreqtradeBot(LoggingMixin): trade.open_date ) trade.funding_fees = funding_fees + else: + return 0.0 def startup_update_open_orders(self): """ @@ -705,10 +707,7 @@ class FreqtradeBot(LoggingMixin): # Fee is applied twice because we make a LIMIT_BUY and LIMIT_SELL fee = self.exchange.get_fee(symbol=pair, taker_or_maker='maker') open_date = datetime.now(timezone.utc) - if self.trading_mode == TradingMode.FUTURES: - funding_fees = self.exchange.get_funding_fees(pair, amount, open_date) - else: - funding_fees = 0.0 + funding_fees = self.exchange.get_funding_fees(pair, amount, open_date) trade = Trade( pair=pair, @@ -1263,6 +1262,7 @@ class FreqtradeBot(LoggingMixin): :param sell_reason: Reason the sell was triggered :return: True if it succeeds (supported) False (not supported) """ + trade.funding_fees = self.exchange.get_funding_fees(trade.pair, trade.amount, trade.open_date) exit_type = 'sell' # TODO-lev: Update to exit if sell_reason.sell_type in (SellType.STOP_LOSS, SellType.TRAILING_STOP_LOSS): exit_type = 'stoploss'