# Private credit tape: 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.** How do this loan tape's losses and interest fall through its tranches, and how much sits under the senior at a 1% chance of impairment?

## Method

Each path draws a market factor Z and one e per loan. A loan defaults within the horizon if sqrt(rho) Z + sqrt(1 - rho) e < normInv(1 - (1 - pd)^H). Pool loss is the sum of balance * LGD over defaults. Each tranche takes min(max(loss - attach, 0), size). Interest pays servicing, then coupons senior first.

## Conventions

- Draw order on each path is Z, then one e per loan in list order, from one stream seeded by the seed and the model's id. Correlation and default rates change thresholds, not draws, so moving them keeps the same paths.
- Interest is simple. A performing loan pays balance * rate * H. A defaulted loan pays for half the horizon, as if it defaulted at the midpoint.
- Servicing is charged on the starting pool for the whole horizon and is paid first from interest.
- Coupons are due on each tranche's starting size for the whole horizon, even after a write-down. Interest and principal run separately: excess interest is reported and doesn't absorb losses.
- Losses hit the most junior tranche first and are taken in full at the horizon. A loss landing exactly on an attachment point impairs nothing above it. A tranche's loss figures are percents of its own size, and pool figures are percents of the pool.
- Coupon cover for a tranche is mean interest after servicing, over the coupons due on that tranche and everything senior to it.
- Percentiles use linear interpolation between order statistics, except the junior size. That one is an order statistic: the smallest size with at most 1% of these paths above it, recounted from the same draws, and rounded up at the tenth digit so it still passes when sent back.
- Correlation moves losses between tranches, but it leaves the pool's expected loss alone. The exact figure is the sum of balance * LGD * (1 - (1 - pd)^H) over the pool.
- The sleeve is for the whole pool: gross and net are 100, tail is the 99th percentile pool loss, and carry is mean interest after servicing, per year.

## 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
{
  "loans": [
    {
      "name": "Loan 1",
      "balance": 20000000,
      "rate_pct": 9,
      "pd_annual_pct": 1.5,
      "lgd_pct": 40
    },
    {
      "name": "Loan 2",
      "balance": 12000000,
      "rate_pct": 10,
      "pd_annual_pct": 2,
      "lgd_pct": 45
    },
    {
      "name": "Loan 3",
      "balance": 10000000,
      "rate_pct": 10,
      "pd_annual_pct": 2,
      "lgd_pct": 45
    },
    {
      "name": "Loan 4",
      "balance": 10000000,
      "rate_pct": 11,
      "pd_annual_pct": 3,
      "lgd_pct": 50
    },
    {
      "name": "Loan 5",
      "balance": 8000000,
      "rate_pct": 11,
      "pd_annual_pct": 3,
      "lgd_pct": 50
    },
    {
      "name": "Loan 6",
      "balance": 8000000,
      "rate_pct": 12,
      "pd_annual_pct": 4,
      "lgd_pct": 55
    },
    {
      "name": "Loan 7",
      "balance": 8000000,
      "rate_pct": 12,
      "pd_annual_pct": 4,
      "lgd_pct": 55
    },
    {
      "name": "Loan 8",
      "balance": 6000000,
      "rate_pct": 13,
      "pd_annual_pct": 5,
      "lgd_pct": 60
    },
    {
      "name": "Loan 9",
      "balance": 6000000,
      "rate_pct": 13,
      "pd_annual_pct": 5,
      "lgd_pct": 60
    },
    {
      "name": "Loan 10",
      "balance": 5000000,
      "rate_pct": 14,
      "pd_annual_pct": 6,
      "lgd_pct": 60
    },
    {
      "name": "Loan 11",
      "balance": 4000000,
      "rate_pct": 15,
      "pd_annual_pct": 8,
      "lgd_pct": 65
    },
    {
      "name": "Loan 12",
      "balance": 3000000,
      "rate_pct": 16,
      "pd_annual_pct": 10,
      "lgd_pct": 70
    }
  ],
  "tranches": [
    { "name": "Senior", "size_pct": 75, "coupon_pct": 6.5 },
    { "name": "Mezzanine", "size_pct": 15, "coupon_pct": 10 },
    { "name": "Junior", "size_pct": 10, "coupon_pct": 12 }
  ],
  "asset_correlation_pct": 20,
  "horizon_years": 3,
  "servicing_bps": 50,
  "sims": 5000,
  "seed": 7
}
```

Work them out with the method above. These values come from random paths, so yours won't match exactly: treat a gap over 10% as a problem.

- Pool expected loss: 5.41948 % of pool
- Monte Carlo error on that: 0.08423465796 % of pool
- Pool loss stdev: 5.956289785 % of pool
- Pool loss, 95th percentile: 17.4 % of pool
- Pool loss, 99th percentile: 25.8 % of pool
- Size under the senior for a 1% chance: 25.8 % of pool
- Senior impairment chance: 1.2 %
- Mean excess interest: 7.687647 % of pool

Where the outcome flips, with the other inputs held:

- junior_size_pct at 25.8: With less than this much under the senior, more than 1% of these paths impair it.
- asset_correlation_pct at 16.81566238: Above this correlation, more than 1% of these same paths impair the senior.
- default_rate_multiple at 0.891404079: Above this multiple of every loan's default rate, more than 1% of these same paths impair the senior.

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:

- Prepayment, amortization and new loans. Each balance stays flat until the horizon.
- Recovery timing. A loss is taken in full at the horizon, with no workout period.
- Coverage triggers, cash traps and any turbo that would redirect excess interest to principal.
- Default timing beyond the midpoint convention, and correlation that changes in stress.
- Fat tails: the copula is Gaussian, so joint extreme defaults are thin compared with a heavier-tailed one.
- Rate changes on floating loans, hedges, reserve accounts and fees other than servicing.
- Secondary-market prices, liquidity and, for tokenized notes, anything about the chain, the wrapper or transfer limits.
- 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/private_credit_tape/prompt.md. Terms: https://hedgefund.md/terms
