{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://trends.polyhelper.ai/api/v1/en/council-league.schema.json",
  "title": "Council 10 — Markets: /api/v1/<lang>/council-league.json",
  "description": "The league from the sealed book (daily/council/book.jsonl, «score» lines). Always 200: below `need` resolved forecasts the rows carry n and null numbers; nothing is invented. resolved_n = the most resolved forecasts of one model; days_collected = issues so far.",
  "type": "object",
  "required": [
    "schema",
    "kind",
    "lang",
    "generated_at",
    "resolved_n",
    "need",
    "days_collected",
    "benchmarks",
    "models",
    "by_asset",
    "by_horizon",
    "usa_cn"
  ],
  "properties": {
    "schema": {
      "const": 1
    },
    "kind": {
      "const": "council-league"
    },
    "lang": {
      "type": "string"
    },
    "generated_at": {
      "type": "string"
    },
    "notice": {
      "type": "string",
      "description": "17 CFR 4.41(b)(1)(i), word for word: the results of the leagues are simulated or hypothetical"
    },
    "resolved_n": {
      "type": "integer",
      "minimum": 0
    },
    "need": {
      "type": "integer"
    },
    "need_days": {
      "type": "integer",
      "description": "a model is ranked after `need` resolved forecasts on at least need_days trading days"
    },
    "crowd": {"type": ["object", "null"], "description": "the AIs against the crowd on its own questions, per source {polymarket, kalshi}: n, ai_right, crowd_right, b_ai, b_crowd"},
    "together": {
      "type": "object",
      "description": "{all_wrong, minority_right, rows} over the counted scores"
    },
    "calibration": {
      "type": "object",
      "description": "18.10: {all|<seat>: [{lo, hi, n, said, came}]} — the stated chance folded to the side it backs vs the share that came true"
    },
    "days_collected": {
      "type": "integer",
      "minimum": 0
    },
    "first_day": {
      "type": [
        "string",
        "null"
      ]
    },
    "history": {
      "type": "string"
    },
    "url": {
      "type": "string"
    },
    "benchmarks": {
      "type": "object",
      "properties": {
        "coin_brier": {
          "type": "number"
        },
        "consensus_brier": {
          "type": [
            "number",
            "null"
          ]
        },
        "sp500_ret_pct": {
          "type": [
            "number",
            "null"
          ]
        }
      }
    },
    "models": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/row"
      }
    },
    "by_asset": {
      "type": "object",
      "additionalProperties": {
        "type": "array",
        "items": {
          "$ref": "#/$defs/row"
        }
      }
    },
    "by_horizon": {
      "type": "object",
      "additionalProperties": {
        "type": "array",
        "items": {
          "$ref": "#/$defs/row"
        }
      }
    },
    "usa_cn": {
      "type": "object",
      "properties": {
        "us": {
          "$ref": "#/$defs/side"
        },
        "cn": {
          "$ref": "#/$defs/side"
        }
      }
    }
  },
  "$defs": {
    "row": {
      "type": "object",
      "required": [
        "seat",
        "name",
        "n"
      ],
      "properties": {
        "seat": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "side": {
          "enum": [
            "US",
            "CN",
            null
          ]
        },
        "model": {
          "type": [
            "string",
            "null"
          ]
        },
        "n": {
          "type": "integer",
          "minimum": 0
        },
        "days": {
          "type": "integer",
          "minimum": 0
        },
        "ranked": {
          "type": "boolean"
        },
        "dir_pct": {
          "type": [
            "number",
            "null"
          ]
        },
        "brier": {
          "type": [
            "number",
            "null"
          ]
        },
        "consensus_brier": {
          "type": [
            "number",
            "null"
          ]
        },
        "stars": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 1,
          "maximum": 5
        },
        "stability": {
          "type": [
            "number",
            "null"
          ]
        },
        "worst_month_pct": {
          "type": [
            "number",
            "null"
          ]
        },
        "portfolio": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "value": {
              "type": [
                "number",
                "null"
              ]
            },
            "ret_pct": {
              "type": [
                "number",
                "null"
              ]
            },
            "sp500_ret_pct": {
              "type": [
                "number",
                "null"
              ]
            },
            "hold_ret_pct": {
              "type": [
                "number",
                "null"
              ]
            }
          }
        }
      }
    },
    "side": {
      "type": "object",
      "properties": {
        "dir_pct": {
          "type": [
            "number",
            "null"
          ]
        },
        "brier": {
          "type": [
            "number",
            "null"
          ]
        },
        "n": {
          "type": "integer"
        }
      }
    }
  }
}