fix: use correct formula for shorts

This commit is contained in:
Matthias
2026-01-17 16:53:10 +01:00
parent b4961a2cb7
commit 50fd6d152e
+1 -1
View File
@@ -468,7 +468,7 @@ class Wallets:
total_quote = (
rate * pos.position - pos.collateral * (pos.leverage - 1)
if pos.side == "long"
else (pos.collateral + (rate * pos.position - pos.collateral * pos.leverage))
else pos.collateral * (1 + pos.leverage) - rate * pos.position
)
position_record = WalletHistory(