fix: rate can be None in balance migration

This commit is contained in:
Matthias
2026-04-29 20:01:50 +02:00
parent 63819fa7e0
commit dd970f2be1
@@ -180,7 +180,7 @@ def _create_wallet_history_entries(
if is_futures: if is_futures:
collateral = row[pair_collateral_idx[pair]] collateral = row[pair_collateral_idx[pair]]
is_short = row[pair_is_short_idx[pair]] is_short = row[pair_is_short_idx[pair]]
if collateral is not None and not pd.isna(collateral): if collateral is not None and not pd.isna(collateral) and rate is not None:
# Same formula than in rpc's _rpc_balance # Same formula than in rpc's _rpc_balance
total_quote = ( total_quote = (
(rate * balance - collateral * (leverage - 1)) (rate * balance - collateral * (leverage - 1))