{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/thecoindaily-co/json-schema/thecoindaily-co-narration-request-schema.json",
  "title": "NarrationRequest",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/research-openapi.json#/components/schemas/NarrationRequest",
  "properties": {
    "ticker": {
      "type": "string",
      "pattern": "[A-Z0-9]{1,24}-USD",
      "title": "Ticker"
    },
    "a_time": {
      "type": "string",
      "maxLength": 40,
      "minLength": 20,
      "title": "A Time"
    },
    "b_time": {
      "type": "string",
      "maxLength": 40,
      "minLength": 20,
      "title": "B Time"
    },
    "timeframe": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 10
        },
        {
          "type": "null"
        }
      ],
      "title": "Timeframe"
    },
    "evidence": {
      "items": {
        "$ref": "#/$defs/EvidenceMetric"
      },
      "type": "array",
      "maxItems": 64,
      "minItems": 1,
      "title": "Evidence"
    },
    "selection": {
      "anyOf": [
        {
          "$ref": "#/$defs/RangeSelection"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "type": "object",
  "required": [
    "ticker",
    "a_time",
    "b_time",
    "evidence"
  ],
  "$defs": {
    "EvidenceMetric": {
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^[a-zA-Z0-9_-]{1,128}$",
          "title": "Id"
        },
        "label": {
          "type": "string",
          "maxLength": 120,
          "minLength": 1,
          "title": "Label"
        },
        "source": {
          "type": "string",
          "maxLength": 160,
          "minLength": 1,
          "title": "Source"
        },
        "unit": {
          "type": "string",
          "maxLength": 40,
          "minLength": 1,
          "title": "Unit"
        },
        "a_value": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "A Value"
        },
        "b_value": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "B Value"
        },
        "a_time": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 40
            },
            {
              "type": "null"
            }
          ],
          "title": "A Time"
        },
        "b_time": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 40
            },
            {
              "type": "null"
            }
          ],
          "title": "B Time"
        },
        "a_note": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 360
            },
            {
              "type": "null"
            }
          ],
          "title": "A Note"
        },
        "b_note": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 360
            },
            {
              "type": "null"
            }
          ],
          "title": "B Note"
        },
        "delta_allowed": {
          "type": "boolean",
          "title": "Delta Allowed",
          "default": true
        },
        "relative": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Relative"
        },
        "change": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 80
            },
            {
              "type": "null"
            }
          ],
          "title": "Change"
        },
        "availability": {
          "type": "string",
          "enum": [
            "available",
            "unavailable"
          ],
          "title": "Availability"
        },
        "caveat": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 360
            },
            {
              "type": "null"
            }
          ],
          "title": "Caveat"
        }
      },
      "type": "object",
      "required": [
        "id",
        "label",
        "source",
        "unit",
        "availability"
      ],
      "title": "EvidenceMetric"
    },
    "RangeSelection": {
      "properties": {
        "as_of": {
          "type": "string",
          "maxLength": 40,
          "minLength": 20,
          "title": "As Of"
        },
        "alignment": {
          "type": "string",
          "enum": [
            "native",
            "candles"
          ],
          "title": "Alignment",
          "default": "native"
        },
        "layers": {
          "items": {
            "type": "string",
            "enum": [
              "volume",
              "open_interest",
              "funding",
              "liquidations",
              "l2",
              "long_short",
              "whale_positions",
              "market_regime",
              "volatility_regime",
              "patterns"
            ]
          },
          "type": "array",
          "maxItems": 10,
          "title": "Layers"
        },
        "indicators": {
          "items": {
            "$ref": "#/$defs/SelectedIndicator"
          },
          "type": "array",
          "maxItems": 48,
          "title": "Indicators"
        }
      },
      "type": "object",
      "required": [
        "as_of",
        "layers"
      ],
      "title": "RangeSelection"
    },
    "SelectedIndicator": {
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$",
          "title": "Id"
        },
        "indicator": {
          "type": "string",
          "pattern": "^[a-zA-Z0-9_]{1,64}$",
          "title": "Indicator"
        },
        "calculation": {
          "type": "string",
          "enum": [
            "native",
            "candles"
          ],
          "title": "Calculation",
          "default": "native"
        },
        "timeframe": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "1h",
                "4h",
                "1d"
              ]
            },
            {
              "type": "null"
            }
          ],
          "title": "Timeframe"
        }
      },
      "type": "object",
      "required": [
        "id",
        "indicator"
      ],
      "title": "SelectedIndicator"
    }
  }
}