> ## 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.

# Risk Factors

> The seven-category factor model, how factors are combined into a 0–100 score, and the explainability and stability methods behind it.

Alterscope summarizes the risk of a protocol or position as a **0–100 score** built from seven factor categories. The score is not a black box: every score carries a per-factor attribution that shows exactly which factors moved it and by how much, and the weights that combine the factors are kept stable over time using established portfolio-risk methods rather than ad-hoc tuning.

## The seven factor categories

Each subject is scored across seven categories. Higher is safer (0 = critical, 100 = strong).

| Category           | What it captures                                                                                                                          |
| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------- |
| **Smart contract** | Audit coverage and auditor quality, code maturity, formal verification, code complexity.                                                  |
| **Liquidity**      | Market depth, exit friction, concentration, impermanent-loss exposure.                                                                    |
| **Oracle**         | Price-feed redundancy, latency, manipulation resistance, coverage. See [Oracle classification](/trust/methodology/oracle-classification). |
| **Governance**     | Decentralization, timelock buffers, emergency powers, participation.                                                                      |
| **Economic**       | Yield sustainability, tokenomics health, TVL momentum, revenue model.                                                                     |
| **Market**         | Volatility regime, correlation/beta, funding stability.                                                                                   |
| **Systemic**       | Contagion risk, depeg sensitivity. See [Graph intelligence](/trust/methodology/graph-intelligence).                                       |

Each category decomposes into named sub-factors — for example, the smart-contract category is built from audit score, code age, formal verification, and code complexity; the oracle category from source redundancy, latency risk, manipulation resistance, and coverage. The full sub-factor set is the input layer the model scores against.

## How factors become a score

The composite score is a **weighted sum** of the seven category scores:

```text theme={null}
composite = Σ  wᵢ · scoreᵢ          where  Σ wᵢ = 1,  scoreᵢ ∈ [0, 100]
            i
```

The category weights sum to one and are validated to do so. **The specific weight values are calibrated internally** and are dynamically re-balanced over time by hierarchical risk parity (described below) rather than fixed by hand. We publish the structure — seven categories, weighted sum, weights summing to one — and withhold the calibrated weight values, which are part of the model's moat.

Scores map to plain-language bands so a non-quant reader can act on them:

| Band     | Score range |
| -------- | ----------- |
| Good     | 70–100      |
| Moderate | 40–69       |
| Concern  | 20–39       |
| Critical | 0–19        |

## Explainability: factor attribution

Every score is accompanied by an **attribution** that decomposes the composite into per-factor contributions, so you can answer "why did this score move?" without guessing.

The attribution uses **Shapley values** — the game-theoretic method for fairly dividing a result among the inputs that produced it. Because the model has exactly seven factors, Alterscope computes the **exact** Shapley value over all `2⁷ = 128` factor coalitions rather than an approximation:

```text theme={null}
φᵢ = Σ        [ |S|! · (n − |S| − 1)! / n! ] · [ v(S ∪ {i}) − v(S) ]
   S ⊆ N\{i}
```

where `φᵢ` is factor `i`'s contribution, `S` ranges over subsets of the other factors, and `v(·)` is the scoring function evaluated with the absent factors held at a neutral baseline. The attributions satisfy the **efficiency property**: they sum exactly to the score's deviation from the neutral baseline, so nothing is unexplained.

<Note>
  These are Shapley values over Alterscope's deterministic scoring function — they explain how each factor moved the composite away from a neutral baseline. They are not feature-importances from a trained black-box model; the scoring function itself is transparent.
</Note>

## Stability: covariance and hierarchical risk parity

Factor scores co-move — a liquidity shock and a market shock are not independent. To weight factors sensibly, Alterscope estimates how they move together and re-balances accordingly, using two methods drawn from quantitative portfolio risk.

### EWMA covariance

The factor covariance matrix is estimated with an **exponentially-weighted moving average**, which gives recent observations more weight than old ones:

```text theme={null}
Σₜ = λ · Σₜ₋₁ + (1 − λ) · rₜ rₜᵀ
```

where `rₜ` is the vector of factor changes at time `t` and `λ` is the decay parameter. **`λ` is calibrated internally** (it differs by asset class and is tuned to the volatility regime); we publish the recursion, not the tuned value. The covariance is refreshed on a regular schedule and converted to a correlation matrix and a distance matrix (`d = √(½(1 − ρ))`, after López de Prado) for the clustering step below.

### Hierarchical risk parity (HRP)

Rather than inverting a noisy covariance matrix directly (which is unstable), Alterscope applies **Hierarchical Risk Parity** (López de Prado) to re-balance the factor weights. HRP runs in three stages:

1. **Tree clustering** — group factors by how closely they co-move, using the correlation-distance matrix.
2. **Quasi-diagonalization** — reorder the matrix so similar factors sit together.
3. **Recursive bisection** — split the tree top-down and allocate weight by inverse variance, so volatile clusters get less weight.

The resulting weights are validated to be non-negative and to sum to one, and the re-balance runs on a periodic cadence. This is what keeps the factor weights stable and noise-resistant over time instead of lurching with every data point.

## Model validation: the Deflated Sharpe Ratio

When Alterscope evaluates a risk model or strategy on historical data, it guards against **backtest overfitting** — the trap of a result that looks good only because many variants were tried. The check is the **Deflated Sharpe Ratio (DSR)** of Bailey & López de Prado:

```text theme={null}
DSR = SR − E[ max SR | H₀ ]
```

The observed Sharpe ratio `SR` is discounted by the *expected maximum* Sharpe you would see by chance given the number of trials and the estimate's own standard error:

```text theme={null}
SE(SR) = √( (1 + SR²/2 − skew·SR + (kurt − 3)·SR²/4) / n )
```

A low or negative DSR flags a result that probably won't hold out of sample; the model emits an overfitting flag and a suggested haircut. The DSR also cross-checks the factor model against the Monte-Carlo simulation (see [VaR & Monte Carlo](/trust/methodology/var-and-monte-carlo)): if the model's predicted liquidation probability disagrees materially with the simulation, that gap is surfaced rather than smoothed over.

<Note>
  "DSR" here is the **Deflated Sharpe Ratio**, an overfitting / multiple-testing correction. It is a model-validation tool, not a live risk score on a position.
</Note>

## What we publish vs. withhold

| Published                                                    | Withheld (calibrated internally)                |
| ------------------------------------------------------------ | ----------------------------------------------- |
| The seven categories and their sub-factors                   | The exact category and sub-factor weight values |
| The weighted-sum composite formula                           | The EWMA decay `λ` per asset class              |
| Exact-Shapley attribution method and the efficiency property | Calibration constants and tuned thresholds      |
| EWMA / HRP / DSR formulas and the López de Prado lineage     | Training and tuning specifics                   |

## Where this shows up

Factor scores, bands, and attributions are returned by the factor and risk-analysis endpoints in the [API reference](/api-reference/overview). Every response also carries freshness and quality metadata — see [Freshness & quality](/trust/data/freshness-and-quality) — so you know how much to trust a given score before acting on it. The honest boundaries of this model are on the [Limitations](/trust/methodology/limitations) page.
