# Position size limits: 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 constraint allow for this position, and which one is smallest?

## Method

Kelly: f = mu / sigma^2, allowed = fraction x f x NAV. Vol budget: budget x NAV / sigma. Stop: budget x NAV / stop. Volume: participation x ADV x days_to_build. Impact in bps = coeff x daily vol x sqrt(size / ADV) x 10000, daily vol = sigma / sqrt(trading days). Days to exit = size / (participation x ADV). Flip: mu* = next limit / NAV x sigma^2 / fraction.

## Conventions

- mu and sigma are annual fractions in the Kelly formula: 8% and 30% give 0.08 / 0.09 = 0.89 of NAV before the fraction.
- expected_return_pct is read as the return over the funding cost, as the Kelly formula needs. It is the caller's estimate.
- Below zero expected return, the Kelly limit is zero on this side. A short has its own expected return to send.
- The risk budget means one year of vol for the vol budget, and the loss at the stop for the stop limit.
- Daily vol is annual vol / sqrt(trading_days_per_year), 252 unless sent. Impact is one way, for the whole size traded against one day's ADV, and a round trip pays it twice.
- Each limit is figured alone, with no leverage cap. A limit over NAV means borrowed exposure, and a flag says so.
- On a tie for the smallest, the first in the order Kelly, vol budget, stop, volume is named, and the note names the others.

## 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": 100000000,
  "vol_pct": 30,
  "expected_return_pct": 8,
  "kelly_fraction": 0.25,
  "risk_budget_pct_nav": 2,
  "stop_pct": 10,
  "adv_value": 5000000,
  "max_participation_pct": 15,
  "days_to_build": 5,
  "impact_coeff": 1
}
```

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

- Kelly fraction allows: 22222222.22
- Vol budget allows: 6666666.667
- Stop allows: 20000000
- Volume cap allows: 3750000
- Smallest of these: 3750000
- Impact at the smallest, one way: 163.6634177 bps
- Days to exit at the smallest: 5 days

Where the outcome flips, with the other inputs held:

- expected_return_pct at 1.35: Below this expected return, the Kelly fraction is the smallest limit. Above it, the volume cap is, at 3,750,000.
- days_to_build at 8.888888889: Below this many days, the volume cap is the smallest limit. Above it, the vol budget is, at 6,666,666.67.

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 with the rest of the book. Each limit sees this one position alone.
- Gaps through a stop. The stop limit assumes the exit is at the stop.
- Error in the estimates. Kelly moves one for one with expected return and with the inverse square of vol.
- Financing, borrow, margin, taxes and fees.
- How impact builds and decays over days, or the effect of showing the trade.
- A fall in ADV when the position needs to exit.

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