{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "schema://formula/PORTFOLIO_CORRELATION_GATE_V1",
  "title": "PORTFOLIO_CORRELATION_GATE_V1",
  "type": "object",
  "properties": {
    "formula_id": {
      "const": "PORTFOLIO_CORRELATION_GATE_V1"
    },
    "owner": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "inputs": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "outputs": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "formula_id",
    "owner",
    "status",
    "inputs",
    "outputs"
  ],
  "x_formula_inputs": [
    "ticker",
    "price.ret20D",
    "beta_proxy",
    "weight_pct"
  ],
  "x_formula_outputs": [
    {
      "field": "satellite_cluster_beta"
    },
    {
      "field": "effective_portfolio_beta"
    },
    {
      "field": "high_corr_pairs",
      "unit": "list [{ticker1,ticker2,corr_coef}]"
    },
    {
      "field": "correlation_gate_status",
      "unit": "enum [CORRELATION_PASS,CORRELATION_WARN,CORRELATION_BLOCK]"
    }
  ]
}
