Liquidation Safety
workflow.run_liquidation_safetyCalculate the liquidation price for an isolated-margin futures position with one flat maintenance margin rate (mmr, which you supply from your exchange's tier). It is a generic flat-rate model, for linear and inverse alike, not any one exchange's engine: no tiered maintenance amounts, no liquidation fee, no cross-margin (shared collateral) logic, so it does not apply to cross-margin accounts and can differ from an exchange's own figure. Use when user asks "where will I get liquidated?" or "how close is my liq price?". Returns: liquidationPrice, distancePct (how far from entry).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mmr | No | Maintenance margin rate, default 0.005 (0.5%) | |
| side | Yes | Trade direction: "long" or "short" | |
| leverage | Yes | Leverage multiplier, e.g. 10 for 10x | |
| entryPrice | Yes | Entry price (positive) | |
| contractType | No | linear = USDT-margined (default), inverse = coin-margined (e.g. Deribit/Bybit/MEXC BTC-settled perps). |