{
  "tool_id": "art-656-derivatives-margin-workbench",
  "note": "Golden vectors authored for DERIV-WF-MARGIN-1 (DERIV-WORKFLOWS-BUILD-SPEC.md, AT-01/AT-02/AT-05). Synthetic inputs only, zero PII. Values generated by running compute() and transcribed verbatim, then hand-verified against the source formulas. human_sign_off: PENDING.",
  "vectors": [
    {
      "name": "kalshi_scalar_cpi_long_in_range_with_margin_green",
      "policy_parameters": {
        "event_market": {
          "side": "long",
          "strike": 3.5,
          "settlement_value": 4.1,
          "unit_value": 200,
          "n_contracts": 1,
          "min_price": 0,
          "max_price": 10
        },
        "margin": {
          "side": "long",
          "entry_price": 50000,
          "mark_price": 52000,
          "notional": 50000,
          "margin_posted": 8000,
          "margin_mode": "isolated",
          "venue_margin_model": {
            "class": "regulated_dcm",
            "label": "CME-style regulated DCM",
            "imr": 0.1,
            "mmr": 0.05
          }
        }
      },
      "output_payload": {
        "event_market": {
          "side": "long",
          "strike": 3.5,
          "settlement_value": 4.1,
          "settlement_in_range": true,
          "unit_value": 200,
          "n_contracts": 1,
          "settlement_delta": 0.6,
          "pnl": 120
        },
        "margin": {
          "side": "long",
          "margin_mode": "isolated",
          "entry_price": 50000,
          "mark_price": 52000,
          "notional": 50000,
          "margin_posted": 8000,
          "venue_margin_model": {
            "class": "regulated_dcm",
            "label": "CME-style regulated DCM",
            "imr_pct": 10,
            "mmr_pct": 5
          },
          "initial_margin_required": 5000,
          "unrealized_pnl": 2000,
          "margin_balance": 10000,
          "maintenance_threshold": 2500,
          "buffer": 7500,
          "buffer_pct": 300,
          "liquidation_price": 44500,
          "leverage_ratio": 5,
          "health": "GREEN",
          "cross_margin_note": null
        },
        "cross_margin": null,
        "warnings": [],
        "scope_note": "Cross-margin efficiency is a closed-form correlation-VaR approximation of what scenario-grid margin systems deliver — production risk engines (CME SPAN/SPAN2, Deribit PME, OKX risk units) use stress grids, not this formula.",
        "disclaimer": "Not financial advice. Venue margin conventions, funding mechanics, and event-contract terms vary and change; verify current parameters with the venue before trading. For informational purposes only."
      },
      "golden_hash": "14d16056dac240bb279c13f80e261e0474a31cef1f3fe4cd4e55652bad7d4ecd"
    },
    {
      "name": "offshore_perp_short_amber_out_of_range_event",
      "policy_parameters": {
        "event_market": {
          "side": "short",
          "strike": 100,
          "settlement_value": 250,
          "unit_value": 20,
          "n_contracts": 3,
          "min_price": 0,
          "max_price": 200
        },
        "margin": {
          "side": "short",
          "entry_price": 3000,
          "mark_price": 3100,
          "notional": 6000,
          "margin_posted": 400,
          "margin_mode": "isolated",
          "venue_margin_model": {
            "class": "offshore_perp",
            "label": "Hyperliquid-style offshore perp",
            "imr": 0.1,
            "mmr": 0.03
          }
        }
      },
      "output_payload": {
        "event_market": {
          "side": "short",
          "strike": 100,
          "settlement_value": 250,
          "settlement_in_range": false,
          "unit_value": 20,
          "n_contracts": 3,
          "settlement_delta": 100,
          "pnl": -6000
        },
        "margin": {
          "side": "short",
          "margin_mode": "isolated",
          "entry_price": 3000,
          "mark_price": 3100,
          "notional": 6000,
          "margin_posted": 400,
          "venue_margin_model": {
            "class": "offshore_perp",
            "label": "Hyperliquid-style offshore perp",
            "imr_pct": 10,
            "mmr_pct": 3
          },
          "initial_margin_required": 600,
          "unrealized_pnl": -200,
          "margin_balance": 200,
          "maintenance_threshold": 180,
          "buffer": 20,
          "buffer_pct": 11.1111,
          "liquidation_price": 3110,
          "leverage_ratio": 30,
          "health": "AMBER",
          "cross_margin_note": null
        },
        "cross_margin": null,
        "warnings": [
          "Event-market settlement value was outside the declared [min_price, max_price] range and was clamped before computing PnL.",
          "Margin posted is below the initial margin required by the declared venue margin model.",
          "Effective leverage exceeds 10x."
        ],
        "scope_note": "Cross-margin efficiency is a closed-form correlation-VaR approximation of what scenario-grid margin systems deliver — production risk engines (CME SPAN/SPAN2, Deribit PME, OKX risk units) use stress grids, not this formula.",
        "disclaimer": "Not financial advice. Venue margin conventions, funding mechanics, and event-contract terms vary and change; verify current parameters with the venue before trading. For informational purposes only."
      },
      "golden_hash": "586046acaf9a8b5b9fac1abe44943dbd9b9b3c32e7bf04dc8220b48060e7f707"
    },
    {
      "name": "cross_margin_two_positions_correlated",
      "policy_parameters": {
        "event_market": {
          "side": "long",
          "strike": 0,
          "settlement_value": 0,
          "unit_value": 1,
          "n_contracts": 0,
          "min_price": 0,
          "max_price": 1
        },
        "margin": {
          "side": "long",
          "entry_price": 100,
          "mark_price": 100,
          "notional": 10000,
          "margin_posted": 1500,
          "margin_mode": "cross",
          "venue_margin_model": {
            "class": "regulated_dcm",
            "label": "Regulated DCM",
            "imr": 0.1,
            "mmr": 0.05
          }
        },
        "cross_margin": {
          "position_b_notional": 10000,
          "position_b_imr": 0.1,
          "correlation": 0.85,
          "weight_a": 0.5,
          "weight_b": 0.5
        }
      },
      "output_payload": {
        "event_market": {
          "side": "long",
          "strike": 0,
          "settlement_value": 0,
          "settlement_in_range": true,
          "unit_value": 1,
          "n_contracts": 0,
          "settlement_delta": 0,
          "pnl": 0
        },
        "margin": {
          "side": "long",
          "margin_mode": "cross",
          "entry_price": 100,
          "mark_price": 100,
          "notional": 10000,
          "margin_posted": 1500,
          "venue_margin_model": {
            "class": "regulated_dcm",
            "label": "Regulated DCM",
            "imr_pct": 10,
            "mmr_pct": 5
          },
          "initial_margin_required": 1000,
          "unrealized_pnl": 0,
          "margin_balance": 1500,
          "maintenance_threshold": 500,
          "buffer": 1000,
          "buffer_pct": 200,
          "liquidation_price": null,
          "leverage_ratio": 6.6667,
          "health": "GREEN",
          "cross_margin_note": "Cross-margin: account-level liquidation fires when account value (incl. unrealized PnL) falls below the sum of each position's maintenance requirement. Leverage sets how much collateral is drawn, not the liquidation trigger."
        },
        "cross_margin": {
          "position_a_notional": 10000,
          "position_a_imr_pct": 10,
          "position_b_notional": 10000,
          "position_b_imr_pct": 10,
          "correlation": 0.85,
          "weight_a": 0.5,
          "weight_b": 0.5,
          "siloed_margin": 2000,
          "shared_margin": 2387.467277,
          "efficiency_ratio": 1.1937,
          "capital_saved": -387.467277,
          "benefit": "NONE"
        },
        "warnings": [
          "Correlation exceeds 0.5; same-direction risk is not diversified away by cross-margining."
        ],
        "scope_note": "Cross-margin efficiency is a closed-form correlation-VaR approximation of what scenario-grid margin systems deliver — production risk engines (CME SPAN/SPAN2, Deribit PME, OKX risk units) use stress grids, not this formula.",
        "disclaimer": "Not financial advice. Venue margin conventions, funding mechanics, and event-contract terms vary and change; verify current parameters with the venue before trading. For informational purposes only."
      },
      "golden_hash": "1c4aa0f3619e7f63d956d289a2ba1828b632dbba8d3a498850c5a5797b895674"
    },
    {
      "name": "empty_input_all_defaults",
      "policy_parameters": {},
      "output_payload": {
        "event_market": {
          "side": "long",
          "strike": 0,
          "settlement_value": 0,
          "settlement_in_range": true,
          "unit_value": 1,
          "n_contracts": 1,
          "settlement_delta": 0,
          "pnl": 0
        },
        "margin": {
          "side": "long",
          "margin_mode": "isolated",
          "entry_price": 1,
          "mark_price": 1,
          "notional": 0,
          "margin_posted": 0,
          "venue_margin_model": {
            "class": "regulated_dcm",
            "label": "Regulated DCM (CFTC-registered)",
            "imr_pct": 10,
            "mmr_pct": 5
          },
          "initial_margin_required": 0,
          "unrealized_pnl": 0,
          "margin_balance": 0,
          "maintenance_threshold": 0,
          "buffer": 0,
          "buffer_pct": 0,
          "liquidation_price": 1,
          "leverage_ratio": null,
          "health": "RED",
          "cross_margin_note": null
        },
        "cross_margin": null,
        "warnings": [],
        "scope_note": "Cross-margin efficiency is a closed-form correlation-VaR approximation of what scenario-grid margin systems deliver — production risk engines (CME SPAN/SPAN2, Deribit PME, OKX risk units) use stress grids, not this formula.",
        "disclaimer": "Not financial advice. Venue margin conventions, funding mechanics, and event-contract terms vary and change; verify current parameters with the venue before trading. For informational purposes only."
      },
      "golden_hash": "f4b85e8d9683df5bfda9f25a33f54d009069fdf89255975ec7f44efa961352f8"
    }
  ]
}
