# Credit carry: 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 would this list of credits earn on these spreads, what does one default cost, and how much widening takes the year's carry back?

## Method

Hazard h = spread / (1 - R). One-year default chance = 1 - exp(-h). Carry = notional * spread. Jump to default = notional * (1 - R). Spread DV01 = notional * duration * 0.0001. Expected loss = real-world default rate * (1 - R). Break-even widening over a year = spread / duration, and for the book, total carry / total DV01.

## Conventions

- Every credit is held long: it earns its spread and takes the loss at default.
- The hazard rate is the market-implied rate from the spread, flat over time. It carries a risk premium, so it isn't a real-world default forecast. The real-world rate is a separate number from the caller.
- Carry is notional times spread for one year, with no funding cost and no compounding.
- Jump to default is measured from par: notional * (1 - R), with no accrued interest and no mark.
- The widening table is first order: DV01 times the move, every credit moving by the same basis points, with duration fixed.
- Break-even widening compares one year's carry to a mark at a fixed duration, with no roll-down. The book's figure is total carry over total DV01, which isn't the average of the names' figures.
- Expected loss per year is the real-world default rate times (1 - R), in the same simple form the spread is quoted in.
- The sleeve's tail is the larger of the largest jump to default and the worst row of the widening table.

## 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
{
  "nav": 10000000,
  "credits": [
    {
      "name": "Credit A",
      "notional": 4000000,
      "spread_bps": 120,
      "recovery_pct": 40,
      "spread_duration_years": 4.5,
      "real_world_pd_pct": 0.5
    },
    {
      "name": "Credit B",
      "notional": 2000000,
      "spread_bps": 250,
      "recovery_pct": 40,
      "spread_duration_years": 4,
      "real_world_pd_pct": 1.5
    },
    {
      "name": "Credit C",
      "notional": 2000000,
      "spread_bps": 420,
      "recovery_pct": 35,
      "spread_duration_years": 3.5,
      "real_world_pd_pct": 3
    },
    {
      "name": "Credit D",
      "notional": 1000000,
      "spread_bps": 650,
      "recovery_pct": 30,
      "spread_duration_years": 3,
      "real_world_pd_pct": 10
    },
    {
      "name": "Credit E",
      "notional": 1000000,
      "spread_bps": 900,
      "recovery_pct": 25,
      "spread_duration_years": 2.5
    }
  ],
  "widening_bps": [25, 50, 100, 200, 400]
}
```

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

- Hypothetical carry per year: 337000
- Book spread DV01: 3850 per basis point
- Break-even widening, one year: 87.53246753 bps
- Largest jump to default: 2400000
- Largest jump, share of NAV: 24 %
- Largest jump, in years of carry: 7.121661721 years
- Effective number of names: 3.846153846
- Excess spread over expected loss: 120 bps

Where the outcome flips, with the other inputs held:

- widening_bps at 87.53246753: Over one year, a parallel widening of this size takes back the whole book's carry, at fixed duration.
- credits.3.real_world_pd_pct at 9.285714286: Credit D: above this yearly default rate, the spread no longer covers expected loss.
- credits.0.real_world_pd_pct at 2: Credit A: above this yearly default rate, the spread no longer covers expected loss.
- credits.1.real_world_pd_pct at 4.166666667: Credit B: above this yearly default rate, the spread no longer covers expected loss.
- credits.2.real_world_pd_pct at 6.461538462: Credit C: above this yearly default rate, the spread no longer covers expected loss.
- credits.3.recovery_pct at 35: Credit D: below this recovery, the spread no longer covers expected loss at the default rate sent.

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:

- Correlation between defaults. Jump to default is one name at a time.
- Spread convexity and roll-down. Duration stays fixed as spreads move and time passes.
- Funding and financing of the positions.
- Rating moves, curve shape and any gap between a bond's spread and a hedge's.
- Bid-ask, liquidity and market impact on exit.
- Accrued interest at default, recovery timing and legal process.
- Taxes.

## 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/credit_carry/prompt.md. Terms: https://hedgefund.md/terms
