HEDGEFUND.md

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.

The paste-ready promptmodel.md

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.

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

  2. 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.
Book P and L by scenario% of NAV
-6-5-4-3-2-10Equities fallEquities fallEquities fall, Book P and L: -3.3363-3.3363Rates up, spreads widerRates up, spreads widerRates up, spreads wider, Book P and L: -3.9912-3.9912Token discount opensToken discount opensToken discount opens, Book P and L: -6.16-6.16Currency slidesCurrency slidesCurrency slides, Book P and L: -0.89-0.89limit -5
The data
What drove "Token discount opens"% of NAV
-5-4-3-2-10EquityRatesSpreadVolToken discountFX
The data

P and L by sleeve and scenario, % of NAV

SleeveWeight %Equities fallRates up, spreads widerToken discount opensCurrency slides
Long-short equity30-3.75-1.2-0.45-0.3
Credit carry25-2.625-1.775-0.65-0.1
Tokenized bills15-0.43125-0.35625-2.25-0.15
Tokenized property20-1.78-2.06-3.36-0.84
Vol overlay105.251.40.550.5
Book100-3.3363-3.9912-6.16-0.89

P and L by factor and scenario, % of NAV

ScenarioEquityRatesSpreadVolToken discountFXBook
Equities fall-4.250.44375-2.44-1.05-0.08-3.3363
Rates up, spreads wider-1.36-1.3313-1.61-0.70-3.9912
Token discount opens-0.510-0.80.4-5.250-6.16
Currency slides-0.34000.4-0.35-0.6-0.89

Sleeve P and L before weights, % of the sleeve

SleeveEquities fallRates up, spreads widerToken discount opensCurrency 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 overlay52.5145.55

Hypothetical, computed from the numbers sent and any stated default, with hindsight. Nobody traded it, and costs and liquidity are only as assumed. Not a forecast, a recommendation, an offer, or a record of real trading. Don't use it to market an investment.

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

inputs_hash d9e6f0a143687165

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.

prompt.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/terms

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

terminal
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}'

Inputs

InputTypeRangeRequiredWhat it is
sleevesarray1 to 40 itemsyesThe book. Weights are percent of NAV. Whatever they don't cover is cash at zero P and L.
sleeves[].namestringyesA label, such as Credit carry.
sleeves[].weight_pctnumber-500 to 500yesWeight in percent of NAV. Negative for a short sleeve.
sleeves[].equity_betanumber-20 to 20noPercent the sleeve moves per 1% on equities.
sleeves[].rates_dv01_pct_per_100bpnumber-100 to 100noPercent the sleeve gains when rates rise 100 bp. A long bond sleeve is negative: about -5 for a 5-year.
sleeves[].spread_duration_yearsnumber-50 to 50noSpread duration in years. Positive loses when spreads widen.
sleeves[].vega_pct_per_vol_ptnumber-50 to 50noPercent the sleeve gains per vol point up.
sleeves[].token_discount_share_pctnumber0 to 100noShare of the sleeve held as tokens that can trade under NAV, in percent.
sleeves[].fx_delta_pctnumber-500 to 500noPercent of the sleeve exposed to the foreign currency. Gains when that currency rises.
scenariosarray0 to 40 itemsnoShocks. Leave out to use generic shocks, not history.
scenarios[].namestringyesA label for the shock.
scenarios[].equity_pctnumber-100 to 300noEquity move in percent.
scenarios[].rates_bpsnumber-2000 to 2000noRate move in basis points.
scenarios[].spread_bpsnumber-2000 to 5000noSpread move in basis points. Up is wider.
scenarios[].vol_ptsnumber-100 to 300noImplied vol move in vol points.
scenarios[].token_discount_pctnumber0 to 100noDiscount of tokens to NAV in percent.
scenarios[].fx_pctnumber-100 to 300noMove of the foreign currency in percent.
max_loss_pctnumberover 0 to 100noOptional 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.

1.0Use at your own risk: hedgefund.md is not a fund, not an offer of any security, token or fund interest, and not advice. Results are hypothetical, may be wrong, and are not a record of real trading. Don't use them to market an investment. See the terms.