> ## Documentation Index
> Fetch the complete documentation index at: https://docs.quantspace.limex.pro/llms.txt
> Use this file to discover all available pages before exploring further.

# run_st_job

> Generate stress test HTML report from portfolio or data-extraction input

## Overview

`run_st_job` builds a stress-testing HTML report (vine copula, Gaussian, or Student-t shocks).

**Inputs:**

* `portfolio_optimization_*.json` — usual path
* `data_extractor_*.json` — fast path; optional `portfolio_weights`, else equal 1/N

Describe the shock in chat (e.g. “AAPL −15%, Student-t”); skills set `stress_dict` and mode.

***

## Parameters

<ParamField body="input_url" type="string" required>
  Blob URL to a `portfolio_optimization_*.json` **or** `data_extractor_*.json` artifact.
</ParamField>

<ParamField body="config" type="object" required>
  Stress test configuration.

  <Expandable title="common config fields">
    <ParamField body="stress_test_mode" type="string" required>
      Stress model. Supported values: `vine_copula`, `gaussian`, `student_t` (alias: `student`).
    </ParamField>

    <ParamField body="stress_dict" type="object" required>
      Required ticker-to-shock mapping, for example `{ "AAPL": -0.05 }`.
      For `gaussian` / `student_t`, you must leave **at least one asset unstressed**
      (do not put every portfolio ticker in `stress_dict`).
    </ParamField>

    <ParamField body="n_samples" type="number">
      Number of simulations. Example: `5000`.
    </ParamField>

    <ParamField body="portfolio_weights" type="object">
      Optional weights for the data-extraction fast path, e.g. `{ "AAPL": 0.5, "MSFT": 0.5 }`.
      If omitted on that path, equal 1/N weights are used.
    </ParamField>

    <ParamField body="degrees_of_freedom" type="number">
      Degrees of freedom for `student_t`.
    </ParamField>
  </Expandable>
</ParamField>

***

## Returns

```json theme={null}
{
  "status": "Succeeded",
  "output_url": "https://stqsnpprod.blob.core.windows.net/data/stress_test_gaussian_e2f3a4b5c6d7.html",
  "output_name": "stress_test_gaussian_e2f3a4b5c6d7.html",
  "execution_name": "job-st-worker-abc123xyz"
}
```

***

## Example

```json theme={null}
{
  "input_url": "https://stqsnpprod.blob.core.windows.net/data/portfolio_optimization_35c1b5239d23.json",
  "config": {
    "stress_test_mode": "gaussian",
    "stress_dict": {
      "AAPL": -0.05,
      "MSFT": -0.03
    },
    "n_samples": 5000
  }
}
```

***

## Resources

| Resource           | Value                 |
| ------------------ | --------------------- |
| Container Apps Job | `job-st-worker`       |
| Container name     | `job-st-worker`       |
| Env vars injected  | `INPUT_URL`, `CONFIG` |
| Output blob prefix | `stress_test_`        |
