{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/coinrithm-com/json-schema/coinrithm-com-public-pm-calibration-response-schema.json",
  "title": "PublicPmCalibrationResponse",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/coinrithm-com-openapi.yml#/components/schemas/PublicPmCalibrationResponse",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "leadHours": {
      "type": "number"
    },
    "minSample": {
      "type": "integer"
    },
    "methodology": {
      "type": "string"
    },
    "scored": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true,
        "properties": {
          "source": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "sampleSize": {
            "type": "integer",
            "description": "Events actually scored: those whose t-24h snapshot captured the market's COMPLETE outcome book. Read alongside `excluded` — the exclusion rate differs sharply by venue, so sampleSize is not comparable across venues on its own."
          },
          "calibrationError": {
            "type": "number"
          },
          "meanWinnerConfidence": {
            "type": "number"
          },
          "excluded": {
            "type": "object",
            "additionalProperties": true,
            "description": "Cohort events NOT scored, by reason. Published so a consumer can see how much of a venue's corpus stands behind the number.",
            "properties": {
              "noLeadPoint": {
                "type": "integer",
                "description": "No timeline point at or before resolvedAt - 24h."
              },
              "partialBookAtLead": {
                "type": "integer",
                "description": "The t-24h snapshot held only part of the event's outcome set. Scoring those would condition inclusion on whether the eventual winner happened to be captured."
              },
              "winnerNotAnOutcome": {
                "type": "integer",
                "description": "Complete book, but the declared winner is not one of the event's outcomes — a resolution-provenance defect."
              },
              "invalidLeadPoint": {
                "type": "integer",
                "description": "The lead-window capture failed validation."
              },
              "nonExclusiveBook": {
                "type": "integer",
                "description": "Complete lead book without a recorded single-winner structure, so one stored winner cannot score the other outcomes."
              },
              "unpricedMassBook": {
                "type": "integer",
                "description": "Complete single-winner book whose prices sum below the complete-book minimum (probability mass no outcome carries)."
              }
            }
          },
          "reliability": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true,
              "properties": {
                "bucket": {
                  "type": "string"
                },
                "predictedMean": {
                  "type": "number"
                },
                "realizedRate": {
                  "type": "number"
                },
                "pairs": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    },
    "pending": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true,
        "properties": {
          "source": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "excluded": {
            "type": "object",
            "additionalProperties": true,
            "description": "Same exclusion counts as on `scored` rows, when computed."
          }
        }
      }
    },
    "methodologyVersion": {
      "type": "string",
      "description": "Version of the calibration methodology that produced this payload."
    },
    "finalPrice": {
      "$ref": "#/$defs/PublicPmCalibrationSeries",
      "description": "Optional second series scored on the venue-reported final\npre-resolution price (`basis: venue_final_preresolution_price`).\nLead time is unknown and not uniform, so it is not comparable with\n`scored`. Absent on older snapshots.\n"
    },
    "ownCapture": {
      "$ref": "#/$defs/PublicPmCalibrationSeries",
      "description": "Optional third series scored on CoinRithm's own last capture before\nresolution (`basis: own_last_preresolution_capture`). Its lead time\nis typically minutes (see `medianLeadSeconds`), so it is a\nnear-final-price integrity check, not forecast skill. Absent on\nolder snapshots.\n"
    }
  },
  "required": [
    "leadHours",
    "minSample",
    "scored",
    "pending"
  ],
  "$defs": {
    "PublicPmCalibrationSeries": {
      "type": "object",
      "additionalProperties": true,
      "properties": {
        "methodology": {
          "type": "string"
        },
        "minSample": {
          "type": "integer"
        },
        "scored": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": true,
            "properties": {
              "source": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "basis": {
                "type": "string"
              },
              "sampleSize": {
                "type": "integer"
              },
              "calibrationError": {
                "type": "number",
                "description": "Expected calibration error, 0-1 (lower is better)."
              },
              "meanWinnerConfidence": {
                "type": "number",
                "description": "Mean probability assigned to the eventual winner, 0-1."
              },
              "medianLeadSeconds": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "`ownCapture` only: median seconds between the scored capture and resolution."
              },
              "p90LeadSeconds": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "`ownCapture` only: 90th percentile of that lead."
              },
              "reliability": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "bucket": {
                      "type": "string"
                    },
                    "predictedMean": {
                      "type": "number"
                    },
                    "realizedRate": {
                      "type": "number"
                    },
                    "pairs": {
                      "type": "integer"
                    }
                  }
                }
              },
              "byYear": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "year": {
                      "type": "integer"
                    },
                    "sampleSize": {
                      "type": "integer"
                    },
                    "calibrationError": {
                      "type": "number"
                    },
                    "meanWinnerConfidence": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "required": [
        "methodology",
        "minSample",
        "scored"
      ]
    }
  }
}