mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-12-17 13:21:15 +00:00
feat: Updates for proxy coin functionalities
This commit is contained in:
@@ -682,9 +682,10 @@ class RPC:
|
|||||||
) -> tuple[float, float]:
|
) -> tuple[float, float]:
|
||||||
est_stake = 0.0
|
est_stake = 0.0
|
||||||
est_bot_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
|
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
|
# in Futures, "total" includes the locked stake, and therefore all positions
|
||||||
est_stake = balance.free
|
est_stake = balance.free
|
||||||
est_bot_stake = amount
|
est_bot_stake = amount
|
||||||
@@ -694,7 +695,7 @@ class RPC:
|
|||||||
coin, stake_currency
|
coin, stake_currency
|
||||||
)
|
)
|
||||||
if rate:
|
if rate:
|
||||||
est_stake = rate * balance.total
|
est_stake = rate * (balance.free if is_futures else balance.total)
|
||||||
est_bot_stake = rate * amount
|
est_bot_stake = rate * amount
|
||||||
|
|
||||||
return est_stake, est_bot_stake
|
return est_stake, est_bot_stake
|
||||||
@@ -727,9 +728,10 @@ class RPC:
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
trade = open_assets.get(coin, None)
|
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
|
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()
|
trade_amount = self._freqtrade.wallets.get_available_stake_amount()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -41,7 +41,8 @@ class Wallets:
|
|||||||
self._wallets: dict[str, Wallet] = {}
|
self._wallets: dict[str, Wallet] = {}
|
||||||
self._positions: dict[str, PositionWallet] = {}
|
self._positions: dict[str, PositionWallet] = {}
|
||||||
self._start_cap: dict[str, float] = {}
|
self._start_cap: dict[str, float] = {}
|
||||||
self._stake_currency = config["stake_currency"]
|
|
||||||
|
self._stake_currency = self._exchange.get_proxy_coin()
|
||||||
|
|
||||||
if isinstance(_start_cap := config["dry_run_wallet"], float | int):
|
if isinstance(_start_cap := config["dry_run_wallet"], float | int):
|
||||||
self._start_cap[self._stake_currency] = _start_cap
|
self._start_cap[self._stake_currency] = _start_cap
|
||||||
|
|||||||
Reference in New Issue
Block a user