chore: simplify dry-run wallet update

This commit is contained in:
Matthias
2024-12-08 14:34:00 +01:00
parent 142ea68dce
commit d0223e6f48

View File

@@ -130,18 +130,12 @@ class Wallets:
) )
total_stake = current_stake + used_stake total_stake = current_stake + used_stake
else: else:
tot_in_trades = 0
for position in open_trades: for position in open_trades:
# size = self._exchange._contracts_to_amount(position.pair, position['contracts'])
size = position.amount
collateral = position.stake_amount
leverage = position.leverage
tot_in_trades += collateral
_positions[position.pair] = PositionWallet( _positions[position.pair] = PositionWallet(
position.pair, position.pair,
position=size, position=position.amount,
leverage=leverage, leverage=position.leverage,
collateral=collateral, collateral=position.stake_amount,
side=position.trade_direction, side=position.trade_direction,
) )
current_stake = ( current_stake = (