{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/riskmodels-app/json-schema/riskmodels-app-fund-metrics-response-schema.json",
  "title": "FundMetricsResponse",
  "description": "Latest knowledge-mode metrics for a single mutual fund. Joins `public.funds` (registry) with `public.funds_latest` (the wide-row snapshot) and groups return components / diagnostics / meta into nested objects. Bitemporal triple is at the top level; lineage in `_metadata`.\n",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/riskmodels-app-openapi.json#/components/schemas/FundMetricsResponse",
  "type": "object",
  "required": [
    "bw_fund_id",
    "report_date",
    "filing_date",
    "extracted_at",
    "returns",
    "diagnostics",
    "meta",
    "_metadata"
  ],
  "properties": {
    "bw_fund_id": {
      "type": "string"
    },
    "ticker": {
      "type": [
        "string",
        "null"
      ]
    },
    "fund_name": {
      "type": [
        "string",
        "null"
      ]
    },
    "equity_style_9box": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "Large Value",
        "Large Blend",
        "Large Growth",
        "Mid Value",
        "Mid Blend",
        "Mid Growth",
        "Small Value",
        "Small Blend",
        "Small Growth"
      ]
    },
    "report_date": {
      "type": "string",
      "format": "date"
    },
    "filing_date": {
      "type": "string",
      "format": "date"
    },
    "extracted_at": {
      "type": "string",
      "format": "date-time"
    },
    "returns": {
      "type": "object",
      "description": "Portfolio-level return components from the per-fund Slice 8 zarr.",
      "properties": {
        "gross": {
          "type": [
            "number",
            "null"
          ],
          "format": "float"
        },
        "market": {
          "type": [
            "number",
            "null"
          ],
          "format": "float"
        },
        "sector": {
          "type": [
            "number",
            "null"
          ],
          "format": "float"
        },
        "subsector": {
          "type": [
            "number",
            "null"
          ],
          "format": "float"
        },
        "idiosyncratic": {
          "type": [
            "number",
            "null"
          ],
          "format": "float"
        },
        "identity_residual": {
          "type": [
            "number",
            "null"
          ],
          "format": "float",
          "description": "L3 noise diagnostic (gross − sum of layer returns)."
        }
      }
    },
    "diagnostics": {
      "type": "object",
      "properties": {
        "weight_sum": {
          "type": [
            "number",
            "null"
          ],
          "format": "float",
          "description": "ERM3 universe coverage (fraction of fund AUM in mapped symbols)."
        },
        "n_holdings_active": {
          "type": [
            "integer",
            "null"
          ]
        },
        "effective_n": {
          "type": [
            "number",
            "null"
          ],
          "format": "float",
          "description": "HHI-derived diversification (1 / sum(w_i^2))."
        },
        "top10_weight_sum": {
          "type": [
            "number",
            "null"
          ],
          "format": "float"
        }
      }
    },
    "meta": {
      "type": "object",
      "properties": {
        "total_adj_mv": {
          "type": [
            "number",
            "null"
          ],
          "format": "float"
        },
        "n_funds_in_cell_at_report_date": {
          "type": [
            "integer",
            "null"
          ]
        },
        "morningstar_category": {
          "type": [
            "string",
            "null"
          ]
        },
        "primary_bw_fund_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "status": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "active",
            "delisted"
          ]
        },
        "death_date": {
          "type": [
            "string",
            "null"
          ],
          "format": "date"
        },
        "latest_report_date": {
          "type": [
            "string",
            "null"
          ],
          "format": "date",
          "description": "Period end of the fund's last reported holdings."
        }
      }
    },
    "_metadata": {
      "type": "object",
      "properties": {
        "model_version": {
          "type": [
            "string",
            "null"
          ]
        },
        "factor_set_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "data_as_of": {
          "type": "string",
          "format": "date"
        },
        "data_freshness": {
          "type": "string",
          "format": "date-time"
        },
        "last_synced_at": {
          "type": "string",
          "format": "date-time"
        }
      }
    }
  }
}