feat: Updates for proxy coin functionalities

This commit is contained in:
Matthias
2024-12-17 06:48:47 +01:00
parent 0b9cca27e2
commit 478387531d
2 changed files with 9 additions and 6 deletions

View File

@@ -682,9 +682,10 @@ class RPC:
) -> tuple[float, float]:
est_stake = 0.0
est_bot_stake = 0.0
if coin == stake_currency:
is_futures = self._config.get("trading_mode", TradingMode.SPOT) == TradingMode.FUTURES
if coin == self._freqtrade.exchange.get_proxy_coin():
est_stake = balance.total
if self._config.get("trading_mode", TradingMode.SPOT) != TradingMode.SPOT:
if is_futures:
# in Futures, "total" includes the locked stake, and therefore all positions
est_stake = balance.free
est_bot_stake = amount
@@ -694,7 +695,7 @@ class RPC:
coin, stake_currency
)
if rate:
est_stake = rate * balance.total
est_stake = rate * (balance.free if is_futures else balance.total)
est_bot_stake = rate * amount
return est_stake, est_bot_stake
@@ -727,9 +728,10 @@ class RPC:
continue
trade = open_assets.get(coin, None)
is_bot_managed = coin == stake_currency or trade is not None
is_stake_currency = coin == self._freqtrade.exchange.get_proxy_coin()
is_bot_managed = is_stake_currency or trade is not None
trade_amount = trade.amount if trade else 0
if coin == stake_currency:
if is_stake_currency:
trade_amount = self._freqtrade.wallets.get_available_stake_amount()
try: