dev #9

Merged
Arsen Mirzaev Tatyano-Muradovich merged 30 commits from Alex/stcs:dev into stable 2025-10-06 21:33:57 +07:00
75 changed files with 8190 additions and 4381 deletions
Showing only changes of commit a1a7355dc3 - Show all commits

View File

@@ -147,17 +147,12 @@ async def get_liquidation_price(
maint_margin_rate = safe_float(risk_level.get("maintenanceMargin")) maint_margin_rate = safe_float(risk_level.get("maintenanceMargin"))
maint_margin_deduction = safe_float(risk_level.get("initialMargin")) maint_margin_deduction = safe_float(risk_level.get("initialMargin"))
max_leverage = safe_float(risk_level.get("maxLeverage")) max_leverage = safe_float(risk_level.get("maxLeverage"))
position_value = order_quantity / entry_price position_value = order_quantity * entry_price
initial_margin = position_value / max_leverage initial_margin = position_value / max_leverage
maint_margin = (position_value * maint_margin_rate) - maint_margin_deduction maint_margin = (position_value * maint_margin_rate) - maint_margin_deduction
liq_price_long = order_quantity / ( liq_price_long = entry_price - (initial_margin - maint_margin) / order_quantity
position_value + (initial_margin - maint_margin) liq_price_short = entry_price + (initial_margin - maint_margin) / order_quantity
)
liq_price_short = order_quantity / (
position_value - (initial_margin - maint_margin)
)
liq_price = liq_price_long, liq_price_short liq_price = liq_price_long, liq_price_short