{
      "tool_id": "art-213-perp-liquidation-calculator",
      "tool_version": "1.0.0",
      "display_name": "Perp Margin and Liquidation Calculator",
      "mcp_name": "compute_perp_margin",
      "mandate_type": "derivatives_margin_health",
      "wave": 36,
      "gpu": false,
      "url": "https://ainumbers.co/chaingraph/art-213-perp-liquidation-calculator.html",
      "description": "Computes perp liquidation price, margin health, buffer, and distance to liquidation for isolated and cross-margin modes. Covers Hyperliquid, dYdX v4, Binance, GMX, and generic venues. Includes portfolio-margin spot-offset and cross-margin efficiency calculation. Not financial advice.",
      "input_schema_ref": "chaingraph/art-213-perp-liquidation-calculator.html#manifest",
      "consumes": [],
      "feeds": [
        "art-214-perp-position-lifecycle"
      ],
      "status": "live",
      "conformance_fixtures": true,
      "compute_capability": "server",
      "compute_images": [{"system":"sha256-source","image_id":"sha256:2fccd34d45ee83dbb10844e720e1c4469b6f63bec1243d60757849f139768803","valid_from":"2026-07-10"},{"system":"risc0","image_id":"sha256:a1a0bc89b5b1febaeda3519f6dbade0fa5ac16beeb143c4e1b01689573567bc6","valid_from":"2026-07-04"}],
      "export_capability": [
        "json"
      ],
      "compute_proof_ready": "ready",
      "compute_proof": {
        "type": "ZkVmReceipt",
        "system": "risc0",
        "receiptFormat": "groth16-bn254",
        "imageId": "sha256:a1a0bc89b5b1febaeda3519f6dbade0fa5ac16beeb143c4e1b01689573567bc6",
        "seal": "Emf6Rn+xvZjmi033faNUjzTf09VG14bSYkyb468bI+gvYNpARcJEFwc9T1jHPTh7fwvS+URJkXYYeTPv3WlQLCtKfzFnVQHpXSfRiZnMXcvo/DG9XCVNqXdOSbi3lscpHHjWYjJfPa1QSPFlZzGb9JtnzuRRk2l9xbOogzorkzQL+/mkzUX1p3h5YnNz4IOJYWw6vghLyXHC3s67/p6KuwfJjJ+Ql4VWLeAp+6JjEe9J8XyKZnZncaIluvK3PhKRAI5zRL5TqM0CIvekFF0nbbK8WMf24ru8MgMVoiB+AHotLNRmjMKNnn5PI19+4H9WKYZ5tvwGKnyTGV2iq4QNVw==",
        "journal": {
          "chaingraph_version": "0.4.0",
          "kernel_digest": "sha256:2fccd34d45ee83dbb10844e720e1c4469b6f63bec1243d60757849f139768803",
          "output": {
            "buffer": 3000,
            "buffer_pct": 60,
            "cross_margin_efficiency": null,
            "disclaimer": "Not financial advice. Liquidation parameters vary by venue, tier, and market conditions. Verify MMR tiers and mark-price rules with your venue before trading. For informational purposes only.",
            "distance_to_liq_pct": 6.25,
            "entry_price": 50000,
            "health": "AMBER",
            "imr_pct": 20,
            "initial_margin": 10000,
            "leverage": 5,
            "liq_price": 45000,
            "maintenance_threshold": 5000,
            "margin_balance": 8000,
            "mark_price": 48000,
            "mark_price_note": "Liquidation is triggered at the mark price (not last-traded). On Hyperliquid, mark = median(spot, bid, ask). Divergence from entry can cause liquidation before the price you see on charts.",
            "mmr_pct": 10,
            "mode": "isolated",
            "notional": 50000,
            "portfolio_margin_note": null,
            "position_size": 1,
            "side": "long",
            "unrealized_pnl": -2000,
            "venue": "hyperliquid"
          }
        }
      }
    }
