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

# VaR & Monte Carlo

> Monte-Carlo Value-at-Risk and Expected Shortfall over correlated factor shocks, and the tiered liquidity exit simulation.

Point estimates tell you where risk sits today; they don't tell you how bad a bad day looks. Alterscope answers that with **Monte-Carlo simulation** — running many correlated shock scenarios to estimate loss in the tail — and with a **liquidity exit simulation** that estimates what it would actually cost to get out of a position.

## Monte-Carlo Value-at-Risk

Value-at-Risk (VaR) answers: *over a given horizon, what loss is exceeded only X% of the time?* Expected Shortfall (ES) answers the follow-up: *when it is exceeded, how bad is it on average?* Alterscope reports both at the **95% and 99%** confidence levels.

### How it works

1. **Correlate the shocks.** Factor shocks are drawn from a multivariate normal distribution, correlated using the [EWMA factor covariance matrix](/trust/methodology/risk-factors#stability-covariance-and-hierarchical-risk-parity) via a Cholesky decomposition. This means a simulated "bad day" moves correlated factors together, the way real markets do.
2. **Simulate many paths.** The engine draws a large number of scenarios (one thousand by default) and scales each to the requested horizon by the square root of time:

   ```text theme={null}
   shock(horizon) = shock(1 day) · √(horizon_days / 252)
   ```
3. **Read the tail empirically.** VaR and ES are taken as **empirical quantiles of the sorted simulated outcomes** — the 5th/1st percentile for 95%/99% VaR, and the mean of the losses beyond that point for ES. No closed-form distribution is assumed at the tail beyond the normal factor shocks that generate the paths.

### What we publish vs. withhold

| Published                                             | Withheld (calibrated internally)                       |
| ----------------------------------------------------- | ------------------------------------------------------ |
| Gaussian factor-shock model, Cholesky correlation     | Per-factor volatility inputs                           |
| 95% / 99% VaR and ES, empirical-quantile method       | Health-factor impact multipliers and stress thresholds |
| Default path count (1,000) and √-time horizon scaling | —                                                      |

<Warning>
  The simulation draws **normally-distributed** factor shocks. This is a deliberate, transparent choice — it does **not** model fat tails, jumps, or a Student-t distribution, so true tail events can be more severe than the simulated VaR/ES suggest. Treat VaR/ES as a structured stress estimate, not a worst-case bound. See [Limitations](/trust/methodology/limitations).
</Warning>

## Model validation: Deflated Sharpe Ratio

The Monte-Carlo engine also produces a distribution of Sharpe ratios and a simulated liquidation rate, which feed the **Deflated Sharpe Ratio** validation described under [Risk factors](/trust/methodology/risk-factors#model-validation-the-deflated-sharpe-ratio). In short: the DSR compares the risk model's predicted liquidation probability against the simulation, and flags when the model materially under- or over-estimates risk rather than quietly trusting one number over the other.

## Liquidity exit simulation

A position's risk includes the cost of leaving it. Alterscope estimates exit cost — the slippage you'd absorb unwinding into available depth — at two levels of sophistication, gated by plan tier.

### Baseline: depth model (all tiers)

The always-available model estimates slippage as a function of how large your exit is relative to available liquidity. Slippage grows **quadratically** in the exit-size-to-depth ratio (a larger exit moves the price disproportionately), capped at a maximum:

```text theme={null}
slippage_bps  ∝  (exit_size / available_liquidity)²        (capped)
```

The model also reports feasibility, post-exit utilization, and a risk classification. The slippage coefficient and risk thresholds are **calibrated internally**; the quadratic shape and the inputs (exit size, available depth) are published. This powers the liquidity-depth endpoint, which projects slippage at standard exit sizes.

### Advanced: Monte-Carlo exit (Enterprise / Custom)

For Enterprise and Custom tiers, Alterscope offers a **Monte-Carlo exit simulation** that models the realistic case where you are not the only one heading for the door. It accepts a caller-supplied `competing_exit_usd` that is added to your exit size, perturbs available depth by a phase-based deterministic shock across scenarios, and reports the resulting slippage distribution as percentiles (p50/p95/p99) plus a summary.

* **Tier-gated.** The Monte-Carlo exit endpoint requires an Enterprise or Custom plan; non-enterprise callers are capped on run volume.
* **Sync vs. async.** Small runs (≤100 simulations) return inline; larger runs are queued as a background job.

See [Rate limits & tiers](/develop/get-started/rate-limits) for what each plan includes, and [Coverage & gaps](/trust/data/coverage-and-gaps) for which markets have the depth data the advanced model needs.

## Where this shows up

VaR/ES and liquidity-exit results are returned by the simulation and liquidity endpoints in the [API reference](/api-reference/overview). As with every Alterscope response, the output carries [freshness and quality metadata](/trust/data/freshness-and-quality). The honest boundaries — especially the Gaussian tail assumption — are on the [Limitations](/trust/methodology/limitations) page.
