Models / Fund terms and risk / stress_book
Stress the book
What does each shock do to this book of sleeves, which shock is worst, and what drives it?
Applies shocks to equity, rates, spreads, vol, token discounts and FX across a book of weighted sleeves, using the sensitivities sent. Shows P and L by sleeve, factor and scenario, the worst scenario and what drove it. The sensitivities come from the caller. With no scenarios sent it uses generic shocks chosen for round numbers, not history. It is a first-order map, not a probability or a forecast.
On these numbers, the worst of 4 scenarios is "Token discount opens" at -6.16% of NAV, driven most by Token discount at -5.25 and the sleeve "Tokenized property" at -3.36, past the limit of 5%.
Hypothetical, and on made-up numbers until you replace them. Nobody traded this, and nothing here is on offer.
Readings
The numbers, with their units.
Worst scenario, P and L
breach-6.16%of NAV
Token discount opens
Largest factor in it
-5.25%of NAV
Token discount
Largest sleeve in it
-3.36%of NAV
Tokenized property
Offsets in it
0.55%of NAV
The sleeves that gain in that scenario.
Mildest scenario, P and L
-0.89%of NAV
Currency slides
Gross weight
100%of NAV
Net 100%.
Room to the limit
breach-1.16%of NAV
Limit 5%.
What flips it
The value of one input where the outcome changes, with the others held.
shock_multiple
0.811688
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
13.1% of NAVnow 20
At this weight for "Tokenized property", with the others as sent, the worst of these scenarios reaches the limit of 5% of NAV.
Flags
What went past a line, and what to read before you trust the rest.
- breach"Token discount opens" loses 6.16% of NAV, past the limit of 5%. limit_breach
What this leaves out
What the formula leaves out, by name.
- 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.
What it took as given (8)
What it took as given to get here.
- 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.
The data
The data
P and L by sleeve and scenario, % of NAV
| Sleeve | Weight % | Equities fall | Rates up, spreads wider | Token discount opens | Currency slides |
|---|---|---|---|---|---|
| Long-short equity | 30 | -3.75 | -1.2 | -0.45 | -0.3 |
| Credit carry | 25 | -2.625 | -1.775 | -0.65 | -0.1 |
| Tokenized bills | 15 | -0.43125 | -0.35625 | -2.25 | -0.15 |
| Tokenized property | 20 | -1.78 | -2.06 | -3.36 | -0.84 |
| Vol overlay | 10 | 5.25 | 1.4 | 0.55 | 0.5 |
| Book | 100 | -3.3363 | -3.9912 | -6.16 | -0.89 |
P and L by factor and scenario, % of NAV
| Scenario | Equity | Rates | Spread | Vol | Token discount | FX | Book |
|---|---|---|---|---|---|---|---|
| Equities fall | -4.25 | 0.44375 | -2.4 | 4 | -1.05 | -0.08 | -3.3363 |
| Rates up, spreads wider | -1.36 | -1.3313 | -1.6 | 1 | -0.7 | 0 | -3.9912 |
| Token discount opens | -0.51 | 0 | -0.8 | 0.4 | -5.25 | 0 | -6.16 |
| Currency slides | -0.34 | 0 | 0 | 0.4 | -0.35 | -0.6 | -0.89 |
Sleeve P and L before weights, % of the sleeve
| Sleeve | Equities fall | Rates up, spreads wider | Token discount opens | Currency slides |
|---|---|---|---|---|
| Long-short equity | -12.5 | -4 | -1.5 | -1 |
| Credit carry | -10.5 | -7.1 | -2.6 | -0.4 |
| Tokenized bills | -2.875 | -2.375 | -15 | -1 |
| Tokenized property | -8.9 | -10.3 | -16.8 | -4.2 |
| Vol overlay | 52.5 | 14 | 5.5 | 5 |
Paste it into your agent
No connection needed. This prompt carries the method, the conventions and what this site's engine gives on the made-up numbers, so your agent can check its own work before it touches real ones. Every prompt, with its hash, is listed at /prompts.json. A copy that stays fixed for this version, for a stack to point at: /v/1.0/models/stress_book.md.
# Stress the book: a prompt from hedgefund.mdPaste 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?## MethodSleeve 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 numbersThe 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 NAVWhere 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 numbersReplace every input with the person's own. Ask for any number you don't have, and don't invent one.## Step 3: reportGive 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.## LimitsResults 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/termsCall it
The same code answers on this page, over HTTP, over MCP and on your own machine, and the same inputs give the same bytes. No key, and nothing is stored. Send positions by POST or run the library, because a URL can land in a server log. model.md holds all of this for your agent.
POST the inputs to /api/v1/stress_book.
curl -s https://hedgefund.md/api/v1/stress_book \ -H 'content-type: application/json' \ -d '{"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}' \ | jq '{summary, flags, flips, not_modeled, inputs_hash}'The tool is stress_book on https://hedgefund.md/mcp.
curl -s https://hedgefund.md/mcp \ -H 'content-type: application/json' -H 'accept: application/json' \ -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"stress_book","arguments":{"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}}}' \ | jq '.result.structuredContent | {summary, flags, flips, not_modeled, inputs_hash}'One file with no dependencies, and nothing is sent anywhere.
curl -fsSL https://hedgefund.md/hedgefund.mjs -o hedgefund.mjs # read it before you run itnode hedgefund.mjs template stress_book > mine.json # replace every number in itnode hedgefund.mjs run stress_book mine.json | jq '{summary, flags, flips, not_modeled, inputs_hash}'Made-up numbers that run as they stand. Replace every one.
{ "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}Inputs
| Input | Type | Range | Required | What it is |
|---|---|---|---|---|
| sleeves | array | 1 to 40 items | yes | The book. Weights are percent of NAV. Whatever they don't cover is cash at zero P and L. |
| sleeves[].name | string | yes | A label, such as Credit carry. | |
| sleeves[].weight_pct | number | -500 to 500 | yes | Weight in percent of NAV. Negative for a short sleeve. |
| sleeves[].equity_beta | number | -20 to 20 | no | Percent the sleeve moves per 1% on equities. |
| sleeves[].rates_dv01_pct_per_100bp | number | -100 to 100 | no | Percent the sleeve gains when rates rise 100 bp. A long bond sleeve is negative: about -5 for a 5-year. |
| sleeves[].spread_duration_years | number | -50 to 50 | no | Spread duration in years. Positive loses when spreads widen. |
| sleeves[].vega_pct_per_vol_pt | number | -50 to 50 | no | Percent the sleeve gains per vol point up. |
| sleeves[].token_discount_share_pct | number | 0 to 100 | no | Share of the sleeve held as tokens that can trade under NAV, in percent. |
| sleeves[].fx_delta_pct | number | -500 to 500 | no | Percent of the sleeve exposed to the foreign currency. Gains when that currency rises. |
| scenarios | array | 0 to 40 items | no | Shocks. Leave out to use generic shocks, not history. |
| scenarios[].name | string | yes | A label for the shock. | |
| scenarios[].equity_pct | number | -100 to 300 | no | Equity move in percent. |
| scenarios[].rates_bps | number | -2000 to 2000 | no | Rate move in basis points. |
| scenarios[].spread_bps | number | -2000 to 5000 | no | Spread move in basis points. Up is wider. |
| scenarios[].vol_pts | number | -100 to 300 | no | Implied vol move in vol points. |
| scenarios[].token_discount_pct | number | 0 to 100 | no | Discount of tokens to NAV in percent. |
| scenarios[].fx_pct | number | -100 to 300 | no | Move of the foreign currency in percent. |
| max_loss_pct | number | over 0 to 100 | no | Optional limit on a scenario's loss, in percent of NAV. |
Hypothetical, and on made-up numbers until you replace them. Nobody traded this, and nothing here is on offer.