{
  "openapi": "3.1.0",
  "info": {
    "title": "Vanda Analytics Aggregates API",
    "description": "High-performance aggregates API with Auth0",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.vanda-analytics.com",
      "description": "Production server"
    }
  ],
  "paths": {
    "/aggregates/jobs/{job_id}": {
      "get": {
        "tags": [
          "Aggregates"
        ],
        "summary": "Get Job Status",
        "description": "Get status of async job.\n\nPoll this endpoint to check job progress and retrieve results.\n\nExample:\n    GET /jobs/job_abc123xyz",
        "operationId": "get_job_status_aggregates_jobs__job_id__get",
        "security": [
          {
            "HTTPBearer": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Job identifier",
              "title": "Job Id"
            },
            "description": "Job identifier"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobStatusResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/aggregates/jobs/{job_id}/status": {
      "get": {
        "tags": [
          "Aggregates"
        ],
        "summary": "Get Job Status Only",
        "description": "Get status and metadata of async job (without result data).\n\nEfficient endpoint for polling job status without downloading results.\nUse /jobs/{job_id} for full result retrieval.\n\nExample:\n    GET /jobs/job_abc123xyz/status",
        "operationId": "get_job_status_only_aggregates_jobs__job_id__status_get",
        "security": [
          {
            "HTTPBearer": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Job identifier",
              "title": "Job Id"
            },
            "description": "Job identifier"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobStatusOnlyResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/aggregates/jobs/{job_id}/export": {
      "get": {
        "tags": [
          "Aggregates"
        ],
        "summary": "Export Job Result",
        "description": "Export completed job result in specified format with optional compression.\n\nSupports JSON and CSV formats with gzip or zip compression.\nJob must be in COMPLETED status.\n\nExample:\n    GET /jobs/job_abc123xyz/export?export_format=csv&compression=gzip\n    GET /jobs/job_abc123xyz/export?export_format=json&compression=zip",
        "operationId": "export_job_result_aggregates_jobs__job_id__export_get",
        "security": [
          {
            "HTTPBearer": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Job identifier",
              "title": "Job Id"
            },
            "description": "Job identifier"
          },
          {
            "name": "export_format",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ExportFormat",
              "description": "Export format (json or csv)",
              "default": "csv"
            },
            "description": "Export format (json or csv)"
          },
          {
            "name": "compression",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/CompressionFormat",
              "description": "Compression format (none, gzip, zip)",
              "default": "none"
            },
            "description": "Compression format (none, gzip, zip)"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/aggregates/jobs/{job_id}/stream": {
      "get": {
        "tags": [
          "Aggregates"
        ],
        "summary": "Stream Job Result",
        "description": "Stream completed job result line by line.\n\nSupports NDJSON (newline-delimited JSON) or CSV streaming.\nMemory-efficient for large result sets.\nJob must be in COMPLETED status.\n\nExample:\n    GET /jobs/job_abc123xyz/stream?format=ndjson\n    GET /jobs/job_abc123xyz/stream?format=csv",
        "operationId": "stream_job_result_aggregates_jobs__job_id__stream_get",
        "security": [
          {
            "HTTPBearer": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Job identifier",
              "title": "Job Id"
            },
            "description": "Job identifier"
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Stream format: 'ndjson' (newline-delimited JSON) or 'csv'",
              "default": "ndjson",
              "title": "Format"
            },
            "description": "Stream format: 'ndjson' (newline-delimited JSON) or 'csv'"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/aggregates/timeseries": {
      "get": {
        "tags": [
          "Aggregates",
          "Aggregates"
        ],
        "summary": "Get aggregate timeseries data",
        "description": "Retrieve timeseries data for one or more aggregates over a specified date range.\n\n    Large requests processed asynchronously in the background.\n    Tier-based limits apply for records per page and data access.\n\n    Supported intervals: 10min, 30min, 1h, 1d, 1w, 1m, 1y\n    Asset classes: cash, options\n\n    Pagination:\n    - page_number: Page to retrieve (starts at 1)\n    - records_per_page: Number of records per page\n    - Response includes pagination metadata with total_record_count, total_pages, and navigation",
        "operationId": "get_timeseries_aggregates_timeseries_get",
        "security": [
          {
            "HTTPBearer": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "aggregate_ids",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Comma-separated aggregate IDs (max 100)",
              "title": "Aggregate Ids"
            },
            "description": "Comma-separated aggregate IDs (max 100)",
            "example": "2000001,2000002,2000003"
          },
          {
            "name": "interval",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/IntervalEnum",
              "description": "Time interval",
              "default": "1d"
            },
            "description": "Time interval"
          },
          {
            "name": "start_date",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Start date (ISO format)",
              "title": "Start Date"
            },
            "description": "Start date (ISO format)",
            "example": "2024-01-01"
          },
          {
            "name": "end_date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "End date (ISO format, defaults to now)",
              "title": "End Date"
            },
            "description": "End date (ISO format, defaults to now)",
            "example": "2024-12-31"
          },
          {
            "name": "asset_class",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/AssetClassEnum",
              "description": "Asset class",
              "default": "cash"
            },
            "description": "Asset class"
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/TypeEnum"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Options type filter (metadata only)",
              "title": "Type"
            },
            "description": "Options type filter (metadata only)"
          },
          {
            "name": "notional",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/NotionalEnum"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Options notional filter (metadata only)",
              "title": "Notional"
            },
            "description": "Options notional filter (metadata only)"
          },
          {
            "name": "moneyness",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/MoneynessEnum"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Options moneyness filter (WHERE clause)",
              "title": "Moneyness"
            },
            "description": "Options moneyness filter (WHERE clause)"
          },
          {
            "name": "size",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/SizeEnum"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Options size filter (WHERE clause)",
              "title": "Size"
            },
            "description": "Options size filter (WHERE clause)"
          },
          {
            "name": "records_per_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 10000,
              "minimum": 1,
              "description": "Number of records per page",
              "default": 2000,
              "title": "Records Per Page"
            },
            "description": "Number of records per page"
          },
          {
            "name": "page_number",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "description": "Page number to retrieve",
              "default": 1,
              "title": "Page Number"
            },
            "description": "Page number to retrieve"
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/SortDirectionEnum",
              "description": "Sort order",
              "default": "desc"
            },
            "description": "Sort order"
          },
          {
            "name": "include_intraday",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Include today's intraday data for non-intraday intervals; silently forced False for basic tier",
              "default": true,
              "title": "Include Intraday"
            },
            "description": "Include today's intraday data for non-intraday intervals; silently forced False for basic tier"
          },
          {
            "name": "transformation",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/TransformationEnum"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Transformation Fields",
              "title": "Transformation"
            },
            "description": "Transformation Fields"
          },
          {
            "name": "normalisation",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/NormalisationEnum"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Normalisation Fields",
              "title": "Normalisation"
            },
            "description": "Normalisation Fields"
          },
          {
            "name": "normalisation_period",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/NormalisationPeriodEnum"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Normalisation period",
              "title": "Normalisation Period"
            },
            "description": "Normalisation period"
          },
          {
            "name": "window",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/WindowEnum"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Window in trading days. Allowed values: 5 (1W), 20 (1M), 60 (3M), 120 (6M), 252 (1Y)",
              "title": "Window"
            },
            "description": "Window in trading days. Allowed values: 5 (1W), 20 (1M), 60 (3M), 120 (6M), 252 (1Y)"
          },
          {
            "name": "is_full_history",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Fetch all available transformation data",
              "title": "Is Full History"
            },
            "description": "Fetch all available transformation data"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/aggregates/snapshot": {
      "get": {
        "tags": [
          "Aggregates",
          "Aggregates"
        ],
        "summary": "Get latest aggregate snapshot",
        "description": "Retrieve the most recent data point for one or more aggregates.\n\n    Pagination:\n    - page_number: Page to retrieve (starts at 1)\n    - records_per_page: Number of records per page\n    - Response includes pagination metadata with total_record_count, total_pages, and navigation",
        "operationId": "get_snapshot_aggregates_snapshot_get",
        "security": [
          {
            "HTTPBearer": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "aggregate_ids",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Comma-separated aggregate IDs (max 100)",
              "title": "Aggregate Ids"
            },
            "description": "Comma-separated aggregate IDs (max 100)",
            "example": "2000001,2000002"
          },
          {
            "name": "interval",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/IntervalEnum",
              "description": "Time interval",
              "default": "1d"
            },
            "description": "Time interval"
          },
          {
            "name": "asset_class",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/AssetClassEnum",
              "description": "Asset class",
              "default": "cash"
            },
            "description": "Asset class"
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/TypeEnum"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Options type filter",
              "title": "Type"
            },
            "description": "Options type filter"
          },
          {
            "name": "notional",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/NotionalEnum"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Options notional filter",
              "title": "Notional"
            },
            "description": "Options notional filter"
          },
          {
            "name": "moneyness",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/MoneynessEnum"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Options moneyness filter",
              "title": "Moneyness"
            },
            "description": "Options moneyness filter"
          },
          {
            "name": "size",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/SizeEnum"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Options size filter",
              "title": "Size"
            },
            "description": "Options size filter"
          },
          {
            "name": "records_per_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 1000,
              "minimum": 1,
              "description": "Number of records per page",
              "default": 100,
              "title": "Records Per Page"
            },
            "description": "Number of records per page"
          },
          {
            "name": "page_number",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "description": "Page number to retrieve",
              "default": 1,
              "title": "Page Number"
            },
            "description": "Page number to retrieve"
          },
          {
            "name": "include_intraday",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Include today's intraday data for non-intraday intervals; silently forced False for basic tier",
              "default": true,
              "title": "Include Intraday"
            },
            "description": "Include today's intraday data for non-intraday intervals; silently forced False for basic tier"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SnapshotResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/aggregates/leaderboard": {
      "get": {
        "tags": [
          "Aggregates",
          "Aggregates"
        ],
        "summary": "Get aggregate leaderboard",
        "description": "Retrieve top-performing aggregates ranked by a specified metric.\n\n    Large requests processed asynchronously in the background.\n    Tier-based limits apply for page size (up to 10k for data_license).\n\n    Results are scoped to Vanda-managed aggregates and the authenticated\n    user's own aggregates. Other users' aggregates are excluded.\n\n    Filter Behaviour:\n    - No filters: Returns all active aggregates (up to records_per_page limit)\n    - With filters: Applies type/subtype filtering\n\n    Date Filtering:\n    - date: Specific date filter\n    - start_date + end_date: Date range filter\n    - No date params: Returns latest available data\n\n    Vanda ID Filtering:\n    - vanda_ids: Comma-separated Vanda IDs to filter leaderboard\n    - Example: \"VNDA2000001,VNDA2000138,VNDA2000130\"\n    - Automatically converts vanda_ids to aggregate_ids for filtering\n\n    Options Type/Notional:\n    - type=CALL: Ranks by call_turnover\n    - type=PUT: Ranks by put_turnover\n    - type=ALL: Ranks by cp_turnover\n    - notional=CALL: Ranks by call_notional\n    - notional=PUT: Ranks by put_notional\n    - notional=ALL: Ranks by cp_notional\n\n    Options Moneyness/Size:\n    - moneyness: TOTAL, ITM, ATM, OTM\n    - size: TOTAL, SMALL, LARGE\n\n    Type/Subtype Filtering:\n    - types: Filter aggregates by type\n    - subtypes: Filter aggregates by subtype\n    - Both support comma-separated values for multiple filters\n\n    Pagination:\n    - page_number: Page to retrieve (starts at 1)\n    - records_per_page: Number of records per page\n    - Response includes pagination metadata with total_record_count, total_pages, and navigation\n\n    Integration Use Cases:\n    - Top movers by turnover\n    - Top performers by price change\n    - Type-based rankings\n    - All aggregates leaderboard\n    - Options by moneyness/size\n    - Specific securities leaderboard via vanda_ids",
        "operationId": "get_leaderboard_aggregates_leaderboard_get",
        "security": [
          {
            "HTTPBearer": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "interval",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/IntervalEnum",
              "description": "Time interval",
              "default": "1d"
            },
            "description": "Time interval"
          },
          {
            "name": "metric",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Metric to rank by",
              "default": "retail_net_turnover",
              "title": "Metric"
            },
            "description": "Metric to rank by",
            "example": "retail_net_turnover"
          },
          {
            "name": "records_per_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 10000,
              "minimum": 1,
              "description": "Number of records per page",
              "default": 10,
              "title": "Records Per Page"
            },
            "description": "Number of records per page"
          },
          {
            "name": "page_number",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "description": "Page number to retrieve",
              "default": 1,
              "title": "Page Number"
            },
            "description": "Page number to retrieve"
          },
          {
            "name": "asset_class",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/AssetClassEnum",
              "description": "Asset class",
              "default": "cash"
            },
            "description": "Asset class"
          },
          {
            "name": "vanda_ids",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Comma-separated Vanda IDs to filter leaderboard",
              "title": "Vanda Ids"
            },
            "description": "Comma-separated Vanda IDs to filter leaderboard",
            "example": "VNDA2000001,VNDA2000138,VNDA2000130"
          },
          {
            "name": "types",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Comma-separated aggregate types (case-insensitive)",
              "title": "Types"
            },
            "description": "Comma-separated aggregate types (case-insensitive)",
            "example": "Custom,Sector"
          },
          {
            "name": "subtypes",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Comma-separated aggregate subtypes",
              "title": "Subtypes"
            },
            "description": "Comma-separated aggregate subtypes",
            "example": "Tech Watchlist,Healthcare"
          },
          {
            "name": "date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Specific date filter",
              "title": "Date"
            },
            "description": "Specific date filter"
          },
          {
            "name": "start_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Start date for range filter",
              "title": "Start Date"
            },
            "description": "Start date for range filter"
          },
          {
            "name": "end_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "End date for range filter",
              "title": "End Date"
            },
            "description": "End date for range filter"
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/TypeEnum"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Options type filter",
              "title": "Type"
            },
            "description": "Options type filter"
          },
          {
            "name": "notional",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/NotionalEnum"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Options notional filter",
              "title": "Notional"
            },
            "description": "Options notional filter"
          },
          {
            "name": "moneyness",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/MoneynessEnum"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Options moneyness filter",
              "title": "Moneyness"
            },
            "description": "Options moneyness filter"
          },
          {
            "name": "size",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/SizeEnum"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Options size filter",
              "title": "Size"
            },
            "description": "Options size filter"
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/SortDirectionEnum",
              "description": "Sort order",
              "default": "desc"
            },
            "description": "Sort order"
          },
          {
            "name": "include_intraday",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Include today's intraday data for non-intraday intervals; silently forced False for basic tier",
              "default": true,
              "title": "Include Intraday"
            },
            "description": "Include today's intraday data for non-intraday intervals; silently forced False for basic tier"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/aggregates/stats": {
      "get": {
        "tags": [
          "Aggregates",
          "Aggregates"
        ],
        "summary": "Get aggregate statistics",
        "description": "Calculate aggregated statistics over a date range.",
        "operationId": "get_aggregate_stats_aggregates_stats_get",
        "security": [
          {
            "HTTPBearer": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "aggregate_ids",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Comma-separated aggregate IDs",
              "title": "Aggregate Ids"
            },
            "description": "Comma-separated aggregate IDs",
            "example": "2000001,2000002"
          },
          {
            "name": "interval",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/IntervalEnum",
              "description": "Time interval",
              "default": "1d"
            },
            "description": "Time interval"
          },
          {
            "name": "start_date",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Start date (ISO format)",
              "title": "Start Date"
            },
            "description": "Start date (ISO format)",
            "example": "2024-01-01"
          },
          {
            "name": "end_date",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "End date (ISO format)",
              "title": "End Date"
            },
            "description": "End date (ISO format)",
            "example": "2024-12-31"
          },
          {
            "name": "asset_class",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/AssetClassEnum",
              "description": "Asset class",
              "default": "cash"
            },
            "description": "Asset class"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AggregateStatsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/aggregates/{aggregate_id}/timeseries": {
      "get": {
        "tags": [
          "Aggregates",
          "Aggregates"
        ],
        "summary": "Get timeseries for single aggregate",
        "description": "Convenience endpoint for single aggregate timeseries (cached 60 seconds)",
        "operationId": "get_single_aggregate_timeseries_aggregates__aggregate_id__timeseries_get",
        "security": [
          {
            "HTTPBearer": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "aggregate_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "description": "Aggregate ID",
              "title": "Aggregate Id"
            },
            "description": "Aggregate ID",
            "example": 2000001
          },
          {
            "name": "interval",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/IntervalEnum",
              "description": "Time interval",
              "default": "1d"
            },
            "description": "Time interval"
          },
          {
            "name": "start_date",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Start date (ISO format)",
              "title": "Start Date"
            },
            "description": "Start date (ISO format)",
            "example": "2024-01-01"
          },
          {
            "name": "end_date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "End date (ISO format)",
              "title": "End Date"
            },
            "description": "End date (ISO format)"
          },
          {
            "name": "asset_class",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/AssetClassEnum",
              "description": "Asset class",
              "default": "cash"
            },
            "description": "Asset class"
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/TypeEnum"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Options type filter",
              "title": "Type"
            },
            "description": "Options type filter"
          },
          {
            "name": "notional",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/NotionalEnum"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Options notional filter",
              "title": "Notional"
            },
            "description": "Options notional filter"
          },
          {
            "name": "moneyness",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/MoneynessEnum"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Options moneyness filter",
              "title": "Moneyness"
            },
            "description": "Options moneyness filter"
          },
          {
            "name": "size",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/SizeEnum"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Options size filter",
              "title": "Size"
            },
            "description": "Options size filter"
          },
          {
            "name": "include_intraday",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Include today's intraday data for non-intraday intervals; silently forced False for basic tier",
              "default": true,
              "title": "Include Intraday"
            },
            "description": "Include today's intraday data for non-intraday intervals; silently forced False for basic tier"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimeseriesResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/aggregates/{aggregate_id}/latest": {
      "get": {
        "tags": [
          "Aggregates",
          "Aggregates"
        ],
        "summary": "Get latest data point for aggregate",
        "description": "Retrieve the most recent data point for a single aggregate (cached 60 seconds)",
        "operationId": "get_single_aggregate_latest_aggregates__aggregate_id__latest_get",
        "security": [
          {
            "HTTPBearer": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "aggregate_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "description": "Aggregate ID",
              "title": "Aggregate Id"
            },
            "description": "Aggregate ID",
            "example": 2000001
          },
          {
            "name": "interval",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/IntervalEnum",
              "description": "Time interval",
              "default": "1d"
            },
            "description": "Time interval"
          },
          {
            "name": "asset_class",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/AssetClassEnum",
              "description": "Asset class",
              "default": "cash"
            },
            "description": "Asset class"
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/TypeEnum"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Options type filter",
              "title": "Type"
            },
            "description": "Options type filter"
          },
          {
            "name": "notional",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/NotionalEnum"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Options notional filter",
              "title": "Notional"
            },
            "description": "Options notional filter"
          },
          {
            "name": "moneyness",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/MoneynessEnum"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Options moneyness filter",
              "title": "Moneyness"
            },
            "description": "Options moneyness filter"
          },
          {
            "name": "size",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/SizeEnum"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Options size filter",
              "title": "Size"
            },
            "description": "Options size filter"
          },
          {
            "name": "include_intraday",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Include today's intraday data for non-intraday intervals; silently forced False for basic tier",
              "default": true,
              "title": "Include Intraday"
            },
            "description": "Include today's intraday data for non-intraday intervals; silently forced False for basic tier"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/CashAggregateData"
                    },
                    {
                      "$ref": "#/components/schemas/OptionsAggregateData"
                    },
                    {
                      "$ref": "#/components/schemas/CashAggregateDataNoPx"
                    },
                    {
                      "$ref": "#/components/schemas/OptionsAggregateDataNoPx"
                    }
                  ],
                  "title": "Response Get Single Aggregate Latest Aggregates  Aggregate Id  Latest Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/aggregates/analytics/correlation": {
      "post": {
        "tags": [
          "Analytics",
          "Analytics"
        ],
        "summary": "Calculate correlation between two aggregates",
        "description": "Calculate Pearson correlation coefficient between two aggregates over a date range (Testing).\n    \n    Returns correlation coefficient between -1 (perfect negative) and 1 (perfect positive).",
        "operationId": "calculate_correlation_aggregates_analytics_correlation_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CorrelationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CorrelationResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/aggregates/analytics/trend": {
      "post": {
        "tags": [
          "Analytics",
          "Analytics"
        ],
        "summary": "Analyse trend for aggregate",
        "description": "Perform linear regression trend analysis on an aggregate's metric (Testing).",
        "operationId": "analyze_trend_aggregates_analytics_trend_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TrendAnalysisRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrendAnalysisResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/aggregates/analytics/volatility": {
      "post": {
        "tags": [
          "Analytics",
          "Analytics"
        ],
        "summary": "Calculate volatility metrics",
        "description": "Calculate volatility metrics for an aggregate (Testing).",
        "operationId": "calculate_volatility_aggregates_analytics_volatility_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VolatilityRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VolatilityResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/aggregates/baskets": {
      "get": {
        "tags": [
          "Baskets",
          "Baskets"
        ],
        "summary": "Get user baskets",
        "description": "Retrieve all baskets for the current user (cached per user)",
        "operationId": "get_user_baskets_aggregates_baskets_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "active_only",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": true,
              "title": "Active Only"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BasketListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Baskets",
          "Baskets"
        ],
        "summary": "Create basket",
        "description": "Create a new user basket (invalidates user basket cache)",
        "operationId": "create_basket_aggregates_baskets_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BasketCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BasketResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/aggregates/baskets/{basket_id}": {
      "get": {
        "tags": [
          "Baskets",
          "Baskets"
        ],
        "summary": "Get basket by ID",
        "description": "Retrieve a specific basket (cached per user)",
        "operationId": "get_basket_aggregates_baskets__basket_id__get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "basket_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "description": "Basket ID",
              "title": "Basket Id"
            },
            "description": "Basket ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BasketResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Baskets",
          "Baskets"
        ],
        "summary": "Update basket",
        "description": "Update basket details (invalidates user basket cache)",
        "operationId": "update_basket_aggregates_baskets__basket_id__patch",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "basket_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "description": "Basket ID",
              "title": "Basket Id"
            },
            "description": "Basket ID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BasketUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BasketResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Baskets",
          "Baskets"
        ],
        "summary": "Delete basket",
        "description": "Soft delete basket (invalidates user basket cache)",
        "operationId": "delete_basket_aggregates_baskets__basket_id__delete",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "basket_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "description": "Basket ID",
              "title": "Basket Id"
            },
            "description": "Basket ID"
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/aggregates/baskets/{basket_id}/price-reference": {
      "patch": {
        "tags": [
          "Baskets",
          "Baskets"
        ],
        "summary": "Set basket price reference",
        "description": "Update basket price reference security ID (invalidates user basket cache)",
        "operationId": "set_price_reference_aggregates_baskets__basket_id__price_reference_patch",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "basket_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "description": "Basket ID",
              "title": "Basket Id"
            },
            "description": "Basket ID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BasketPriceReferenceUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BasketResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/aggregates/baskets/{basket_id}/constituents": {
      "post": {
        "tags": [
          "Baskets",
          "Baskets"
        ],
        "summary": "Add constituents to basket",
        "description": "Add securities to basket (invalidates user basket cache)",
        "operationId": "add_constituents_aggregates_baskets__basket_id__constituents_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "basket_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "description": "Basket ID",
              "title": "Basket Id"
            },
            "description": "Basket ID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BasketConstituentAdd"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BasketResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Baskets",
          "Baskets"
        ],
        "summary": "Remove constituents from basket",
        "description": "Remove securities from basket (invalidates user basket cache)",
        "operationId": "remove_constituents_aggregates_baskets__basket_id__constituents_delete",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "basket_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "description": "Basket ID",
              "title": "Basket Id"
            },
            "description": "Basket ID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BasketConstituentRemove"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BasketResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/aggregates/comparison/compare": {
      "post": {
        "tags": [
          "Comparison",
          "Comparison"
        ],
        "summary": "Compare multiple aggregates",
        "description": "Compare metrics across multiple aggregates over a date range (Testing).",
        "operationId": "compare_aggregates_aggregates_comparison_compare_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ComparisonRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ComparisonResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/aggregates/comparison/side-by-side": {
      "post": {
        "tags": [
          "Comparison",
          "Comparison"
        ],
        "summary": "Get side-by-side comparison",
        "description": "Get timeseries data for multiple aggregates for side-by-side comparison (Testing).",
        "operationId": "side_by_side_comparison_aggregates_comparison_side_by_side_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SideBySideRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SideBySideResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/aggregates/reference/search": {
      "get": {
        "tags": [
          "Reference",
          "Reference"
        ],
        "summary": "Search aggregates and optionally single securities",
        "description": "Comprehensive search across aggregates, their constituents and optionally single securities.\n    \n    When include_single_security=False (default):\n    - Searches aggregate fields: vanda_id, type, subtype\n    - Searches constituent securities: vanda_id, figi, symbol, name, sector, industry\n    - Returns only aggregate results\n    \n    When include_single_security=True:\n    - Each search returns up to 'limit' results (total max 2*limit)\n    - Results include 'result_type' field to distinguish aggregate vs single_security\n    \n    Returns aggregates/securities matching any criteria (cached 5 minutes).",
        "operationId": "search_aggregates_aggregates_reference_search_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100,
              "description": "Search query",
              "title": "Query"
            },
            "description": "Search query",
            "example": "AAPL"
          },
          {
            "name": "types",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Comma-separated aggregate types to filter",
              "title": "Types"
            },
            "description": "Comma-separated aggregate types to filter",
            "example": "INDEX,SECTOR"
          },
          {
            "name": "active_only",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Only search active aggregates/securities",
              "default": true,
              "title": "Active Only"
            },
            "description": "Only search active aggregates/securities"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "description": "Maximum results per search type",
              "default": 50,
              "title": "Limit"
            },
            "description": "Maximum results per search type"
          },
          {
            "name": "include_single_security",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Include single security search results",
              "default": false,
              "title": "Include Single Security"
            },
            "description": "Include single security search results"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "anyOf": [
                      {
                        "$ref": "#/components/schemas/AggregateMetadata"
                      },
                      {
                        "$ref": "#/components/schemas/SingleSecurityMetadata"
                      }
                    ]
                  },
                  "title": "Response Search Aggregates Aggregates Reference Search Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/aggregates/reference/types": {
      "get": {
        "tags": [
          "Reference",
          "Reference"
        ],
        "summary": "Get all types and subtypes",
        "description": "Retrieve all unique aggregate types and their associated subtypes\n    from the aggregate master table (cached 1 hour).",
        "operationId": "get_types_and_subtypes_aggregates_reference_types_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TypeSubtypeResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/aggregates/reference/types/list": {
      "get": {
        "tags": [
          "Reference",
          "Reference"
        ],
        "summary": "List all aggregate types",
        "description": "Get list of all unique aggregate types (cached 1 hour)",
        "operationId": "list_aggregate_types_aggregates_reference_types_list_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array",
                  "title": "Response List Aggregate Types Aggregates Reference Types List Get"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/aggregates/reference/subtypes": {
      "get": {
        "tags": [
          "Reference",
          "Reference"
        ],
        "summary": "List subtypes",
        "description": "Get list of unique subtypes, optionally filtered by type (cached 1 hour)",
        "operationId": "list_aggregate_subtypes_aggregates_reference_subtypes_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter subtypes by specific type",
              "title": "Type"
            },
            "description": "Filter subtypes by specific type",
            "example": "INDEX"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "title": "Response List Aggregate Subtypes Aggregates Reference Subtypes Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/aggregates/reference/list/indices": {
      "get": {
        "tags": [
          "Reference",
          "Reference"
        ],
        "summary": "List all index aggregates",
        "description": "Retrieve list of all index aggregates (cached 1 hour)",
        "operationId": "list_indices_aggregates_reference_list_indices_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by index type",
              "title": "Type"
            },
            "description": "Filter by index type",
            "example": "INDEX"
          },
          {
            "name": "active_only",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Only return active indices",
              "default": true,
              "title": "Active Only"
            },
            "description": "Only return active indices"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AggregateIndexSchema"
                  },
                  "title": "Response List Indices Aggregates Reference List Indices Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/aggregates/reference/list/sectors-industries": {
      "get": {
        "tags": [
          "Reference",
          "Reference"
        ],
        "summary": "List all sector/industry aggregates",
        "description": "Retrieve list of all sector and industry aggregates (cached 1 hour)",
        "operationId": "list_sectors_industries_aggregates_reference_list_sectors_industries_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by type (SECTOR/INDUSTRY)",
              "title": "Type"
            },
            "description": "Filter by type (SECTOR/INDUSTRY)",
            "example": "SECTOR"
          },
          {
            "name": "active_only",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Only return active aggregates",
              "default": true,
              "title": "Active Only"
            },
            "description": "Only return active aggregates"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AggregateSectorIndustrySchema"
                  },
                  "title": "Response List Sectors Industries Aggregates Reference List Sectors Industries Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/aggregates/reference/{vanda_id}": {
      "get": {
        "tags": [
          "Reference",
          "Reference"
        ],
        "summary": "Get aggregate metadata by Vanda ID",
        "description": "Retrieve metadata for an aggregate by its Vanda ID.",
        "operationId": "get_aggregate_metadata_aggregates_reference__vanda_id__get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "vanda_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Vanda identifier",
              "title": "Vanda Id"
            },
            "description": "Vanda identifier",
            "example": "VNDA2000001"
          },
          {
            "name": "include_constituents",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Include constituent count in response",
              "default": true,
              "title": "Include Constituents"
            },
            "description": "Include constituent count in response"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AggregateMetadataResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/aggregates/reference/{vanda_id}/constituents": {
      "get": {
        "tags": [
          "Reference",
          "Reference"
        ],
        "summary": "Get aggregate constituents",
        "description": "Retrieve constituent security IDs for an aggregate.",
        "operationId": "get_constituents_aggregates_reference__vanda_id__constituents_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "vanda_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Vanda identifier",
              "title": "Vanda Id"
            },
            "description": "Vanda identifier",
            "example": "VNDA2000001"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConstituentResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/aggregates/users/me": {
      "get": {
        "tags": [
          "Users",
          "Users"
        ],
        "summary": "Get current user",
        "description": "Retrieve current authenticated user details (cached)",
        "operationId": "get_current_user_profile_aggregates_users_me_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      },
      "patch": {
        "tags": [
          "Users",
          "Users"
        ],
        "summary": "Update user profile",
        "description": "Update user profile details (invalidates user cache)",
        "operationId": "update_user_profile_aggregates_users_me_patch",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/aggregates/users/me/profile": {
      "get": {
        "tags": [
          "Users",
          "Users"
        ],
        "summary": "Get detailed user profile",
        "description": "Retrieve detailed profile with basket count (cached)",
        "operationId": "get_detailed_profile_aggregates_users_me_profile_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserProfileResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/aggregates/users/me/charts": {
      "patch": {
        "tags": [
          "Users",
          "Users"
        ],
        "summary": "Update user charts",
        "description": "Update user chart configurations (invalidates user cache)",
        "operationId": "update_user_charts_aggregates_users_me_charts_patch",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserChartsUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/aggregates/users/me/preferences": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Get Current User Preferences",
        "description": "Get current user's preferences.",
        "operationId": "get_current_user_preferences_aggregates_users_me_preferences_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      },
      "patch": {
        "tags": [
          "Users",
          "Users"
        ],
        "summary": "Update user preferences",
        "description": "Update user preferences (invalidates user cache)",
        "operationId": "update_user_preferences_aggregates_users_me_preferences_patch",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserPreferencesUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/aggregates/users/me/launchpads/{launchpad_id}/global-id": {
      "post": {
        "tags": [
          "Users",
          "Users"
        ],
        "summary": "Ensure a launchpad is registered for sharing",
        "description": "On-demand registration for a launchpad whose creation-time mint was missed. Idempotent get-or-create; returns the launchpad's global_id.",
        "operationId": "ensure_launchpad_global_id_aggregates_users_me_launchpads__launchpad_id__global_id_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "launchpad_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Launchpad UUID",
              "title": "Launchpad Id"
            },
            "description": "Launchpad UUID"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GlobalIdResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/aggregates/users/{user_id}": {
      "get": {
        "tags": [
          "Users",
          "Users"
        ],
        "summary": "Get user by ID",
        "description": "Retrieve user by ID (admin only, cached)",
        "operationId": "get_user_by_id_aggregates_users__user_id__get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "description": "User ID",
              "title": "User Id"
            },
            "description": "User ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/aggregates/summary/{aggregate_id}": {
      "get": {
        "tags": [
          "Summary",
          "Summary"
        ],
        "summary": "Get comprehensive aggregate summary",
        "description": "Get comprehensive summary for an aggregate including:\n    - Latest data point\n    - Trend analysis (30-day lookback)\n    - Constituent count\n    - Metadata",
        "operationId": "get_aggregate_summary_aggregates_summary__aggregate_id__get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "aggregate_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "description": "Aggregate ID",
              "title": "Aggregate Id"
            },
            "description": "Aggregate ID",
            "example": 2000001
          },
          {
            "name": "interval",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/IntervalEnum",
              "description": "Time interval",
              "default": "1d"
            },
            "description": "Time interval"
          },
          {
            "name": "asset_class",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/AssetClassEnum",
              "description": "Asset class",
              "default": "cash"
            },
            "description": "Asset class"
          },
          {
            "name": "lookback_days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 365,
              "minimum": 1,
              "description": "Number of days for trend analysis",
              "default": 30,
              "title": "Lookback Days"
            },
            "description": "Number of days for trend analysis"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AggregateSummaryResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/aggregates/summary/top-constituents": {
      "post": {
        "tags": [
          "Summary",
          "Summary"
        ],
        "summary": "Get top constituents",
        "description": "Get top N constituents of an aggregate ranked by a metric.\n    \n    Integration Use cases:\n    - Top contributors to index\n    - Sector leaders\n    - Most active securities in aggregate",
        "operationId": "get_top_constituents_aggregates_summary_top_constituents_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TopConstituentsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TopConstituentsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/aggregates/health": {
      "get": {
        "tags": [
          "Health",
          "Utility"
        ],
        "summary": "Health check endpoint",
        "operationId": "health_check_aggregates_health_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        },
        "security": []
      }
    },
    "/": {
      "get": {
        "summary": "Root",
        "description": "Root endpoint providing service metadata.",
        "operationId": "root__get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        },
        "security": []
      }
    }
  },
  "components": {
    "schemas": {
      "AggregateIndexSchema": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id",
            "description": "Index ID"
          },
          "vanda_id": {
            "type": "string",
            "title": "Vanda Id",
            "description": "Vanda identifier"
          },
          "type": {
            "type": "string",
            "title": "Type",
            "description": "Index type"
          },
          "subtype": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Subtype",
            "description": "Index subtype"
          },
          "active": {
            "type": "boolean",
            "title": "Active",
            "description": "Active status"
          }
        },
        "type": "object",
        "required": [
          "id",
          "vanda_id",
          "type",
          "active"
        ],
        "title": "AggregateIndexSchema",
        "description": "Schema for aggregate index reference data."
      },
      "AggregateMetadata": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id",
            "description": "Aggregate ID"
          },
          "vanda_id": {
            "type": "string",
            "title": "Vanda Id",
            "description": "Vanda identifier"
          },
          "type": {
            "type": "string",
            "title": "Type",
            "description": "Aggregate type"
          },
          "subtype": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Subtype",
            "description": "Aggregate subtype"
          },
          "active": {
            "type": "boolean",
            "title": "Active",
            "description": "Active status"
          },
          "result_type": {
            "type": "string",
            "const": "aggregate",
            "title": "Result Type",
            "description": "Result type discriminator",
            "default": "aggregate"
          }
        },
        "type": "object",
        "required": [
          "id",
          "vanda_id",
          "type",
          "active"
        ],
        "title": "AggregateMetadata",
        "description": "Aggregate metadata schema."
      },
      "AggregateMetadataResponse": {
        "properties": {
          "metadata": {
            "$ref": "#/components/schemas/AggregateMetadata",
            "description": "Aggregate metadata"
          },
          "constituents_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Constituents Count",
            "description": "Number of constituents"
          }
        },
        "type": "object",
        "required": [
          "metadata"
        ],
        "title": "AggregateMetadataResponse",
        "description": "Response schema for aggregate metadata."
      },
      "AggregateSectorIndustrySchema": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id",
            "description": "Sector/Industry ID"
          },
          "vanda_id": {
            "type": "string",
            "title": "Vanda Id",
            "description": "Vanda identifier"
          },
          "type": {
            "type": "string",
            "title": "Type",
            "description": "Type (SECTOR/INDUSTRY)"
          },
          "subtype": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Subtype",
            "description": "Subtype"
          },
          "active": {
            "type": "boolean",
            "title": "Active",
            "description": "Active status"
          }
        },
        "type": "object",
        "required": [
          "id",
          "vanda_id",
          "type",
          "active"
        ],
        "title": "AggregateSectorIndustrySchema",
        "description": "Schema for sector/industry reference data."
      },
      "AggregateStatsResponse": {
        "properties": {
          "total_buy_turnover": {
            "type": "number",
            "title": "Total Buy Turnover",
            "description": "Total buy turnover"
          },
          "total_sell_turnover": {
            "type": "number",
            "title": "Total Sell Turnover",
            "description": "Total sell turnover"
          },
          "total_net_turnover": {
            "type": "number",
            "title": "Total Net Turnover",
            "description": "Total net turnover"
          },
          "avg_net_turnover": {
            "type": "number",
            "title": "Avg Net Turnover",
            "description": "Average net turnover"
          },
          "record_count": {
            "type": "integer",
            "title": "Record Count",
            "description": "Number of records"
          },
          "start_date": {
            "type": "string",
            "format": "date-time",
            "title": "Start Date",
            "description": "Start date"
          },
          "end_date": {
            "type": "string",
            "format": "date-time",
            "title": "End Date",
            "description": "End date"
          },
          "aggregate_count": {
            "type": "integer",
            "title": "Aggregate Count",
            "description": "Number of aggregates"
          }
        },
        "type": "object",
        "required": [
          "total_buy_turnover",
          "total_sell_turnover",
          "total_net_turnover",
          "avg_net_turnover",
          "record_count",
          "start_date",
          "end_date",
          "aggregate_count"
        ],
        "title": "AggregateStatsResponse",
        "description": "Response schema for aggregate statistics."
      },
      "AggregateSummaryResponse": {
        "properties": {
          "aggregate_id": {
            "type": "integer",
            "title": "Aggregate Id",
            "description": "Aggregate ID"
          },
          "metadata": {
            "$ref": "#/components/schemas/AggregateMetadata",
            "description": "Aggregate metadata"
          },
          "latest": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CashAggregateData"
              },
              {
                "$ref": "#/components/schemas/OptionsAggregateData"
              },
              {
                "type": "null"
              }
            ],
            "title": "Latest",
            "description": "Latest data point"
          },
          "trends": {
            "$ref": "#/components/schemas/TrendMetrics",
            "description": "Trend analysis"
          },
          "constituents": {
            "additionalProperties": true,
            "type": "object",
            "title": "Constituents",
            "description": "Constituent information"
          },
          "lookback_days": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "title": "Lookback Days",
            "description": "Number of days analysed for trends"
          },
          "data_points": {
            "type": "integer",
            "minimum": 0,
            "title": "Data Points",
            "description": "Number of data points in analysis"
          }
        },
        "type": "object",
        "required": [
          "aggregate_id",
          "metadata",
          "trends",
          "constituents",
          "lookback_days",
          "data_points"
        ],
        "title": "AggregateSummaryResponse",
        "description": "Response schema for comprehensive aggregate summary."
      },
      "AssetClassEnum": {
        "type": "string",
        "enum": [
          "all",
          "cash",
          "options"
        ],
        "title": "AssetClassEnum",
        "description": "Asset class enumeration."
      },
      "BasketConstituentAdd": {
        "properties": {
          "security_ids": {
            "items": {
              "type": "integer"
            },
            "type": "array",
            "maxItems": 1000,
            "minItems": 1,
            "title": "Security Ids"
          }
        },
        "type": "object",
        "required": [
          "security_ids"
        ],
        "title": "BasketConstituentAdd",
        "description": "Schema for adding constituents to basket."
      },
      "BasketConstituentRemove": {
        "properties": {
          "security_ids": {
            "items": {
              "type": "integer"
            },
            "type": "array",
            "minItems": 1,
            "title": "Security Ids"
          }
        },
        "type": "object",
        "required": [
          "security_ids"
        ],
        "title": "BasketConstituentRemove",
        "description": "Schema for removing constituents from basket."
      },
      "BasketCreate": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1,
            "title": "Name"
          },
          "underlying_ids": {
            "items": {
              "type": "integer"
            },
            "type": "array",
            "maxItems": 1000,
            "title": "Underlying Ids"
          },
          "agg_px_ref_sec_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Agg Px Ref Sec Id"
          }
        },
        "type": "object",
        "required": [
          "name"
        ],
        "title": "BasketCreate",
        "description": "Schema for basket creation."
      },
      "BasketListResponse": {
        "properties": {
          "baskets": {
            "items": {
              "$ref": "#/components/schemas/BasketResponse"
            },
            "type": "array",
            "title": "Baskets"
          },
          "count": {
            "type": "integer",
            "title": "Count"
          }
        },
        "type": "object",
        "required": [
          "baskets",
          "count"
        ],
        "title": "BasketListResponse",
        "description": "Schema for basket list response."
      },
      "BasketPriceReferenceUpdate": {
        "properties": {
          "agg_px_ref_sec_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Agg Px Ref Sec Id"
          }
        },
        "type": "object",
        "title": "BasketPriceReferenceUpdate",
        "description": "Schema for updating basket price reference."
      },
      "BasketResponse": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1,
            "title": "Name"
          },
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "vanda_id": {
            "type": "string",
            "title": "Vanda Id"
          },
          "user_id": {
            "type": "integer",
            "title": "User Id"
          },
          "underlying_ids": {
            "items": {
              "type": "integer"
            },
            "type": "array",
            "title": "Underlying Ids"
          },
          "active": {
            "type": "boolean",
            "title": "Active"
          },
          "agg_px_ref_sec_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Agg Px Ref Sec Id"
          },
          "constituent_count": {
            "type": "integer",
            "title": "Constituent Count"
          }
        },
        "type": "object",
        "required": [
          "name",
          "id",
          "vanda_id",
          "user_id",
          "underlying_ids",
          "active",
          "agg_px_ref_sec_id",
          "constituent_count"
        ],
        "title": "BasketResponse",
        "description": "Schema for basket response."
      },
      "BasketUpdate": {
        "properties": {
          "name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 100,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "underlying_ids": {
            "anyOf": [
              {
                "items": {
                  "type": "integer"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Underlying Ids"
          },
          "active": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Active"
          },
          "agg_px_ref_sec_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Agg Px Ref Sec Id"
          }
        },
        "type": "object",
        "title": "BasketUpdate",
        "description": "Schema for basket updates (all fields optional)."
      },
      "CashAggregateData": {
        "properties": {
          "ts": {
            "type": "string",
            "format": "date-time",
            "title": "Ts",
            "description": "Timestamp"
          },
          "id": {
            "type": "integer",
            "title": "Id",
            "description": "Security/Aggregate ID"
          },
          "type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Type",
            "description": "Aggregate type"
          },
          "subtype": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Subtype",
            "description": "Aggregate subtype"
          },
          "market_hours": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Market Hours",
            "description": "Market hours indicator"
          },
          "is_active": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Active",
            "description": "Active status"
          },
          "px": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Px",
            "description": "Price"
          },
          "px_chg": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Px Chg",
            "description": "Price change"
          },
          "updated_time": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated Time",
            "description": "Last update timestamp"
          },
          "asset_class": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Asset Class",
            "description": "Asset class identifier"
          },
          "retail_buy_turnover": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Retail Buy Turnover",
            "description": "Retail buy turnover"
          },
          "retail_sell_turnover": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Retail Sell Turnover",
            "description": "Retail sell turnover"
          },
          "retail_net_turnover": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Retail Net Turnover",
            "description": "Retail net turnover"
          },
          "retail_total_turnover": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Retail Total Turnover",
            "description": "Retail total turnover"
          }
        },
        "type": "object",
        "required": [
          "ts",
          "id"
        ],
        "title": "CashAggregateData",
        "description": "Cash aggregate data schema."
      },
      "CashAggregateDataNoPx": {
        "properties": {
          "ts": {
            "type": "string",
            "format": "date-time",
            "title": "Ts",
            "description": "Timestamp"
          },
          "id": {
            "type": "integer",
            "title": "Id",
            "description": "Security/Aggregate ID"
          },
          "type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Type",
            "description": "Aggregate type"
          },
          "subtype": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Subtype",
            "description": "Aggregate subtype"
          },
          "market_hours": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Market Hours",
            "description": "Market hours indicator"
          },
          "is_active": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Active",
            "description": "Active status"
          },
          "updated_time": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated Time",
            "description": "Last update timestamp"
          },
          "asset_class": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Asset Class",
            "description": "Asset class identifier"
          },
          "retail_buy_turnover": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Retail Buy Turnover",
            "description": "Retail buy turnover"
          },
          "retail_sell_turnover": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Retail Sell Turnover",
            "description": "Retail sell turnover"
          },
          "retail_net_turnover": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Retail Net Turnover",
            "description": "Retail net turnover"
          },
          "retail_total_turnover": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Retail Total Turnover",
            "description": "Retail total turnover"
          }
        },
        "type": "object",
        "required": [
          "ts",
          "id"
        ],
        "title": "CashAggregateDataNoPx",
        "description": "CashAggregateData without px fields."
      },
      "ComparisonRequest": {
        "properties": {
          "aggregate_ids": {
            "items": {
              "type": "integer"
            },
            "type": "array",
            "maxItems": 10,
            "minItems": 2,
            "title": "Aggregate Ids",
            "description": "List of aggregate IDs to compare"
          },
          "interval": {
            "$ref": "#/components/schemas/IntervalEnum",
            "description": "Time interval",
            "default": "1d"
          },
          "start_date": {
            "type": "string",
            "format": "date-time",
            "title": "Start Date",
            "description": "Start date"
          },
          "end_date": {
            "type": "string",
            "format": "date-time",
            "title": "End Date",
            "description": "End date"
          },
          "metrics": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "maxItems": 10,
            "minItems": 1,
            "title": "Metrics",
            "description": "Metrics to compare",
            "default": [
              "retail_net_turnover"
            ]
          },
          "asset_class": {
            "$ref": "#/components/schemas/AssetClassEnum",
            "description": "Asset class",
            "default": "cash"
          }
        },
        "type": "object",
        "required": [
          "aggregate_ids",
          "start_date",
          "end_date"
        ],
        "title": "ComparisonRequest",
        "description": "Request schema for comparing multiple aggregates."
      },
      "ComparisonResponse": {
        "properties": {
          "aggregates": {
            "additionalProperties": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "object",
            "title": "Aggregates",
            "description": "Comparison data grouped by aggregate ID"
          },
          "interval": {
            "type": "string",
            "title": "Interval",
            "description": "Time interval"
          },
          "metrics": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Metrics",
            "description": "Metrics compared"
          },
          "date_range": {
            "additionalProperties": {
              "type": "string",
              "format": "date-time"
            },
            "type": "object",
            "title": "Date Range",
            "description": "Date range"
          }
        },
        "type": "object",
        "required": [
          "aggregates",
          "interval",
          "metrics",
          "date_range"
        ],
        "title": "ComparisonResponse",
        "description": "Response schema for aggregate comparison."
      },
      "CompressionFormat": {
        "type": "string",
        "enum": [
          "none",
          "gzip",
          "zip"
        ],
        "title": "CompressionFormat",
        "description": "Compression format options for exports"
      },
      "ConstituentDetail": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id",
            "description": "Security ID"
          },
          "vanda_id": {
            "type": "string",
            "title": "Vanda Id",
            "description": "Vanda identifier"
          },
          "symbol": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Symbol",
            "description": "Trading symbol"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name",
            "description": "Security name"
          },
          "sector": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sector",
            "description": "Sector"
          },
          "industry": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Industry",
            "description": "Industry"
          },
          "weight": {
            "anyOf": [
              {
                "type": "number",
                "maximum": 100,
                "minimum": 0
              },
              {
                "type": "null"
              }
            ],
            "title": "Weight",
            "description": "Weight in aggregate (percentage)"
          },
          "latest_data": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Latest Data",
            "description": "Latest data point for security"
          }
        },
        "type": "object",
        "required": [
          "id",
          "vanda_id"
        ],
        "title": "ConstituentDetail",
        "description": "Schema for constituent security details."
      },
      "ConstituentResponse": {
        "properties": {
          "aggregate_id": {
            "type": "integer",
            "title": "Aggregate Id",
            "description": "Aggregate ID"
          },
          "vanda_id": {
            "type": "string",
            "title": "Vanda Id",
            "description": "Vanda identifier"
          },
          "constituent_ids": {
            "items": {
              "type": "integer"
            },
            "type": "array",
            "title": "Constituent Ids",
            "description": "List of constituent security IDs"
          },
          "count": {
            "type": "integer",
            "title": "Count",
            "description": "Number of constituents"
          }
        },
        "type": "object",
        "required": [
          "aggregate_id",
          "vanda_id",
          "constituent_ids",
          "count"
        ],
        "title": "ConstituentResponse",
        "description": "Response schema for aggregate constituents."
      },
      "CorrelationRequest": {
        "properties": {
          "aggregate_id_1": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "title": "Aggregate Id 1",
            "description": "First aggregate ID"
          },
          "aggregate_id_2": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "title": "Aggregate Id 2",
            "description": "Second aggregate ID"
          },
          "interval": {
            "$ref": "#/components/schemas/IntervalEnum",
            "description": "Time interval",
            "default": "1d"
          },
          "start_date": {
            "type": "string",
            "format": "date-time",
            "title": "Start Date",
            "description": "Start date"
          },
          "end_date": {
            "type": "string",
            "format": "date-time",
            "title": "End Date",
            "description": "End date"
          },
          "metric": {
            "type": "string",
            "title": "Metric",
            "description": "Metric to correlate",
            "default": "retail_net_turnover"
          },
          "asset_class": {
            "$ref": "#/components/schemas/AssetClassEnum",
            "description": "Asset class",
            "default": "cash"
          }
        },
        "type": "object",
        "required": [
          "aggregate_id_1",
          "aggregate_id_2",
          "start_date",
          "end_date"
        ],
        "title": "CorrelationRequest",
        "description": "Request schema for correlation analysis."
      },
      "CorrelationResponse": {
        "properties": {
          "aggregate_id_1": {
            "type": "integer",
            "title": "Aggregate Id 1",
            "description": "First aggregate ID"
          },
          "aggregate_id_2": {
            "type": "integer",
            "title": "Aggregate Id 2",
            "description": "Second aggregate ID"
          },
          "correlation": {
            "type": "number",
            "maximum": 1,
            "minimum": -1,
            "title": "Correlation",
            "description": "Pearson correlation coefficient (-1 to 1)"
          },
          "data_points": {
            "type": "integer",
            "minimum": 0,
            "title": "Data Points",
            "description": "Number of overlapping data points"
          },
          "metric": {
            "type": "string",
            "title": "Metric",
            "description": "Metric used for correlation"
          },
          "interval": {
            "type": "string",
            "title": "Interval",
            "description": "Time interval"
          },
          "date_range": {
            "additionalProperties": true,
            "type": "object",
            "title": "Date Range",
            "description": "Date range analysed"
          }
        },
        "type": "object",
        "required": [
          "aggregate_id_1",
          "aggregate_id_2",
          "correlation",
          "data_points",
          "metric",
          "interval",
          "date_range"
        ],
        "title": "CorrelationResponse",
        "description": "Response schema for correlation analysis."
      },
      "ExportFormat": {
        "type": "string",
        "enum": [
          "json",
          "csv"
        ],
        "title": "ExportFormat",
        "description": "Export format options for API responses"
      },
      "GlobalIdResponse": {
        "properties": {
          "global_id": {
            "type": "string",
            "title": "Global Id"
          },
          "resource_type": {
            "type": "string",
            "title": "Resource Type"
          },
          "resource_id": {
            "type": "string",
            "title": "Resource Id"
          }
        },
        "type": "object",
        "required": [
          "global_id",
          "resource_type",
          "resource_id"
        ],
        "title": "GlobalIdResponse",
        "description": "Response of the launchpad \"ensure registered for sharing\" endpoint — the\nresource pointer plus the minted (or existing) global_id from the registry."
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "IntervalEnum": {
        "type": "string",
        "enum": [
          "10min",
          "30min",
          "1h",
          "1d",
          "1w",
          "1m",
          "1y"
        ],
        "title": "IntervalEnum",
        "description": "Time interval enumeration."
      },
      "JobStatusEnum": {
        "type": "string",
        "enum": [
          "pending",
          "processing",
          "completed",
          "failed"
        ],
        "title": "JobStatusEnum",
        "description": "Async job processing status"
      },
      "JobStatusOnlyResponse": {
        "properties": {
          "job_id": {
            "type": "string",
            "title": "Job Id",
            "description": "Job identifier"
          },
          "status": {
            "$ref": "#/components/schemas/JobStatusEnum",
            "description": "Current job status"
          },
          "endpoint": {
            "type": "string",
            "title": "Endpoint",
            "description": "Original endpoint"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At",
            "description": "Job creation timestamp"
          },
          "completed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completed At",
            "description": "Job completion timestamp"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error",
            "description": "Error message (if failed)"
          },
          "result_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Result Type",
            "description": "Result storage type"
          },
          "total_records": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Records",
            "description": "Total records in result"
          },
          "ttl_seconds": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ttl Seconds",
            "description": "Time to live in seconds"
          },
          "progress_percentage": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Progress Percentage",
            "description": "Progress indicator"
          }
        },
        "type": "object",
        "required": [
          "job_id",
          "status",
          "endpoint",
          "created_at"
        ],
        "title": "JobStatusOnlyResponse",
        "description": "Response for status-only query (no result data)"
      },
      "JobStatusResponse": {
        "properties": {
          "job_id": {
            "type": "string",
            "title": "Job Id",
            "description": "Job identifier"
          },
          "status": {
            "$ref": "#/components/schemas/JobStatusEnum",
            "description": "Current job status"
          },
          "endpoint": {
            "type": "string",
            "title": "Endpoint",
            "description": "Original endpoint"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At",
            "description": "Job creation timestamp"
          },
          "completed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completed At",
            "description": "Job completion timestamp"
          },
          "result": {
            "anyOf": [
              {},
              {
                "type": "null"
              }
            ],
            "title": "Result",
            "description": "Job result (if completed)"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error",
            "description": "Error message (if failed)"
          },
          "progress_percentage": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Progress Percentage",
            "description": "Progress indicator"
          }
        },
        "type": "object",
        "required": [
          "job_id",
          "status",
          "endpoint",
          "created_at"
        ],
        "title": "JobStatusResponse",
        "description": "Response for job status query"
      },
      "MoneynessEnum": {
        "type": "string",
        "enum": [
          "TOTAL",
          "ITM",
          "ATM",
          "OTM"
        ],
        "title": "MoneynessEnum",
        "description": "Options moneyness filter."
      },
      "NormalisationEnum": {
        "type": "string",
        "enum": [
          "zscore",
          "percentile_rank"
        ],
        "title": "NormalisationEnum",
        "description": "selection of normalisation"
      },
      "NormalisationPeriodEnum": {
        "type": "string",
        "enum": [
          "3m",
          "6m",
          "1y",
          "2y",
          "5y",
          "Expanding",
          "All"
        ],
        "title": "NormalisationPeriodEnum",
        "description": "selection of normalisation period"
      },
      "NotionalEnum": {
        "type": "string",
        "enum": [
          "ALL",
          "CALL",
          "PUT"
        ],
        "title": "NotionalEnum",
        "description": "Options notional filter for notional metrics."
      },
      "OptionsAggregateData": {
        "properties": {
          "ts": {
            "type": "string",
            "format": "date-time",
            "title": "Ts",
            "description": "Timestamp"
          },
          "id": {
            "type": "integer",
            "title": "Id",
            "description": "Security/Aggregate ID"
          },
          "type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Type",
            "description": "Aggregate type"
          },
          "subtype": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Subtype",
            "description": "Aggregate subtype"
          },
          "market_hours": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Market Hours",
            "description": "Market hours indicator"
          },
          "is_active": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Active",
            "description": "Active status"
          },
          "px": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Px",
            "description": "Price"
          },
          "px_chg": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Px Chg",
            "description": "Price change"
          },
          "updated_time": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated Time",
            "description": "Last update timestamp"
          },
          "asset_class": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Asset Class",
            "description": "Asset class identifier"
          },
          "moneyness": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Moneyness",
            "description": "Options moneyness"
          },
          "size": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Size",
            "description": "Options size"
          },
          "call_turnover": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Call Turnover",
            "description": "Call options turnover"
          },
          "put_turnover": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Put Turnover",
            "description": "Put options turnover"
          },
          "cp_turnover": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cp Turnover",
            "description": "Call/Put turnover"
          },
          "net_cp_turnover": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Net Cp Turnover",
            "description": "Net Call/Put turnover"
          },
          "call_notional": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Call Notional",
            "description": "Call options notional value"
          },
          "put_notional": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Put Notional",
            "description": "Put options notional value"
          },
          "cp_notional": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cp Notional",
            "description": "Call/Put notional value"
          },
          "net_cp_notional": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Net Cp Notional",
            "description": "Net Call/Put notional value"
          }
        },
        "type": "object",
        "required": [
          "ts",
          "id"
        ],
        "title": "OptionsAggregateData",
        "description": "Options aggregate data schema."
      },
      "OptionsAggregateDataNoPx": {
        "properties": {
          "ts": {
            "type": "string",
            "format": "date-time",
            "title": "Ts",
            "description": "Timestamp"
          },
          "id": {
            "type": "integer",
            "title": "Id",
            "description": "Security/Aggregate ID"
          },
          "type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Type",
            "description": "Aggregate type"
          },
          "subtype": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Subtype",
            "description": "Aggregate subtype"
          },
          "market_hours": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Market Hours",
            "description": "Market hours indicator"
          },
          "is_active": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Active",
            "description": "Active status"
          },
          "updated_time": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated Time",
            "description": "Last update timestamp"
          },
          "asset_class": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Asset Class",
            "description": "Asset class identifier"
          },
          "moneyness": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Moneyness",
            "description": "Options moneyness"
          },
          "size": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Size",
            "description": "Options size"
          },
          "call_turnover": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Call Turnover",
            "description": "Call options turnover"
          },
          "put_turnover": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Put Turnover",
            "description": "Put options turnover"
          },
          "cp_turnover": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cp Turnover",
            "description": "Call/Put turnover"
          },
          "net_cp_turnover": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Net Cp Turnover",
            "description": "Net Call/Put turnover"
          },
          "call_notional": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Call Notional",
            "description": "Call options notional value"
          },
          "put_notional": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Put Notional",
            "description": "Put options notional value"
          },
          "cp_notional": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cp Notional",
            "description": "Call/Put notional value"
          },
          "net_cp_notional": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Net Cp Notional",
            "description": "Net Call/Put notional value"
          }
        },
        "type": "object",
        "required": [
          "ts",
          "id"
        ],
        "title": "OptionsAggregateDataNoPx",
        "description": "OptionsAggregateData without px fields."
      },
      "PaginationMetadata": {
        "properties": {
          "page_number": {
            "type": "integer",
            "title": "Page Number",
            "description": "Current page number"
          },
          "records_per_page": {
            "type": "integer",
            "title": "Records Per Page",
            "description": "Number of records per page"
          },
          "total_record_count": {
            "type": "integer",
            "title": "Total Record Count",
            "description": "Total number of records available"
          },
          "total_pages": {
            "type": "integer",
            "title": "Total Pages",
            "description": "Total number of pages"
          },
          "has_next_page": {
            "type": "boolean",
            "title": "Has Next Page",
            "description": "Whether there is a next page"
          },
          "has_prev_page": {
            "type": "boolean",
            "title": "Has Prev Page",
            "description": "Whether there is a previous page"
          },
          "next_page": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Page",
            "description": "Next page number if available"
          },
          "prev_page": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Prev Page",
            "description": "Previous page number if available"
          }
        },
        "type": "object",
        "required": [
          "page_number",
          "records_per_page",
          "total_record_count",
          "total_pages",
          "has_next_page",
          "has_prev_page"
        ],
        "title": "PaginationMetadata",
        "description": "Pagination metadata schema."
      },
      "SideBySideRequest": {
        "properties": {
          "aggregate_ids": {
            "items": {
              "type": "integer"
            },
            "type": "array",
            "maxItems": 10,
            "minItems": 2,
            "title": "Aggregate Ids",
            "description": "Aggregate IDs to compare"
          },
          "interval": {
            "$ref": "#/components/schemas/IntervalEnum",
            "description": "Time interval",
            "default": "1d"
          },
          "start_date": {
            "type": "string",
            "format": "date-time",
            "title": "Start Date",
            "description": "Start date"
          },
          "end_date": {
            "type": "string",
            "format": "date-time",
            "title": "End Date",
            "description": "End date"
          },
          "asset_class": {
            "$ref": "#/components/schemas/AssetClassEnum",
            "description": "Asset class",
            "default": "cash"
          }
        },
        "type": "object",
        "required": [
          "aggregate_ids",
          "start_date",
          "end_date"
        ],
        "title": "SideBySideRequest",
        "description": "Request schema for side-by-side timeseries comparison."
      },
      "SideBySideResponse": {
        "properties": {
          "aggregates": {
            "additionalProperties": {
              "items": {
                "additionalProperties": true,
                "type": "object"
              },
              "type": "array"
            },
            "type": "object",
            "title": "Aggregates",
            "description": "Timeseries data grouped by aggregate ID"
          },
          "interval": {
            "type": "string",
            "title": "Interval",
            "description": "Time interval"
          },
          "asset_class": {
            "type": "string",
            "title": "Asset Class",
            "description": "Asset class"
          },
          "date_range": {
            "additionalProperties": {
              "type": "string",
              "format": "date-time"
            },
            "type": "object",
            "title": "Date Range",
            "description": "Date range"
          }
        },
        "type": "object",
        "required": [
          "aggregates",
          "interval",
          "asset_class",
          "date_range"
        ],
        "title": "SideBySideResponse",
        "description": "Response schema for side-by-side comparison."
      },
      "SingleSecurityMetadata": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id",
            "description": "Aggregate ID"
          },
          "vanda_id": {
            "type": "string",
            "title": "Vanda Id",
            "description": "Vanda identifier"
          },
          "ticker": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ticker",
            "description": "Trading symbol"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name",
            "description": "Security name"
          },
          "figi": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Figi",
            "description": "FIGI"
          },
          "exchange": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Exchange",
            "description": "Exchange"
          },
          "sector": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sector",
            "description": "Sector"
          },
          "industry": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Industry",
            "description": "Industry"
          },
          "asset_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Asset Type",
            "description": "Asset type"
          },
          "is_active": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Active",
            "description": "Active status"
          },
          "result_type": {
            "type": "string",
            "const": "single_security",
            "title": "Result Type",
            "description": "Result type discriminator",
            "default": "single_security"
          }
        },
        "type": "object",
        "required": [
          "id",
          "vanda_id"
        ],
        "title": "SingleSecurityMetadata",
        "description": "Single security metadata schema for aggregate service search."
      },
      "SizeEnum": {
        "type": "string",
        "enum": [
          "TOTAL",
          "SMALL",
          "LARGE"
        ],
        "title": "SizeEnum",
        "description": "Options size filter."
      },
      "SnapshotResponse": {
        "properties": {
          "data": {
            "items": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/CashAggregateData"
                },
                {
                  "$ref": "#/components/schemas/OptionsAggregateData"
                }
              ]
            },
            "type": "array",
            "title": "Data",
            "description": "Snapshot data"
          },
          "interval": {
            "type": "string",
            "title": "Interval",
            "description": "Time interval"
          },
          "asset_classes": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Asset Classes",
            "description": "Asset classes included"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time",
            "title": "Timestamp",
            "description": "Snapshot timestamp"
          },
          "count": {
            "type": "integer",
            "title": "Count",
            "description": "Number of data points returned"
          },
          "pagination": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PaginationMetadata"
              },
              {
                "type": "null"
              }
            ],
            "description": "Pagination metadata"
          },
          "metadata": {
            "additionalProperties": true,
            "type": "object",
            "title": "Metadata",
            "description": "Additional metadata"
          }
        },
        "type": "object",
        "required": [
          "data",
          "interval",
          "asset_classes",
          "timestamp",
          "count"
        ],
        "title": "SnapshotResponse",
        "description": "Response schema for snapshot data."
      },
      "SortDirectionEnum": {
        "type": "string",
        "enum": [
          "asc",
          "desc"
        ],
        "title": "SortDirectionEnum",
        "description": "Sort direction enumeration."
      },
      "TimeseriesResponse": {
        "properties": {
          "data": {
            "items": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/CashAggregateData"
                },
                {
                  "$ref": "#/components/schemas/OptionsAggregateData"
                }
              ]
            },
            "type": "array",
            "title": "Data",
            "description": "Timeseries data points"
          },
          "interval": {
            "type": "string",
            "title": "Interval",
            "description": "Time interval"
          },
          "asset_classes": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Asset Classes",
            "description": "Asset classes included"
          },
          "count": {
            "type": "integer",
            "title": "Count",
            "description": "Number of data points returned"
          },
          "pagination": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PaginationMetadata"
              },
              {
                "type": "null"
              }
            ],
            "description": "Pagination metadata"
          },
          "metadata": {
            "additionalProperties": true,
            "type": "object",
            "title": "Metadata",
            "description": "Additional metadata"
          },
          "transformation": {
            "additionalProperties": true,
            "type": "object",
            "title": "Transformation",
            "description": "transformation data"
          }
        },
        "type": "object",
        "required": [
          "data",
          "interval",
          "asset_classes",
          "count"
        ],
        "title": "TimeseriesResponse",
        "description": "Response schema for timeseries data."
      },
      "TopConstituentsRequest": {
        "properties": {
          "aggregate_id": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "title": "Aggregate Id",
            "description": "Aggregate ID"
          },
          "metric": {
            "type": "string",
            "title": "Metric",
            "description": "Metric to rank by",
            "default": "retail_net_turnover"
          },
          "top_n": {
            "type": "integer",
            "maximum": 100,
            "minimum": 1,
            "title": "Top N",
            "description": "Number of top constituents",
            "default": 10
          },
          "interval": {
            "$ref": "#/components/schemas/IntervalEnum",
            "description": "Time interval for latest data",
            "default": "1d"
          },
          "asset_class": {
            "$ref": "#/components/schemas/AssetClassEnum",
            "description": "Asset class",
            "default": "cash"
          }
        },
        "type": "object",
        "required": [
          "aggregate_id"
        ],
        "title": "TopConstituentsRequest",
        "description": "Request schema for top constituents."
      },
      "TopConstituentsResponse": {
        "properties": {
          "aggregate_id": {
            "type": "integer",
            "title": "Aggregate Id",
            "description": "Aggregate ID"
          },
          "vanda_id": {
            "type": "string",
            "title": "Vanda Id",
            "description": "Aggregate Vanda ID"
          },
          "constituents": {
            "items": {
              "$ref": "#/components/schemas/ConstituentDetail"
            },
            "type": "array",
            "title": "Constituents",
            "description": "Top constituents ranked by metric"
          },
          "metric": {
            "type": "string",
            "title": "Metric",
            "description": "Metric used for ranking"
          },
          "count": {
            "type": "integer",
            "title": "Count",
            "description": "Number of constituents returned"
          }
        },
        "type": "object",
        "required": [
          "aggregate_id",
          "vanda_id",
          "constituents",
          "metric",
          "count"
        ],
        "title": "TopConstituentsResponse",
        "description": "Response schema for top constituents."
      },
      "TransformationEnum": {
        "type": "string",
        "enum": [
          "rolling_sum",
          "moving_avg"
        ],
        "title": "TransformationEnum",
        "description": "selection of transformation"
      },
      "TrendAnalysisRequest": {
        "properties": {
          "aggregate_id": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "title": "Aggregate Id",
            "description": "Aggregate ID"
          },
          "interval": {
            "$ref": "#/components/schemas/IntervalEnum",
            "description": "Time interval",
            "default": "1d"
          },
          "start_date": {
            "type": "string",
            "format": "date-time",
            "title": "Start Date",
            "description": "Start date"
          },
          "end_date": {
            "type": "string",
            "format": "date-time",
            "title": "End Date",
            "description": "End date"
          },
          "metric": {
            "type": "string",
            "title": "Metric",
            "description": "Metric to analyse",
            "default": "retail_net_turnover"
          },
          "asset_class": {
            "$ref": "#/components/schemas/AssetClassEnum",
            "description": "Asset class",
            "default": "cash"
          }
        },
        "type": "object",
        "required": [
          "aggregate_id",
          "start_date",
          "end_date"
        ],
        "title": "TrendAnalysisRequest",
        "description": "Request schema for trend analysis."
      },
      "TrendAnalysisResponse": {
        "properties": {
          "aggregate_id": {
            "type": "integer",
            "title": "Aggregate Id",
            "description": "Aggregate ID"
          },
          "vanda_id": {
            "type": "string",
            "title": "Vanda Id",
            "description": "Vanda identifier"
          },
          "trend_direction": {
            "type": "string",
            "pattern": "^(up|down|neutral)$",
            "title": "Trend Direction",
            "description": "Trend direction (up, down, neutral)"
          },
          "slope": {
            "type": "number",
            "title": "Slope",
            "description": "Linear regression slope"
          },
          "r_squared": {
            "type": "number",
            "maximum": 1,
            "minimum": 0,
            "title": "R Squared",
            "description": "R-squared value (0-1)"
          },
          "p_value": {
            "type": "number",
            "maximum": 1,
            "minimum": 0,
            "title": "P Value",
            "description": "Statistical p-value"
          },
          "data_points": {
            "type": "integer",
            "minimum": 0,
            "title": "Data Points",
            "description": "Number of data points"
          },
          "start_value": {
            "type": "number",
            "title": "Start Value",
            "description": "First value in series"
          },
          "end_value": {
            "type": "number",
            "title": "End Value",
            "description": "Last value in series"
          },
          "percent_change": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Percent Change",
            "description": "Percentage change from start to end"
          },
          "metric": {
            "type": "string",
            "title": "Metric",
            "description": "Metric analysed"
          },
          "interval": {
            "type": "string",
            "title": "Interval",
            "description": "Time interval"
          }
        },
        "type": "object",
        "required": [
          "aggregate_id",
          "vanda_id",
          "trend_direction",
          "slope",
          "r_squared",
          "p_value",
          "data_points",
          "start_value",
          "end_value",
          "metric",
          "interval"
        ],
        "title": "TrendAnalysisResponse",
        "description": "Response schema for trend analysis."
      },
      "TrendMetrics": {
        "properties": {
          "direction": {
            "type": "string",
            "pattern": "^(up|down|neutral)$",
            "title": "Direction",
            "description": "Trend direction (up, down, neutral)"
          },
          "percent_change": {
            "type": "number",
            "title": "Percent Change",
            "description": "Percentage change"
          },
          "volatility": {
            "type": "number",
            "minimum": 0,
            "title": "Volatility",
            "description": "Volatility (standard deviation)"
          },
          "start_value": {
            "type": "number",
            "title": "Start Value",
            "description": "Starting value"
          },
          "end_value": {
            "type": "number",
            "title": "End Value",
            "description": "Ending value"
          },
          "mean": {
            "type": "number",
            "title": "Mean",
            "description": "Mean value"
          }
        },
        "type": "object",
        "required": [
          "direction",
          "percent_change",
          "volatility",
          "start_value",
          "end_value",
          "mean"
        ],
        "title": "TrendMetrics",
        "description": "Schema for trend metrics."
      },
      "TypeEnum": {
        "type": "string",
        "enum": [
          "ALL",
          "CALL",
          "PUT"
        ],
        "title": "TypeEnum",
        "description": "Options type filter for turnover metrics."
      },
      "TypeSubtypeResponse": {
        "properties": {
          "types": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Types",
            "description": "List of unique types"
          },
          "subtypes": {
            "additionalProperties": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "type": "object",
            "title": "Subtypes",
            "description": "Dictionary mapping types to their subtypes"
          }
        },
        "type": "object",
        "required": [
          "types",
          "subtypes"
        ],
        "title": "TypeSubtypeResponse",
        "description": "Response schema for types and subtypes."
      },
      "UserChartsUpdate": {
        "properties": {
          "charts": {
            "additionalProperties": true,
            "type": "object",
            "title": "Charts",
            "description": "Chart configurations in JSONB format"
          }
        },
        "type": "object",
        "required": [
          "charts"
        ],
        "title": "UserChartsUpdate",
        "description": "Schema for updating user charts."
      },
      "UserPreferencesUpdate": {
        "properties": {
          "preferences": {
            "additionalProperties": true,
            "type": "object",
            "title": "Preferences",
            "description": "User preferences in JSONB format"
          }
        },
        "type": "object",
        "required": [
          "preferences"
        ],
        "title": "UserPreferencesUpdate",
        "description": "Schema for updating user preferences."
      },
      "UserProfileResponse": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "vanda_id": {
            "type": "string",
            "title": "Vanda Id"
          },
          "username": {
            "type": "string",
            "title": "Username"
          },
          "email": {
            "type": "string",
            "title": "Email"
          },
          "charts": {
            "additionalProperties": true,
            "type": "object",
            "title": "Charts"
          },
          "preferences": {
            "additionalProperties": true,
            "type": "object",
            "title": "Preferences"
          },
          "active": {
            "type": "boolean",
            "title": "Active"
          },
          "basket_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Basket Count"
          }
        },
        "type": "object",
        "required": [
          "id",
          "vanda_id",
          "username",
          "email",
          "charts",
          "preferences",
          "active"
        ],
        "title": "UserProfileResponse",
        "description": "Detailed user profile response."
      },
      "UserResponse": {
        "properties": {
          "username": {
            "type": "string",
            "maxLength": 50,
            "minLength": 3,
            "title": "Username"
          },
          "email": {
            "type": "string",
            "format": "email",
            "title": "Email"
          },
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "vanda_id": {
            "type": "string",
            "title": "Vanda Id"
          },
          "charts": {
            "additionalProperties": true,
            "type": "object",
            "title": "Charts"
          },
          "preferences": {
            "additionalProperties": true,
            "type": "object",
            "title": "Preferences"
          },
          "active": {
            "type": "boolean",
            "title": "Active"
          }
        },
        "type": "object",
        "required": [
          "username",
          "email",
          "id",
          "vanda_id",
          "charts",
          "preferences",
          "active"
        ],
        "title": "UserResponse",
        "description": "Schema for user response."
      },
      "UserUpdate": {
        "properties": {
          "username": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 50,
                "minLength": 3
              },
              {
                "type": "null"
              }
            ],
            "title": "Username"
          },
          "email": {
            "anyOf": [
              {
                "type": "string",
                "format": "email"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "charts": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Charts"
          },
          "preferences": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Preferences"
          },
          "active": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Active"
          }
        },
        "type": "object",
        "title": "UserUpdate",
        "description": "Schema for user updates (all fields optional)."
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          },
          "input": {
            "title": "Input"
          },
          "ctx": {
            "type": "object",
            "title": "Context"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "VolatilityRequest": {
        "properties": {
          "aggregate_id": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "title": "Aggregate Id",
            "description": "Aggregate ID"
          },
          "interval": {
            "$ref": "#/components/schemas/IntervalEnum",
            "description": "Time interval",
            "default": "1d"
          },
          "start_date": {
            "type": "string",
            "format": "date-time",
            "title": "Start Date",
            "description": "Start date"
          },
          "end_date": {
            "type": "string",
            "format": "date-time",
            "title": "End Date",
            "description": "End date"
          },
          "metric": {
            "type": "string",
            "title": "Metric",
            "description": "Metric to analyse",
            "default": "retail_net_turnover"
          },
          "asset_class": {
            "$ref": "#/components/schemas/AssetClassEnum",
            "description": "Asset class",
            "default": "cash"
          }
        },
        "type": "object",
        "required": [
          "aggregate_id",
          "start_date",
          "end_date"
        ],
        "title": "VolatilityRequest",
        "description": "Request schema for volatility analysis."
      },
      "VolatilityResponse": {
        "properties": {
          "aggregate_id": {
            "type": "integer",
            "title": "Aggregate Id",
            "description": "Aggregate ID"
          },
          "vanda_id": {
            "type": "string",
            "title": "Vanda Id",
            "description": "Vanda identifier"
          },
          "metric": {
            "type": "string",
            "title": "Metric",
            "description": "Metric analysed"
          },
          "mean": {
            "type": "number",
            "title": "Mean",
            "description": "Mean value"
          },
          "std_dev": {
            "type": "number",
            "minimum": 0,
            "title": "Std Dev",
            "description": "Standard deviation"
          },
          "coefficient_of_variation": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ],
            "title": "Coefficient Of Variation",
            "description": "Coefficient of variation (percentage)"
          },
          "min": {
            "type": "number",
            "title": "Min",
            "description": "Minimum value"
          },
          "max": {
            "type": "number",
            "title": "Max",
            "description": "Maximum value"
          },
          "data_points": {
            "type": "integer",
            "minimum": 0,
            "title": "Data Points",
            "description": "Number of data points"
          },
          "interval": {
            "type": "string",
            "title": "Interval",
            "description": "Time interval"
          }
        },
        "type": "object",
        "required": [
          "aggregate_id",
          "vanda_id",
          "metric",
          "mean",
          "std_dev",
          "min",
          "max",
          "data_points",
          "interval"
        ],
        "title": "VolatilityResponse",
        "description": "Response schema for volatility analysis."
      },
      "WindowEnum": {
        "type": "string",
        "enum": [
          "5",
          "20",
          "30",
          "60",
          "90",
          "120",
          "252"
        ],
        "title": "WindowEnum"
      }
    },
    "securitySchemes": {
      "HTTPBearer": {
        "type": "http",
        "scheme": "bearer"
      },
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key"
      }
    }
  }
}