fix: rate can be None in balance migration
This commit is contained in:
@@ -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))
|
||||||
|
|||||||
Reference in New Issue
Block a user