diff --git a/freqtrade/freqtradebot.py b/freqtrade/freqtradebot.py index e3f2616a2..4db5f08b1 100644 --- a/freqtrade/freqtradebot.py +++ b/freqtrade/freqtradebot.py @@ -903,8 +903,8 @@ class FreqtradeBot: :raise: DependencyException: if available balance is not within 2% of the available amount. """ wallet_amount = self.wallets.get_free(pair.split('/')[0]) - logger.debug(f"{pair} - Wallet: {wallet_amount} - Trade-amount: {amount}") - if wallet_amount > amount: + logger.info(f"Selling {pair} - Wallet: {wallet_amount} - Trade-amount: {amount}") + if wallet_amount >= amount: return amount elif wallet_amount > amount * 0.98: logger.info(f"{pair} - Falling back to wallet-amount.") diff --git a/tests/test_freqtradebot.py b/tests/test_freqtradebot.py index 58f88198a..eedf79553 100644 --- a/tests/test_freqtradebot.py +++ b/tests/test_freqtradebot.py @@ -2764,6 +2764,9 @@ def test__safe_sell_amount(default_conf, fee, caplog, mocker): assert freqtrade._safe_sell_amount(trade.pair, trade.amount) == amount_wallet assert log_has_re(r'.*Falling back to wallet-amount.', caplog) + caplog.clear() + assert freqtrade._safe_sell_amount(trade.pair, amount_wallet) == amount_wallet + assert not log_has_re(r'.*Falling back to wallet-amount.', caplog) def test__safe_sell_amount_error(default_conf, fee, caplog, mocker):