HEDGEFUND.md

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.

The paste-ready promptmodel.md

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.

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

  2. 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.
What each constraint allows
010M20MKelly fractionVol budgetStopVolume cap
The data
Square-root impact against sizebps, one way
1002003004005M10M15M20MSize398.41
The data

What each constraint allows

ConstraintAllows% of NAVImpact one way, bpsDays to exit
Kelly fraction22,222,22222.22398.4129.63
Vol budget6,666,6676.6667218.228.8889
Stop20,000,00020377.9626.67
Volume cap3,750,0003.75163.665

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

inputs_hash e696c758206801d0

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.

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

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

Inputs

InputTypeRangeRequiredWhat it is
navnumberover 0 to 10000000000000yesNAV in money.
vol_pctnumber0 to 500yesAnnual vol of the position in percent.
expected_return_pctnumber-100 to 500yesExpected return a year in percent, read as over the funding cost. The caller's own estimate.
kelly_fractionnumberover 0 to 2noFraction of full Kelly. 0.25 means a quarter.
risk_budget_pct_navnumber0 to 100yesRisk budget in percent of NAV: one year's vol for the vol budget, the loss at the stop for the stop.
stop_pctnumber0 to 100noOptional stop distance in percent of the position's value.
adv_valuenumber0 to 10000000000000yesAverage daily traded value, in money.
max_participation_pctnumber0 to 100yesMost of the daily value to trade, in percent.
days_to_buildnumber1 to 252yesTrading days allowed to build the position.
impact_coeffnumber0 to 10noCoefficient on the square-root impact.
trading_days_per_yearwhole number200 to 366noDays 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.

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.