{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cryptodataapi-com/json-schema/cryptodataapi-com-quant-probability-object-schema.json",
  "title": "QuantProbabilityObject",
  "description": "Full probability object for one scope (market or coin) at one horizon.\n\n`probabilities` maps head name (directional, volatility, liquidation_risk,\nfunding, breadth [market only], open_interest, regime_transitions) to its\nbucket->probability map; every head carries its own `confidence`.\n`regime`/`probabilities` are null while the scope is warming up.\n\n`regime` is the nowcast (present state), not a per-horizon forecast — it is\ncomputed once and is therefore byte-identical across `horizon` values for\nthe same scope at the same instant. `current` is an unambiguous alias for\nthe same object, added so callers don't have to infer that from re-reading\n`regime` at two horizons; the horizon-specific forecast lives in\n`probabilities.regime_transitions` and `tomorrow`.",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cryptodataapi-com-openapi.json#/components/schemas/QuantProbabilityObject",
  "properties": {
    "scope": {
      "type": "string",
      "title": "Scope"
    },
    "symbol": {
      "title": "Symbol",
      "type": [
        "string",
        "null"
      ]
    },
    "timestamp": {
      "type": "string",
      "title": "Timestamp"
    },
    "horizon": {
      "type": "string",
      "title": "Horizon"
    },
    "regime": {
      "$ref": "#/$defs/QuantRegimeState",
      "nullable": true
    },
    "current": {
      "description": "Alias for `regime` — the nowcast, identical across horizons. Prefer this field when you just want 'what regime are we in right now.'",
      "$ref": "#/$defs/QuantRegimeState",
      "nullable": true
    },
    "probabilities": {
      "title": "Probabilities",
      "additionalProperties": {
        "additionalProperties": {
          "type": "number"
        },
        "type": "object"
      },
      "type": [
        "object",
        "null"
      ]
    },
    "tomorrow": {
      "title": "Tomorrow",
      "description": "Seeded Monte Carlo tomorrow stats (24h horizon only)",
      "additionalProperties": true,
      "type": [
        "object",
        "null"
      ]
    },
    "meta": {
      "$ref": "#/$defs/QuantMeta"
    },
    "explain": {
      "title": "Explain",
      "description": "Feature z-scores, posteriors, hysteresis state, calibration — every adjustment inspectable",
      "additionalProperties": true,
      "type": [
        "object",
        "null"
      ]
    }
  },
  "type": "object",
  "required": [
    "scope",
    "timestamp",
    "horizon",
    "meta"
  ],
  "$defs": {
    "QuantMeta": {
      "properties": {
        "model_version": {
          "type": "string",
          "title": "Model Version"
        },
        "model_family": {
          "type": "string",
          "title": "Model Family"
        },
        "last_retrain": {
          "type": "string",
          "title": "Last Retrain"
        },
        "data_staleness_ms": {
          "title": "Data Staleness Ms",
          "type": [
            "integer",
            "null"
          ]
        },
        "feature_coverage": {
          "title": "Feature Coverage",
          "type": [
            "number",
            "null"
          ]
        },
        "insufficient_history": {
          "type": "boolean",
          "title": "Insufficient History",
          "default": false
        },
        "status": {
          "type": "string",
          "title": "Status",
          "description": "ok | degraded | warming_up"
        },
        "backfilled": {
          "type": "boolean",
          "title": "Backfilled",
          "default": false
        }
      },
      "type": "object",
      "required": [
        "model_version",
        "model_family",
        "last_retrain",
        "status"
      ],
      "title": "QuantMeta"
    },
    "QuantRegimeState": {
      "properties": {
        "label": {
          "type": "string",
          "title": "Label",
          "description": "Regime label, e.g. strong_trend_bull"
        },
        "name": {
          "type": "string",
          "title": "Name",
          "description": "Display name, e.g. Strong Trend (Bull)"
        },
        "id": {
          "type": "integer",
          "maximum": 5.0,
          "minimum": 0.0,
          "title": "Id"
        },
        "confidence": {
          "type": "number",
          "title": "Confidence",
          "description": "Calibrated confidence, degraded by staleness/history"
        },
        "confidence_raw": {
          "type": "number",
          "title": "Confidence Raw",
          "description": "Raw max label posterior, pre-calibration"
        },
        "label_raw": {
          "type": "string",
          "title": "Label Raw",
          "description": "Argmax label before hysteresis (headline label may lag)"
        },
        "candles_in_regime": {
          "type": "integer",
          "title": "Candles In Regime"
        },
        "in_regime_since": {
          "title": "In Regime Since",
          "description": "ISO open time of the first closed 1h bar of the current label run (= last bar − (candles_in_regime − 1) h). Null while warming.",
          "type": [
            "string",
            "null"
          ]
        },
        "pending": {
          "title": "Pending",
          "description": "Hysteresis challenger streak {label, count, needed}; null when no challenger is accumulating bars",
          "additionalProperties": true,
          "type": [
            "object",
            "null"
          ]
        },
        "hysteresis": {
          "title": "Hysteresis",
          "description": "Switch rule constants {margin, bars, override, incumbent_floor, min_dwell_bars=0} — there is no minimum dwell",
          "additionalProperties": true,
          "type": [
            "object",
            "null"
          ]
        }
      },
      "type": "object",
      "required": [
        "label",
        "name",
        "id",
        "confidence",
        "confidence_raw",
        "label_raw",
        "candles_in_regime"
      ],
      "title": "QuantRegimeState"
    }
  }
}