{
  "openapi": "3.1.0",
  "info": {
    "title": "SMIC Strategy Signal API",
    "version": "1.0",
    "description": "Static JSON endpoints exposing backtested trading signals from the SMIC (Student Managed Investment Club) momentum strategy research pipeline. Last updated: 2026-07-31. These are backtested signals for research purposes only. They do NOT constitute investment advice. Past performance does not guarantee future results. All trading decisions and their consequences are solely your responsibility.",
    "contact": {
      "url": "https://verdict-archive.vercel.app"
    },
    "license": {
      "name": "MIT"
    }
  },
  "servers": [
    {
      "url": "https://verdict-archive.vercel.app/api/v1",
      "description": "Production (Vercel static)"
    }
  ],
  "paths": {
    "/signals/latest.json": {
      "get": {
        "operationId": "getLatestSignals",
        "summary": "Latest trading signals",
        "description": "Returns the most recent open positions, buy signals, and sell alerts for the headline strategy. Regenerated daily by the CI pipeline.",
        "responses": {
          "200": {
            "description": "Signal payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsPayload"
                }
              }
            }
          }
        }
      }
    },
    "/signals/{date}.json": {
      "get": {
        "operationId": "getSignalsByDate",
        "summary": "Daily signal snapshot",
        "description": "Immutable daily snapshot. Date format: YYYY-MM-DD.",
        "parameters": [
          {
            "name": "date",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date",
              "example": "2026-07-31"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Signal payload for that date",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsPayload"
                }
              }
            }
          },
          "404": {
            "description": "Snapshot not yet generated for this date"
          }
        }
      }
    },
    "/strategies.json": {
      "get": {
        "operationId": "getStrategies",
        "summary": "All strategies with IS/OOS metrics",
        "responses": {
          "200": {
            "description": "Strategy list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StrategiesPayload"
                }
              }
            }
          }
        }
      }
    },
    "/trades/{strategy_key}.json": {
      "get": {
        "operationId": "getTradesByStrategy",
        "summary": "Closed trade log for a strategy",
        "parameters": [
          {
            "name": "strategy_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "W_allweather_chandelier"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Trade list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TradesPayload"
                }
              }
            }
          }
        }
      }
    },
    "/openapi.json": {
      "get": {
        "operationId": "getOpenApiSpec",
        "summary": "This OpenAPI spec",
        "responses": {
          "200": {
            "description": "OpenAPI 3.1 document"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Position": {
        "type": "object",
        "properties": {
          "ticker": {
            "type": "string"
          },
          "market": {
            "type": "string",
            "enum": [
              "KR",
              "US"
            ]
          },
          "name": {
            "type": "string"
          },
          "entry_date": {
            "type": "string",
            "format": "date"
          },
          "entry_price": {
            "type": [
              "number",
              "null"
            ]
          },
          "current_price": {
            "type": [
              "number",
              "null"
            ]
          },
          "stop_level": {
            "type": [
              "number",
              "null"
            ]
          },
          "unrealized_pct": {
            "type": [
              "number",
              "null"
            ]
          },
          "days_held": {
            "type": [
              "integer",
              "null"
            ]
          },
          "entry_reason": {
            "type": "string"
          },
          "trigger_reports": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "BuySignal": {
        "type": "object",
        "properties": {
          "ticker": {
            "type": "string"
          },
          "market": {
            "type": "string",
            "enum": [
              "KR",
              "US"
            ]
          },
          "name": {
            "type": "string"
          },
          "signal_date": {
            "type": "string",
            "format": "date"
          },
          "entry_basis_price": {
            "type": [
              "number",
              "null"
            ]
          },
          "entry_reason": {
            "type": "string"
          },
          "trigger_reports": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "SellSignal": {
        "type": "object",
        "properties": {
          "ticker": {
            "type": "string"
          },
          "market": {
            "type": "string",
            "enum": [
              "KR",
              "US"
            ]
          },
          "name": {
            "type": "string"
          },
          "reason": {
            "type": "string",
            "enum": [
              "approaching_stop",
              "stop_hit"
            ]
          },
          "stop_level": {
            "type": [
              "number",
              "null"
            ]
          },
          "dist_to_stop_pct": {
            "type": [
              "number",
              "null"
            ]
          }
        }
      },
      "Regime": {
        "type": "object",
        "properties": {
          "kospi_above_200ma": {
            "type": "boolean"
          },
          "state": {
            "type": "string",
            "enum": [
              "ON",
              "OFF"
            ]
          },
          "kospi_close": {
            "type": [
              "number",
              "null"
            ]
          },
          "kospi_ma200": {
            "type": [
              "number",
              "null"
            ]
          },
          "parking": {
            "type": "string",
            "enum": [
              "allweather",
              "kospi",
              "cash"
            ]
          },
          "applies": {
            "type": "boolean"
          }
        }
      },
      "SignalsPayload": {
        "type": "object",
        "required": [
          "schema_version",
          "as_of",
          "generated_at",
          "headline_strategy",
          "disclaimer"
        ],
        "properties": {
          "schema_version": {
            "type": "string"
          },
          "as_of": {
            "type": "string",
            "format": "date"
          },
          "generated_at": {
            "type": "string",
            "format": "date-time"
          },
          "headline_strategy": {
            "type": "string"
          },
          "disclaimer": {
            "type": "string"
          },
          "disclaimer_ko": {
            "type": "string"
          },
          "regime": {
            "$ref": "#/components/schemas/Regime"
          },
          "slots": {
            "type": "object"
          },
          "open_positions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Position"
            }
          },
          "buy_signals": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BuySignal"
            }
          },
          "sell_signals": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SellSignal"
            }
          },
          "counts": {
            "type": "object"
          }
        }
      },
      "StrategyEntry": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "is_headline": {
            "type": "boolean"
          },
          "trade_count": {
            "type": "integer"
          },
          "metrics": {
            "type": "object"
          },
          "in_sample": {
            "type": "object"
          },
          "out_of_sample": {
            "type": "object"
          },
          "kospi_dca_ratio": {
            "type": [
              "number",
              "null"
            ]
          },
          "kospi_dca_beats": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "aw_dca_ratio": {
            "type": [
              "number",
              "null"
            ]
          },
          "aw_dca_beats": {
            "type": [
              "boolean",
              "null"
            ]
          }
        }
      },
      "StrategiesPayload": {
        "type": "object",
        "properties": {
          "schema_version": {
            "type": "string"
          },
          "generated_at": {
            "type": "string",
            "format": "date-time"
          },
          "headline_key": {
            "type": "string"
          },
          "disclaimer": {
            "type": "string"
          },
          "strategies": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StrategyEntry"
            }
          }
        }
      },
      "Trade": {
        "type": "object",
        "properties": {
          "ticker": {
            "type": "string"
          },
          "market": {
            "type": "string",
            "enum": [
              "KR",
              "US"
            ]
          },
          "name": {
            "type": "string"
          },
          "entry_date": {
            "type": "string",
            "format": "date"
          },
          "exit_date": {
            "type": "string",
            "format": "date"
          },
          "entry_price": {
            "type": [
              "number",
              "null"
            ]
          },
          "exit_price": {
            "type": [
              "number",
              "null"
            ]
          },
          "return_pct": {
            "type": [
              "number",
              "null"
            ]
          },
          "days": {
            "type": [
              "integer",
              "null"
            ]
          },
          "exit_reason": {
            "type": "string"
          },
          "entry_reason": {
            "type": "string"
          },
          "trigger_reports": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "TradesPayload": {
        "type": "object",
        "properties": {
          "schema_version": {
            "type": "string"
          },
          "generated_at": {
            "type": "string",
            "format": "date-time"
          },
          "strategy_key": {
            "type": "string"
          },
          "disclaimer": {
            "type": "string"
          },
          "trades": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Trade"
            }
          }
        }
      }
    }
  }
}