Update stake-currency behavior

This commit is contained in:
Matthias 2023-04-22 17:42:09 +02:00
parent 741834301f
commit 94a6bc608c
3 changed files with 5 additions and 1 deletions

View File

@ -633,6 +633,8 @@ class RPC:
trade = open_assets.get(coin, None)
is_bot_managed = coin == stake_currency or trade is not None
trade_amount = trade.amount if trade else 0
if coin == stake_currency:
trade_amount = self._freqtrade.wallets.get_available_stake_amount()
try:
est_stake, est_stake_bot = self.__balance_get_est_stake(

View File

@ -546,7 +546,7 @@ def test_rpc_balance_handle(default_conf, mocker, tickers):
'free': 10.0,
'balance': 12.0,
'used': 2.0,
'bot_owned': 0,
'bot_owned': 9.9, # available stake - reducing by reserved amount
'est_stake': 10.0, # In futures mode, "free" is used here.
'est_stake_bot': 10,
'stake': 'BTC',

View File

@ -480,7 +480,9 @@ def test_api_balance(botclient, mocker, rpc_balance, tickers):
'free': 12.0,
'balance': 12.0,
'used': 0.0,
'bot_owned': pytest.approx(11.879999),
'est_stake': 12.0,
'est_stake_bot': 12.0,
'stake': 'BTC',
'is_position': False,
'leverage': 1.0,