From 4b27bd9838fc803b93e6e1695687ce9338c818fa Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 19 Feb 2022 11:06:47 +0100 Subject: [PATCH] don't fetch free balance if we don't use it --- freqtrade/freqtradebot.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/freqtrade/freqtradebot.py b/freqtrade/freqtradebot.py index fd7203882..abd38859b 100644 --- a/freqtrade/freqtradebot.py +++ b/freqtrade/freqtradebot.py @@ -1335,10 +1335,13 @@ class FreqtradeBot(LoggingMixin): """ # Update wallets to ensure amounts tied up in a stoploss is now free! self.wallets.update() + if self.trading_mode == TradingMode.FUTURES: + return amount + trade_base_currency = self.exchange.get_pair_base_currency(pair) wallet_amount = self.wallets.get_free(trade_base_currency) logger.debug(f"{pair} - Wallet: {wallet_amount} - Trade-amount: {amount}") - if wallet_amount >= amount or self.trading_mode == TradingMode.FUTURES: + if wallet_amount >= amount: # A safe exit amount isn't needed for futures, you can just exit/close the position return amount elif wallet_amount > amount * 0.98: