# Every position has a level too.

Every US equity has a market benchmark; SPY does most of the work. Many have a useful sector benchmark: XLK explains a software stock that SPY alone does not. Some have a meaningful subsector benchmark: SOXX explains a chip stock that XLK alone does not.

**Not every stock has all three.**

Apple's subsector is so concentrated that the "subsector hedge" for AAPL is close to a noisy short of itself. Subtracting it makes the residual worse. The model knows this, and it can tell you.

We call the answer **L\***.

---

## The picker

For each stock, on each trading day, RiskModels asks one question: what does the next leg down remove from the residual over the next three months, and what does it cost in hedge notional to carry?

The selector is learned. Two gradient-boosted regressions predict, per stock and day, the residual variance that adding the sector leg would remove over the next 63 trading days, and the residual variance the full three-leg stack would remove. The inputs are known at the decision time: the variance each level already explains, the marginal and relative gain of each added leg, the trailing realized volatility of the residual at each level, and the sector. The level is then the deepest one whose predicted variance reduction beats the hedge gross it adds:

```
level = 1 + argmax( 0,  gain_L2 − λ · Δgross_L2,  gain_L3 − λ · Δgross_L3 )
```

- **L1**: one ETF, the market. The answer when neither deeper leg earns its notional.
- **L2**: two ETFs, market + sector.
- **L3**: three ETFs, market + sector + subsector. The answer where the subsector layer removes real residual variance.

λ converts hedge gross into variance units and is calibrated so the mix of levels across active names matches a documented anchor. The model is trained walk-forward, in annual snapshots with an embargo between the training window and the first scored date, so the level published for any historical day was chosen by a model that had seen only earlier data. The dispatch is point-in-time and safe to backtest on.

The selector replaced a fixed rule in June 2026. The earlier rule deepened the hedge whenever the added leg explained at least 1% of variance in sample. It could not see the level already explained, it could not weigh what the extra leg cost to carry, and its bar drifted in meaning as the marginal-variance scale moved across regimes. On the sealed 2018 to 2026 holdout the learned selector removes the same residual variance with about a quarter less hedge gross (1.25 against 1.47 per dollar of stock at matched residual volatility). On 13 August 2026, across 2,767 active names, it placed 44% at L1, 15% at L2 and 42% at L3; the old rule would have placed 13%, 23% and 64%. Of the names the old rule sent to L3, the selector sends about a third to L1 and a fifth to L2.

An L1 reading means neither deeper leg cleared the bar. It says nothing about how much of the name the market explains; that is a separate field.

---

## What it changes for your workflow

| Old question | The L\* answer |
|---|---|
| "What's the residual return on this name?" | `lstar_rr`: the residual at the level the model picked. Comparable across the whole universe. |
| "Should I hedge with three ETFs or two?" | `lstar_level`: 1, 2, or 3. Trade the legs the model prescribed. |
| "Why does my deep-hedge basket leak alpha on certain stocks?" | Because L3 was forced on names where L1 or L2 was the right depth. The subsector hedge added notional without cleaning the residual. |

---

## What clients see

`lstar_rr` and `lstar_level` ship as standard fields on every `/api/metrics` and `/api/batch/analyze` call, with no separate endpoint and no extra cost. The cascade does the picking; you get the answer.

The per-ticker `/api/lstar` endpoint returns the engine's own selection for every date, with the chosen level's hedge ratios and the raw explained-variance inputs beside it. Pass `threshold=` to replace the learned selection with the legacy marginal-variance rule at a bar of your choosing, for comparison or for a deliberately more aggressive or conservative stack.

```python
from riskmodels import RiskModelsClient
client = RiskModelsClient.from_env()

m = client.get_metrics("AAPL")
m["lstar_rr"]      # → today's idiosyncratic return at AAPL's right depth
m["lstar_level"]   # → 1 for AAPL on 2026-08-13: the deeper legs add notional without removing residual variance
```

---

## Where it matters

- **Stat-arb desks** ranking residual signals across a universe. `lstar_rr` is the cross-sectionally comparable residual; a fixed L3 residual is not.
- **Allocators** sizing single-name risk. `lstar_level` says whether the residual you are measuring assumed a one-, two-, or three-ETF hedge stack.
- **AI agents** answering "what's the residual?". L\* keeps them from reaching for the deepest hedge by reflex when a shallower stack is the measured answer.

---

## The principle

> Hierarchical risk models give you more knobs. L\* tells you which knobs to turn.

Every position has a market benchmark. Every position has a level too.

[Try `lstar_rr` on the API →](https://riskmodels.app/api-reference)
