{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/thecoindaily-co/json-schema/thecoindaily-co-insight-request-schema.json",
  "title": "InsightRequest",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/research-openapi.json#/components/schemas/InsightRequest",
  "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": {
      "type": "string",
      "enum": [
        "1h",
        "4h",
        "1d"
      ],
      "title": "Timeframe"
    },
    "selection": {
      "$ref": "#/$defs/RangeSelection"
    }
  },
  "type": "object",
  "required": [
    "ticker",
    "a_time",
    "b_time",
    "timeframe",
    "selection"
  ],
  "$defs": {
    "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"
    }
  }
}