From dd970f2be12d4c47b9444d9ce7b869eefbd12869 Mon Sep 17 00:00:00 2001 From: Matthias Date: Wed, 29 Apr 2026 20:01:50 +0200 Subject: [PATCH] fix: rate can be None in balance migration --- freqtrade/util/migrations/migrate_wallet_history.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/freqtrade/util/migrations/migrate_wallet_history.py b/freqtrade/util/migrations/migrate_wallet_history.py index dbc887c56..d7070ed5f 100644 --- a/freqtrade/util/migrations/migrate_wallet_history.py +++ b/freqtrade/util/migrations/migrate_wallet_history.py @@ -180,7 +180,7 @@ def _create_wallet_history_entries( if is_futures: collateral = row[pair_collateral_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 total_quote = ( (rate * balance - collateral * (leverage - 1))