# Stress the book: a prompt from hedgefund.md

Paste this into your AI agent. It needs no connection to hedgefund.md. An agent that can run code should write and run it, and shouldn't work a long series by hand.

**Question.** What does each shock do to this book of sleeves, which shock is worst, and what drives it?

## Method

Sleeve P and L % = beta x equity + dv01 x rates_bps / 100 - spread_duration x spread_bps / 100 + vega x vol_pts - token_share x discount / 100 + fx_delta x fx / 100. Book P and L % of NAV = sum of weight / 100 x sleeve P and L. Shock multiple to the limit = limit / worst loss, exact because the map is linear.

## Conventions

- Every effect is first order and additive: sensitivity times shock, with no cross terms.
- rates_dv01_pct_per_100bp is signed as a P and L for rates up 100 bp, so a long bond sleeve is negative. spread_duration_years is signed as a duration, so positive loses when spreads widen.
- The token discount cost is the share held as tokens times the discount, in percent of the sleeve.
- fx_delta_pct is the percent of the sleeve exposed. Its P and L is that share times the currency's move.
- Weights are percent of NAV and need not add to 100. The rest is cash at zero P and L, and a total over 100 means borrowed exposure.
- All shocks hit at once, with no time to act. Sleeves are as sent, with no rebalancing.
- The worst scenario is the lowest book P and L. On a tie, the first one listed. Its driver is the single most negative factor, and the single most negative sleeve.
- With no scenarios, the set is generic shocks chosen for round numbers. They describe no event and carry no likelihood.

## Step 1: check your method on these made-up numbers

The numbers and names below are made up. They aren't market levels, typical values or anyone's real figures.

```json
{
  "sleeves": [
    {
      "name": "Long-short equity",
      "weight_pct": 30,
      "equity_beta": 0.5
    },
    {
      "name": "Credit carry",
      "weight_pct": 25,
      "equity_beta": 0.2,
      "rates_dv01_pct_per_100bp": -1,
      "spread_duration_years": 4
    },
    {
      "name": "Tokenized bills",
      "weight_pct": 15,
      "rates_dv01_pct_per_100bp": -0.25,
      "token_discount_share_pct": 100
    },
    {
      "name": "Tokenized property",
      "weight_pct": 20,
      "equity_beta": 0.1,
      "rates_dv01_pct_per_100bp": -3,
      "spread_duration_years": 3,
      "token_discount_share_pct": 100,
      "fx_delta_pct": 20
    },
    {
      "name": "Vol overlay",
      "weight_pct": 10,
      "equity_beta": -0.5,
      "vega_pct_per_vol_pt": 2
    }
  ],
  "scenarios": [
    {
      "name": "Equities fall",
      "equity_pct": -25,
      "rates_bps": -50,
      "spread_bps": 150,
      "vol_pts": 20,
      "token_discount_pct": 3,
      "fx_pct": -2
    },
    {
      "name": "Rates up, spreads wider",
      "equity_pct": -8,
      "rates_bps": 150,
      "spread_bps": 100,
      "vol_pts": 5,
      "token_discount_pct": 2,
      "fx_pct": 0
    },
    {
      "name": "Token discount opens",
      "equity_pct": -3,
      "rates_bps": 0,
      "spread_bps": 50,
      "vol_pts": 2,
      "token_discount_pct": 15,
      "fx_pct": 0
    },
    {
      "name": "Currency slides",
      "equity_pct": -2,
      "rates_bps": 0,
      "spread_bps": 0,
      "vol_pts": 2,
      "token_discount_pct": 1,
      "fx_pct": -15
    }
  ],
  "max_loss_pct": 5
}
```

Work them out with the method above. Yours should match these within 0.5%.

- Worst scenario, P and L: -6.16 % of NAV
- Largest factor in it: -5.25 % of NAV
- Largest sleeve in it: -3.36 % of NAV
- Offsets in it: 0.55 % of NAV
- Mildest scenario, P and L: -0.89 % of NAV
- Gross weight: 100 % of NAV
- Room to the limit: -1.16 % of NAV

Where the outcome flips, with the other inputs held:

- shock_multiple at 0.8116883117: At this multiple of the shocks, "Token discount opens" reaches the limit of 5% of NAV. The answer is exact because the map is linear.
- sleeves.3.weight_pct at 13.0952381: At this weight for "Tokenized property", with the others as sent, the worst of these scenarios reaches the limit of 5% of NAV.

If yours differ, stop and tell the person which ones and by how much. Don't go on to real numbers until they match, or until the person has seen the difference. These values come from one engine and can be wrong too.

## Step 2: run it on the person's numbers

Replace every input with the person's own. Ask for any number you don't have, and don't invent one.

## Step 3: report

Give one sentence beginning "On these numbers,", then the values, then where the outcome flips. Always add what this leaves out:

- Convexity and cross effects: gamma, rate convexity, and a vega that changes as the shock grows.
- How likely any scenario is, or how the shocks relate to one another.
- Sleeve moves that don't come through these six factors.
- Margin calls, financing, forced sales and the cost of getting out.
- A loss floor. A linear sensitivity can show a long sleeve losing more than its capital, and a flag says so.
- Taxes and fees.

## Limits

Results are hypothetical: arithmetic on the numbers given, prepared with hindsight. Nobody achieved them, and costs and liquidity are only as assumed. They aren't a forecast, a recommendation, an offer or a record of real trading. Don't say what to buy, sell or hold, and don't use them to market an investment. Whether a person may hold or trade an instrument is a legal question for counsel.

Provided as is, at your own risk, by hedgefund.md, which is not a fund and isn't anyone's adviser. Version 1.0. Source: https://hedgefund.md/models/stress_book/prompt.md. Terms: https://hedgefund.md/terms
