Models / Fund terms and risk / size_position
Position size limits
What does each constraint allow for this position, and which one is smallest?
Shows what a Kelly fraction, a vol budget, a stop and a volume cap each allow for one position, with square-root impact and days to exit at each size. All numbers come from the caller. It states what each constraint allows on those numbers. It is not a size to take and not a view on the position.
On these numbers, the constraints allow from 3,750,000 to 22,222,222.22, and the smallest is the volume cap at 3.75% of NAV, with 163.66 bps of one-way impact and 5 days to exit, which is what each constraint allows, not a size to take.
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.
Kelly fraction allows
22,222,222
22.22% of NAV. Full Kelly is 0.89 times NAV.
Vol budget allows
6,666,667
6.67% of NAV.
Stop allows
20,000,000
20% of NAV.
Volume cap allows
3,750,000
3.75% of NAV.
Smallest of these
3,750,000
Volume cap is the smallest.
Impact at the smallest, one way
163.66bps
Days to exit at the smallest
5days
At 15% of ADV.
What flips it
The value of one input where the outcome changes, with the others held.
expected_return_pct
1.35%now 8
Below this expected return, the Kelly fraction is the smallest limit. Above it, the volume cap is, at 3,750,000.
days_to_build
8.8889daysnow 5
Below this many days, the volume cap is the smallest limit. Above it, the vol budget is, at 6,666,666.67.
What this leaves out
What the formula leaves out, by name.
- 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.
What it took as given (7)
What it took as given to get here.
- 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.
The data
The data
What each constraint allows
| Constraint | Allows | % of NAV | Impact one way, bps | Days to exit |
|---|---|---|---|---|
| Kelly fraction | 22,222,222 | 22.22 | 398.41 | 29.63 |
| Vol budget | 6,666,667 | 6.6667 | 218.22 | 8.8889 |
| Stop | 20,000,000 | 20 | 377.96 | 26.67 |
| Volume cap | 3,750,000 | 3.75 | 163.66 | 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/size_position.md.
# Position size limits: 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 constraint allow for this position, and which one is smallest?## MethodKelly: 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 numbersThe 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 daysWhere 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 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:- 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.## 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/size_position/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/size_position.
curl -s https://hedgefund.md/api/v1/size_position \ -H 'content-type: application/json' \ -d '{"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}' \ | jq '{summary, flags, flips, not_modeled, inputs_hash}'The tool is size_position 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":"size_position","arguments":{"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}}}' \ | 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 size_position > mine.json # replace every number in itnode hedgefund.mjs run size_position mine.json | jq '{summary, flags, flips, not_modeled, inputs_hash}'Made-up numbers that run as they stand. Replace every one.
{ "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}Inputs
| Input | Type | Range | Required | What it is |
|---|---|---|---|---|
| nav | number | over 0 to 10000000000000 | yes | NAV in money. |
| vol_pct | number | 0 to 500 | yes | Annual vol of the position in percent. |
| expected_return_pct | number | -100 to 500 | yes | Expected return a year in percent, read as over the funding cost. The caller's own estimate. |
| kelly_fraction | number | over 0 to 2 | no | Fraction of full Kelly. 0.25 means a quarter. |
| risk_budget_pct_nav | number | 0 to 100 | yes | Risk budget in percent of NAV: one year's vol for the vol budget, the loss at the stop for the stop. |
| stop_pct | number | 0 to 100 | no | Optional stop distance in percent of the position's value. |
| adv_value | number | 0 to 10000000000000 | yes | Average daily traded value, in money. |
| max_participation_pct | number | 0 to 100 | yes | Most of the daily value to trade, in percent. |
| days_to_build | number | 1 to 252 | yes | Trading days allowed to build the position. |
| impact_coeff | number | 0 to 10 | no | Coefficient on the square-root impact. |
| trading_days_per_year | whole number | 200 to 366 | no | Days a year for turning annual vol into daily vol: 252, or 365 for assets that trade every day. |
Hypothetical, and on made-up numbers until you replace them. Nobody traded this, and nothing here is on offer.