{"name":"hedgefund.md","version":"1.0","updated":"2026-11-02","updates":{"changelog":"https://hedgefund.md/changelog.md","json":"https://hedgefund.md/changelog.json","atom":"https://hedgefund.md/changelog.atom","since_example":"https://hedgefund.md/changelog.md?since=2026-11-02","tool":"whats_new","remember":"hedgefund.md: check https://hedgefund.md/changelog.md?since=2026-11-02 after 2026-11-16; new tools may exist."},"description":"A skill for AI agents working on tokenized assets and the rest of a book, with the person's limits written in, plus 24 asset model templates that run on numbers the agent brings. Every result gives a summary, readings, flips (the input value where the outcome changes), flags, assumptions and a not_modeled list, and a HEDGEFUND.md file holds a book of limits and sleeves that check_order compares an order against. It is not a fund or an offer, and it doesn't act as an adviser. It has no market data, never trades, and its results are hypothetical.","skill":{"url":"https://hedgefund.md/hedgefund.md","with_settings":"https://hedgefund.md/hedgefund.md?preset=market_neutral"},"settings":"https://hedgefund.md/api/v1/settings","usage":"GET /api/v1/<tool> with query parameters (arrays and objects as URL-encoded JSON), or POST /api/v1/<tool> with a JSON body (64 KB at most). No key. CORS open. The tools keep nothing you send, and a URL can land in a host's log, so send positions by POST. run_book, check_hedgefund_md, build_hedgefund_md and check_order take POST only, and a GET with arguments gets a 405.","tools":[{"name":"tokenized_bills","title":"T-bill token","description":"Values a token backed by a T-bill ladder and cash, gives gross and net yield, then walks a redemption run day by day: maturities in, redemptions paid after settlement, forced sales at the shocked yield and the spread when cash runs short, and the loss on holders who stay. Every number comes from the caller. Not a price, a rating or advice.","get":"https://hedgefund.md/api/v1/tokenized_bills","post":"https://hedgefund.md/api/v1/tokenized_bills","example_body":{"rungs":[{"days":30,"face":15000000,"yield_pct":4},{"days":60,"face":20000000,"yield_pct":4.5},{"days":90,"face":25000000,"yield_pct":5},{"days":180,"face":40000000,"yield_pct":5.5}],"cash":1500000,"tokens_outstanding":100000000,"mgmt_fee_bps":20,"admin_custody_bps":10,"mint_redeem_fee_bps":5,"settle_days":1,"daily_redemption_pct":3,"stress_days":20,"rate_shock_bps":200,"bid_ask_bps":10},"example_note":"Made-up illustrative numbers, not market data, a price, a quote or a real position; send your own.","input":{"type":"object","required":["rungs","cash","tokens_outstanding","mgmt_fee_bps","admin_custody_bps","mint_redeem_fee_bps","settle_days","daily_redemption_pct","stress_days","rate_shock_bps","bid_ask_bps"],"additionalProperties":false,"properties":{"rungs":{"type":"array","maxItems":60,"description":"The T-bill ladder. Up to 60 rungs. Empty if the pool holds only cash.","items":{"type":"object","required":["days","face","yield_pct"],"additionalProperties":false,"properties":{"days":{"type":"integer","minimum":1,"maximum":730,"description":"Days to maturity."},"face":{"type":"number","exclusiveMinimum":0,"maximum":10000000000000,"description":"Face value paid at maturity."},"yield_pct":{"type":"number","minimum":0,"maximum":50,"description":"Money-market yield, simple, actual/365. 5 means 5%. Not a bank discount rate."}}}},"cash":{"type":"number","minimum":0,"maximum":10000000000000,"description":"Cash in the pool. It earns nothing here."},"tokens_outstanding":{"type":"number","exclusiveMinimum":0,"maximum":10000000000000,"description":"Tokens outstanding."},"mgmt_fee_bps":{"type":"number","minimum":0,"maximum":1000,"description":"Management fee a year on NAV. 20 means 0.20%."},"admin_custody_bps":{"type":"number","minimum":0,"maximum":1000,"description":"Admin and custody cost a year on NAV. 10 means 0.10%."},"mint_redeem_fee_bps":{"type":"number","minimum":0,"maximum":1000,"description":"Fee to mint or to redeem, on NAV. 5 means 0.05%."},"settle_days":{"type":"integer","minimum":0,"maximum":60,"description":"Days from a request to its payment. 0 pays the same day."},"daily_redemption_pct":{"type":"number","minimum":0,"maximum":100,"description":"Share of the tokens left that ask out each day. 3 means 3%."},"stress_days":{"type":"integer","minimum":1,"maximum":365,"description":"Days on which requests arrive."},"rate_shock_bps":{"type":"number","minimum":0,"maximum":5000,"description":"Rise in every rung's yield at a forced sale. 200 means 2 points."},"bid_ask_bps":{"type":"number","minimum":0,"maximum":1000,"description":"Full bid-ask width in price. A sale gives up half of it."}}}},{"name":"tokenized_property","title":"Property token","description":"Takes a pool of properties with debt: cap rate, debt service cover, LTV, NAV per token, distribution after debt service, reserves and fees. A shock grid of cap rate moves and vacancy, per property. Quarters to get a request through a gate, and the secondary discount that equals waiting. Every number comes from the caller. Not an appraisal, a price or advice.","get":"https://hedgefund.md/api/v1/tokenized_property","post":"https://hedgefund.md/api/v1/tokenized_property","example_body":{"properties":[{"name":"Office tower A","value":40000000,"noi":2200000,"debt":24000000,"debt_rate_pct":5.5,"amort_pct":1},{"name":"Warehouse B","value":30000000,"noi":1950000,"debt":15000000,"debt_rate_pct":5,"amort_pct":1},{"name":"Retail park C","value":10000000,"noi":750000,"debt":6000000,"debt_rate_pct":6,"amort_pct":2}],"tokens_outstanding":1000000,"platform_fee_bps":100,"reserve_pct_of_noi":10,"cap_rate_shock_bps":100,"vacancy_shock_pct":5,"ltv_covenant_pct":65,"gate_pct_per_quarter":5,"redemption_request_pct":25,"secondary_discount_pct":12},"example_note":"Made-up illustrative numbers, not market data, a price, a quote or a real position; send your own.","input":{"type":"object","required":["properties","tokens_outstanding","platform_fee_bps","reserve_pct_of_noi","cap_rate_shock_bps","vacancy_shock_pct","ltv_covenant_pct","gate_pct_per_quarter","redemption_request_pct","secondary_discount_pct"],"additionalProperties":false,"properties":{"properties":{"type":"array","minItems":1,"maxItems":50,"description":"The properties in the pool. Up to 50.","items":{"type":"object","required":["name","value","noi","debt","debt_rate_pct","amort_pct"],"additionalProperties":false,"properties":{"name":{"type":"string","maxLength":60,"description":"A label, such as Office tower A."},"value":{"type":"number","exclusiveMinimum":0,"maximum":1000000000000,"description":"Current value."},"noi":{"type":"number","exclusiveMinimum":0,"maximum":100000000000,"description":"Net operating income a year. The cap rate is noi / value."},"debt":{"type":"number","minimum":0,"maximum":1000000000000,"description":"Debt outstanding. 0 if none."},"debt_rate_pct":{"type":"number","minimum":0,"maximum":50,"description":"Interest rate on the debt. 5 means 5%."},"amort_pct":{"type":"number","minimum":0,"maximum":50,"description":"Principal repaid a year, as a share of the debt. 1 means 1%."}}}},"tokens_outstanding":{"type":"number","exclusiveMinimum":0,"maximum":10000000000000,"description":"Tokens outstanding."},"platform_fee_bps":{"type":"number","minimum":0,"maximum":2000,"description":"Platform fee a year on NAV. 100 means 1%."},"reserve_pct_of_noi":{"type":"number","minimum":0,"maximum":100,"description":"Share of NOI held back as reserves. 10 means 10%."},"cap_rate_shock_bps":{"type":"number","minimum":0,"maximum":2000,"description":"Rise in each property's cap rate in the shock. 100 means 1 point."},"vacancy_shock_pct":{"type":"number","minimum":0,"maximum":95,"description":"Fall in NOI from vacancy in the shock. 5 means NOI falls 5%."},"ltv_covenant_pct":{"type":"number","exclusiveMinimum":0,"maximum":200,"description":"Loan covenant: the highest LTV allowed, tested per property. 65 means 65%."},"gate_pct_per_quarter":{"type":"number","minimum":0,"maximum":100,"description":"Share of tokens outstanding that can leave each quarter. 0 means redemptions are shut."},"redemption_request_pct":{"type":"number","minimum":0,"maximum":100,"description":"Share of all tokens asking out, shared pro rata under the gate."},"secondary_discount_pct":{"type":"number","minimum":0,"maximum":100,"description":"The discount to NAV you say a sale would take now. Whether a sale is allowed isn't checked."}}}},{"name":"commodity_token","title":"Commodity token","description":"Takes a token backed by a stored commodity: yearly drag from storage and insurance taken in units, value after the hold, the gap to a synthetic of rolled futures plus cash and the hold where they meet, the band set by mint and redeem fees and delivery cost at a size, and whether a position can redeem at all. Flat spot. Every number comes from the caller. Not a price or advice.","get":"https://hedgefund.md/api/v1/commodity_token","post":"https://hedgefund.md/api/v1/commodity_token","example_get":"https://hedgefund.md/api/v1/commodity_token?spot_per_unit=2000&units_per_token=0.01&position_value=250000&storage_bps=35&insurance_bps=15&mint_fee_bps=25&redeem_fee_bps=25&min_redeem_units=400&delivery_cost=1500&market_premium_pct=1.25&cash_rate_pct=4&futures_carry_pct=5&holding_years=3&exit_discount_pct=1","example_body":{"spot_per_unit":2000,"units_per_token":0.01,"position_value":250000,"storage_bps":35,"insurance_bps":15,"mint_fee_bps":25,"redeem_fee_bps":25,"min_redeem_units":400,"delivery_cost":1500,"market_premium_pct":1.25,"cash_rate_pct":4,"futures_carry_pct":5,"holding_years":3,"exit_discount_pct":1},"example_note":"Made-up illustrative numbers, not market data, a price, a quote or a real position; send your own.","input":{"type":"object","required":["spot_per_unit","units_per_token","position_value","storage_bps","insurance_bps","mint_fee_bps","redeem_fee_bps","min_redeem_units","delivery_cost","market_premium_pct","cash_rate_pct","futures_carry_pct","holding_years"],"additionalProperties":false,"properties":{"spot_per_unit":{"type":"number","exclusiveMinimum":0,"maximum":1000000000,"description":"Spot price of one unit of the commodity."},"units_per_token":{"type":"number","exclusiveMinimum":0,"maximum":1000000,"description":"Units of the commodity behind one token today."},"position_value":{"type":"number","exclusiveMinimum":0,"maximum":10000000000000,"description":"Cash put to work, in either route."},"storage_bps":{"type":"number","minimum":0,"maximum":2000,"description":"Storage cost a year, taken in units. 35 means 0.35%."},"insurance_bps":{"type":"number","minimum":0,"maximum":2000,"description":"Insurance cost a year, taken in units. 15 means 0.15%."},"mint_fee_bps":{"type":"number","minimum":0,"maximum":2000,"description":"Fee to mint, added on top of NAV. 25 means 0.25%."},"redeem_fee_bps":{"type":"number","minimum":0,"maximum":2000,"description":"Fee to redeem, taken from value. 25 means 0.25%."},"min_redeem_units":{"type":"number","minimum":0,"maximum":1000000000,"description":"Fewest units that can be redeemed. 0 means no minimum."},"delivery_cost":{"type":"number","minimum":0,"maximum":1000000000,"description":"Fixed cost of one redemption or delivery, in money."},"market_premium_pct":{"type":"number","minimum":-50,"maximum":100,"description":"Market price over NAV. 1 means 1% above, -1 means 1% below."},"cash_rate_pct":{"type":"number","minimum":0,"maximum":50,"description":"Rate earned on cash held as futures collateral. 4 means 4%."},"futures_carry_pct":{"type":"number","minimum":-50,"maximum":50,"description":"Yearly cost of rolling futures, positive when they sit above spot. 5 means 5%."},"holding_years":{"type":"number","minimum":0,"maximum":100,"description":"Years held."},"exit_discount_pct":{"type":"number","minimum":0,"maximum":90,"description":"Optional. Discount to NAV on a market exit. It is the only exit under the minimum, and the other choice over it. Default 0, or today's discount if the market is below NAV."}}}},{"name":"token_nav_gap","title":"Token and NAV gap","description":"Measures a token's premium or discount to NAV: mean, stdev, worst, share of days outside the mint and redeem band, AR(1) half-life, and how far NAV can drift unobserved between strikes. Compares exit through a constant-product pool with exit by redemption, and finds the size where they cross. Every number comes from the caller. Not a price, a quote or advice.","get":"https://hedgefund.md/api/v1/token_nav_gap","post":"https://hedgefund.md/api/v1/token_nav_gap","example_body":{"token_prices":[99.9,99.85,99.95,100.05,99.95,99.9,99.85,100,100.05,99.95,100,100.1,100.05,99.95,100.1,100.15,100.05,100.1,100,100.1,100.05,100.2,100.1,99.5,98.8,98.2,97.9,98,98.2,98,97.8,97.9,98,98.1,98.05,98,98.1,98.2,98.25,98.2,98.1,98.15,98.3,98.35,98.3,98.4,98.35,98.3,98.25,98.4,98.5,98.45,98.5,98.45,98.4,98.45,98.55,98.5,98.55,98.4],"nav_values":[100,100,100,100,100,100,100,100.1,100.1,100.1,100.1,100.1,100.1,100.1,100.2,100.2,100.2,100.2,100.2,100.2,100.2,100.3,100.3,100.3,100.3,100.3,100.3,100.3,98.5,98.5,98.5,98.5,98.5,98.5,98.5,98.4,98.4,98.4,98.4,98.4,98.4,98.4,98.5,98.5,98.5,98.5,98.5,98.5,98.5,98.6,98.6,98.6,98.6,98.6,98.6,98.6,98.7,98.7,98.7,98.7],"asset_vol_pct":10,"days_between_strikes":7,"pool_token_depth":100000,"pool_cash_depth":9840000,"position_tokens":5000,"redeem_fee_bps":100,"mint_fee_bps":50,"pool_fee_bps":10,"settle_days":10,"cash_rate_pct":5},"example_note":"Made-up illustrative numbers, not market data, a price, a quote or a real position; send your own.","input":{"type":"object","required":["asset_vol_pct","days_between_strikes","pool_token_depth","pool_cash_depth","position_tokens","redeem_fee_bps","settle_days","cash_rate_pct"],"additionalProperties":false,"properties":{"token_prices":{"type":"array","minItems":30,"maxItems":2000,"description":"Token price, one per day, oldest first. Send with nav_values, or leave both out and send premium_pct.","items":{"type":"number","exclusiveMinimum":0,"maximum":1000000000}},"nav_values":{"type":"array","minItems":30,"maxItems":2000,"description":"NAV per token as published, same days and length as token_prices. It may repeat between strikes.","items":{"type":"number","exclusiveMinimum":0,"maximum":1000000000}},"premium_pct":{"type":"number","minimum":-90,"maximum":200,"description":"Today's premium to NAV, when no series is sent. -1 means 1% below NAV. NAV is then the pool's price over 1 + premium."},"asset_vol_pct":{"type":"number","minimum":0,"maximum":500,"description":"Annual volatility of the asset under the token. 10 means 10%."},"days_between_strikes":{"type":"number","minimum":0,"maximum":400,"description":"Days between NAV strikes. 7 means weekly. 0 means NAV is always fresh."},"pool_token_depth":{"type":"number","exclusiveMinimum":0,"maximum":10000000000000,"description":"Tokens in the constant-product pool."},"pool_cash_depth":{"type":"number","exclusiveMinimum":0,"maximum":10000000000000,"description":"Cash in the constant-product pool."},"position_tokens":{"type":"number","exclusiveMinimum":0,"maximum":10000000000000,"description":"Tokens to exit."},"redeem_fee_bps":{"type":"number","minimum":0,"maximum":5000,"description":"Fee to redeem, on NAV. 100 means 1%."},"mint_fee_bps":{"type":"number","minimum":0,"maximum":5000,"description":"Optional. Fee to mint, for the top of the band. Default: the redeem fee."},"pool_fee_bps":{"type":"number","minimum":0,"maximum":5000,"description":"Optional. Pool fee on tokens sold in. Default 0."},"settle_days":{"type":"number","minimum":0,"maximum":400,"description":"Days from a redemption request to its payment."},"cash_rate_pct":{"type":"number","minimum":0,"maximum":50,"description":"Rate that money could earn during settlement. 5 means 5%."}}}},{"name":"rwa_collateral","title":"Token as collateral","description":"Takes a loan against a token: health factor, fall to liquidation, that fall in stdevs over the oracle lag and the redemption time, the driftless chance of touching the line, a whole-position liquidation through a constant-product pool with slippage and bad debt, carry, the highest LTV for a buffer, and repeated borrowing. Every number comes from the caller. Not a price, a rating or advice.","get":"https://hedgefund.md/api/v1/rwa_collateral","post":"https://hedgefund.md/api/v1/rwa_collateral","example_get":"https://hedgefund.md/api/v1/rwa_collateral?collateral_value=10000000&debt=7000000&liquidation_threshold_pct=80&liquidation_penalty_pct=5&asset_vol_pct=15&oracle_lag_hours=24&redemption_days=90&pool_cash_depth=30000000&pool_token_depth=300000&borrow_rate_pct=7&asset_yield_pct=9&buffer_sigmas=3","example_body":{"collateral_value":10000000,"debt":7000000,"liquidation_threshold_pct":80,"liquidation_penalty_pct":5,"asset_vol_pct":15,"oracle_lag_hours":24,"redemption_days":90,"pool_cash_depth":30000000,"pool_token_depth":300000,"borrow_rate_pct":7,"asset_yield_pct":9,"buffer_sigmas":3},"example_note":"Made-up illustrative numbers, not market data, a price, a quote or a real position; send your own.","input":{"type":"object","required":["collateral_value","debt","liquidation_threshold_pct","liquidation_penalty_pct","asset_vol_pct","oracle_lag_hours","redemption_days","pool_cash_depth","pool_token_depth","borrow_rate_pct","asset_yield_pct"],"additionalProperties":false,"properties":{"collateral_value":{"type":"number","exclusiveMinimum":0,"maximum":10000000000000,"description":"Collateral at the oracle's price."},"debt":{"type":"number","exclusiveMinimum":0,"maximum":10000000000000,"description":"Debt owed. Above zero: with no debt there is no line."},"liquidation_threshold_pct":{"type":"number","exclusiveMinimum":0,"maximum":100,"description":"Debt can reach this share of collateral before liquidation. 80 means 80%."},"liquidation_penalty_pct":{"type":"number","minimum":0,"maximum":50,"description":"Share of liquidation proceeds taken first as the penalty. 5 means 5%."},"asset_vol_pct":{"type":"number","minimum":0,"maximum":500,"description":"Annual volatility of the token's value. 15 means 15%."},"oracle_lag_hours":{"type":"number","minimum":0,"maximum":8760,"description":"Hours the oracle's price can lag."},"redemption_days":{"type":"number","minimum":0,"maximum":3650,"description":"Days to turn the token into cash by redemption."},"pool_cash_depth":{"type":"number","exclusiveMinimum":0,"maximum":10000000000000,"description":"Cash in the constant-product pool."},"pool_token_depth":{"type":"number","exclusiveMinimum":0,"maximum":10000000000000,"description":"Tokens in the constant-product pool."},"borrow_rate_pct":{"type":"number","minimum":0,"maximum":100,"description":"Interest on the debt. 7 means 7%."},"asset_yield_pct":{"type":"number","minimum":0,"maximum":100,"description":"Yield on the collateral. 9 means 9%."},"buffer_sigmas":{"type":"number","minimum":0,"maximum":10,"description":"Optional. Stdevs of cushion for the highest LTV. Default 3."},"oracle_price":{"type":"number","exclusiveMinimum":0,"maximum":1000000000,"description":"Optional. Oracle's price per token. Default: the pool's mid, y / x."},"loop_ltv_pct":{"type":"number","minimum":0,"maximum":99,"description":"Optional. LTV for the repeated borrowing table. Default: this loan's LTV."}}}},{"name":"long_short_book","title":"Long-short book","description":"Splits a long-short book into gross, net, factor exposures and each position's share of variance, adds hypothetical carry, and sizes the hedge that takes the first factor to zero. Weights, betas, vols and rates all come from the caller. It is arithmetic on those numbers, not an optimizer, a forecast or a trade idea.","get":"https://hedgefund.md/api/v1/long_short_book","post":"https://hedgefund.md/api/v1/long_short_book","example_body":{"positions":[{"name":"Stock A","weight_pct":30,"betas":[1.3,-0.2,0.5],"idio_vol_pct":30,"expected_alpha_pct":6},{"name":"Stock B","weight_pct":25,"betas":[1.2,-0.1,0.4],"idio_vol_pct":28,"expected_alpha_pct":5},{"name":"Stock C","weight_pct":25,"betas":[1.4,-0.3,0.6],"idio_vol_pct":35,"expected_alpha_pct":4},{"name":"Stock D","weight_pct":20,"betas":[1.1,0.2,0.2],"idio_vol_pct":25,"expected_alpha_pct":3},{"name":"Stock E","weight_pct":20,"betas":[1,0.3,0.1],"idio_vol_pct":22,"expected_alpha_pct":2},{"name":"Stock F","weight_pct":-30,"betas":[0.7,0.4,-0.2],"idio_vol_pct":20,"expected_alpha_pct":-3,"borrow_bps":30},{"name":"Stock G","weight_pct":-30,"betas":[0.8,0.3,-0.3],"idio_vol_pct":24,"expected_alpha_pct":-4,"borrow_bps":50},{"name":"Stock H","weight_pct":-25,"betas":[0.6,0.5,-0.1],"idio_vol_pct":18,"expected_alpha_pct":-2,"borrow_bps":25},{"name":"Stock I","weight_pct":-15,"betas":[0.9,0.1,-0.4],"idio_vol_pct":40,"expected_alpha_pct":-6,"borrow_bps":800}],"factors":[{"name":"Market","vol_pct":16},{"name":"Value","vol_pct":8},{"name":"Momentum","vol_pct":10}],"factor_corr":[[1,0.1,-0.1],[0.1,1,-0.3],[-0.1,-0.3,1]],"cash_rate_pct":4,"financing_rate_pct":6,"max_gross_pct":250,"max_net_pct":30,"max_factor_share_pct":25},"example_note":"Made-up illustrative numbers, not market data, a price, a quote or a real position; send your own.","input":{"type":"object","required":["positions","factors","cash_rate_pct","financing_rate_pct"],"properties":{"positions":{"type":"array","description":"The book, one line per name.","items":{"type":"object","required":["name","weight_pct","betas","idio_vol_pct"],"properties":{"name":{"type":"string","description":"A label for the position, such as Stock A.","maxLength":60},"weight_pct":{"type":"number","description":"Signed share of NAV. 30 is long 30% of NAV, -30 is short 30%.","minimum":-1000,"maximum":1000},"betas":{"type":"array","description":"One beta per factor, in the order of factors.","items":{"type":"number","description":"Beta to one factor.","minimum":-50,"maximum":50},"maxItems":12,"minItems":1},"idio_vol_pct":{"type":"number","description":"Annual volatility not explained by the factors, in percent.","minimum":0,"maximum":500},"expected_alpha_pct":{"type":"number","description":"The stock's own hypothetical annual alpha, in percent. A short earns when this is negative. Default 0.","minimum":-500,"maximum":500},"borrow_bps":{"type":"number","description":"Annual borrow fee on a short, in basis points of the short. Ignored on longs. Default 0.","minimum":0,"maximum":100000}}},"maxItems":200,"minItems":1},"factors":{"type":"array","description":"The factors, in the order of each position's betas.","items":{"type":"object","required":["name","vol_pct"],"properties":{"name":{"type":"string","description":"A label for the factor, such as Market.","maxLength":60},"vol_pct":{"type":"number","description":"Annual factor volatility, in percent.","minimum":0,"maximum":500}}},"maxItems":12,"minItems":1},"factor_corr":{"type":"array","description":"Optional factor correlation matrix. Default is identity: factors independent.","items":{"type":"array","description":"One row of the matrix.","items":{"type":"number","description":"A correlation.","minimum":-1,"maximum":1},"maxItems":12,"minItems":1},"maxItems":12,"minItems":1},"cash_rate_pct":{"type":"number","description":"Annual rate earned on what longs leave of NAV, in percent.","minimum":-10,"maximum":100},"financing_rate_pct":{"type":"number","description":"Annual rate paid on longs above 100% of NAV, in percent.","minimum":-10,"maximum":100},"max_gross_pct":{"type":"number","description":"Optional limit on gross, in percent of NAV.","minimum":0,"maximum":10000},"max_net_pct":{"type":"number","description":"Optional limit on the size of net, in percent of NAV.","minimum":0,"maximum":10000},"max_factor_share_pct":{"type":"number","description":"Optional limit on the factor share of variance, in percent.","minimum":0,"maximum":100}}}},{"name":"factor_regress","title":"Factor regression","description":"Fits a return series on up to 6 factor series by least squares with an intercept: annualized intercept and its t-stat, betas with t-stats, R squared, adjusted R squared, residual vol and Durbin-Watson. Every return comes from the caller. It describes one sample of numbers. It doesn't test a strategy, adjust for data mining or say what comes next.","get":"https://hedgefund.md/api/v1/factor_regress","post":"https://hedgefund.md/api/v1/factor_regress","example_body":{"returns_pct":[2.26,-2.73,-6.84,-0.96,-0.94,1.51,0.79,-3.29,0.74,4.22,1.14,0.79,1.64,3.65,1.9,-2.27,3.89,1.22,1.86,4.2,5.94,-1.19,4.04,1.5,-0.32,3.76,1.19,1.88,-1.62,8.44,-5.48,-1.43,2.55,-6.1,1.01,5.14,0,5.84,-6.17,5.03,-0.1,2.16,0.76,1.76,2.87,1.43,2.58,2.25,-0.89,-0.94,-3.84,-0.21,-0.16,4.31,0.29,-1.73,0.02,-3.21,1.87,-0.15],"factors":[{"name":"Market","returns_pct":[1.83,-3.89,-4.14,-0.61,-0.41,1.85,-2.03,-5.63,-0.58,4.06,0.23,2.9,3.52,6.22,-1.58,-0.51,4.9,0.08,2.8,4.4,7.34,-1.73,3.06,-0.23,-0.39,6.35,3.4,-0.4,-0.72,11.32,-6.12,-2.09,4.53,-5.66,1.26,4.4,-0.86,6.6,-7.2,4.85,3.05,1.23,1.69,0.47,3.1,1.98,2.83,2.7,-2.35,-1.17,-4.24,0.54,-1.72,5.07,-0.45,2.44,1.29,-5.27,-0.43,-5.14]},{"name":"Value","returns_pct":[2.52,2.35,-4.46,-1.08,-1.39,-0.28,0.35,-1.25,-1.49,0.47,1.79,-1.21,-1.27,-0.67,1.02,0.23,2.32,2.72,1.07,4.66,-0.99,-1.01,1.03,-1.42,0.14,-3.82,-0.46,1.41,-2.48,-0.59,-0.23,-0.31,-1.07,-1.71,0.06,-3.23,-1.87,-0.03,-1.9,1.04,-3.99,2.52,-1.33,-1.08,1.3,-2.5,2.11,0.82,-1.17,0.11,-0.8,2.91,0.71,0.01,-1.41,-3.47,-0.95,0.49,2.52,-0.37]},{"name":"Momentum","returns_pct":[2.48,-3.37,-2.54,0.88,2.98,-1.93,5.53,-2.9,0.08,2.35,-1.7,0.95,-2.15,-1.16,-4.11,-5.82,0.58,-0.26,2.2,-3.37,2.33,2.48,-3.26,3.74,3.2,1.06,1.92,0.13,1.29,7.79,1.65,4.04,-0.31,0.36,0.24,3.56,2.35,3.2,-0.13,-0.3,-2.95,2.75,5.03,3.83,-0.11,3.02,-1.87,5.2,-5.05,3.42,-0.02,1.59,0.09,-1.39,0.54,0.92,-1.64,-7.58,-0.13,5.98]}],"periods_per_year":12},"example_note":"Made-up illustrative numbers, not market data, a price, a quote or a real position; send your own.","input":{"type":"object","required":["returns_pct","factors","periods_per_year"],"properties":{"returns_pct":{"type":"array","description":"The series to explain, per period, in percent.","items":{"type":"number","description":"One period's return, in percent.","minimum":-10000,"maximum":10000},"maxItems":2000,"minItems":3},"factors":{"type":"array","description":"The factor series, same length and order as returns_pct.","items":{"type":"object","required":["name","returns_pct"],"properties":{"name":{"type":"string","description":"A label for the factor, such as Market.","maxLength":60},"returns_pct":{"type":"array","description":"The factor's return per period, in percent.","items":{"type":"number","description":"One period's return, in percent.","minimum":-10000,"maximum":10000},"maxItems":2000,"minItems":3}}},"maxItems":6,"minItems":1},"periods_per_year":{"type":"number","description":"Periods per year: 12 for monthly, 252 for daily. Used only to annualize.","minimum":1,"maximum":366}}}},{"name":"pairs_spread","title":"Pairs spread","description":"Fits a log hedge ratio on the first part of two price series, tests the spread for pull-back to its mean, and walks the later part with those fit numbers and entry and exit z-scores, after costs. Prices come from the caller. It is a hypothetical walk through one sample, not a test of cointegration in any strict sense, a trade idea or a signal to follow.","get":"https://hedgefund.md/api/v1/pairs_spread","post":"https://hedgefund.md/api/v1/pairs_spread","example_body":{"series_a":[108.12,108.57,103.13,103.28,102.31,104.84,107.3,104.71,102.25,99.76,100.82,100.29,100.27,100.31,102.79,101.69,102.56,102.15,104.54,108.17,101.79,102.04,101.32,100.85,99.1,96.83,96.75,97.23,97.84,95.01,94.87,94.28,96.59,97.83,96.15,98.17,97.7,95.29,95.82,97.05,94.79,96.32,99.1,98.71,98.34,97.28,99.53,98.69,99.56,99.39,101.5,100.89,97.23,99.35,101.55,99.1,99.4,99.33,100.55,101.12,104.48,106.08,104.26,106.52,108.34,106.24,105.95,103.44,104.96,104.46,107.19,106.83,104.73,103.89,103.81,101.68,98.76,100.12,99.72,99.31,100.34,101.1,99.65,98.28,98.92,101.36,103.15,101.98,101.38,104.99,103.88,104.66,105.52,105.99,106.45,107.69,108.35,108.47,110.48,110.34,108.45,107.75,106.32,106.49,104.92,105.62,102.94,102.82,105.32,104.97,105.1,107.19,105.74,106.02,103.25,100.81,102.17,100.61,100.92,100.48,101.25,98.02,96.89,96.4,95.25,94.18,91.6,88.51,86.67,86.33,86.05,86.66,88.49,86.96,85.07,83.48,83.86,81.13,81.38,82.81,82.68,82.27,82.72,83.14,84.93,81.84,81.47,82.31,80.94,82.77,81.43,84.07,84.72,84.85,85.56,85.16,85.77,85.72,83.98,83.23,84.4,83.87,81.29,79.32,79.95,81.29,81.97,81.18,81.22,82.95,80.72,82.22,83.5,82.05,83.4,79.65,79.95,78.02,75.87,76.43,75.68,75.07,74.33,71.12,72.01,71.81,72.53,72.69,72.44,73.33,73.83,74.64,76.35,76.9,77.04,75.98,74.18,73.75,73.68,73.89,74.15,71.69,71.78,71.49,69.96,69.68,68.7,69.15,67.31,70.81,70.64,70.09,70.53,70.31,70.64,70.55,71.25,72.45,73.08,73.54,74.42,74.52,73.21,72.9,72.16,71.05,72.46,72.75,71.08,69.57,70.58,68.45,71.43,71.92,71.79,71.11,71.26,70.03,68.98,68.85,68.32,67.81,68.03,67.15,66.12,65.89,67.07,66.25,65.5,67.16,68.57,68.93,68.13,68.69,67.88,69.03,70.61,71.4,70.77,69.29,70.9,72.13,74.27,73.7,74.35,73.28,75.06,75.77,73.85,72.74,72.29,72.79,72.3,73.63,75.22,75.3,75.55,74.1,73.82,74.8,74.92,75.89,75.9,76.07,77.1,76.49,73.32,72.95,73.4,76.44,75.78,75.48,73.77,74.6,74.87,73.37,71.53,70.76,70.91,72.12,71.81,72.47,70.81,69.78,69.7,69.03,68.65,68.14,70.17,69.15,66.99,68.4,68,68.91,71.28,70.05,70.53,73.98,73.15,73.56,73.25,71.05,72.55,74.1,73.66,72.63,72.48,71.59,70.58,70.61,71.85,72.14,71.41,73.37,75.11,72.43,72.28,71.8,70.66,69.93,70.07,69.56,70.48,69.65,69.98,70.38,71.84,72.18,73.81,74.64,74.69,73.64,73.3,72.48,72.83,73.7,74.26,75.16,76.51,76.56,78.76,79.02,76.71,76.34,75.73,74.2,73.22,74.02,71.63,71.26,70.51,70.74,71.14,72.48,73.16,71.83,73.75,74.17,72.31,71.53,70.86,69.51,69.51,70.29,70.48,72.24,71.45,70.35,70.79,71.27,71.14,72.51,73.33,73.48,72.58,73.31,74.91,77.81,79.32,77.92,79.36,80.13,80.86,78.81,80.84,79.97,80.07,77.41,77.89,77.68,78.59,77.79,78.2,76.06,75.64,74.62,75.52,76.54,76.14,76.9,77.87,74.2,75.83,75.53,76.46,75.92,75.37,79.44,80.92,78.71,82.66,81.17,83.28,80.79,81.99,84.3,84.99,86.34,87.32,87.88,86.42,84.29,84.95,86.3,86.79,87.05,86.43,87.47,89.55,91.81,91.3,92.07,93.51,95.49,96.59,95.44,96.95,98.63,98.6,101.11,100.11,98.41,99.38,101.46,101.24,98.48,97.44,97.48,96.36,95.08,98.74,99.78,98.94,101.19,98.97,98.83,98.96,96.84,97.82,98.12,96.49,97.01,93.21,92.38,94.76,94.14,95.32,96.07,96.83,97.44,99.83,98.6,98.62,99.63,99.79,96.51,94.69,95.14,97.03,97.8],"series_b":[49.48,49.95,48.68,48.5,47.89,48.74,48.72,48.11,47.72,47.66,47.54,47.91,47.56,47.96,48.9,47.8,48,47.66,48.13,48.9,47.31,47.11,46.71,47.1,46.57,46.21,46.27,46.92,46.84,46.3,46.18,46.12,46.42,46.52,45.5,46.03,45.57,44.92,45.16,45.88,45.45,45.76,45.87,45.87,45.23,45.04,45.18,44.15,44.88,44.96,45.34,45.15,44.38,45.51,46.42,46.47,46.63,46.35,46.56,46.7,47.62,48.34,47.23,48.19,49.03,49.04,48.64,47.73,48.02,48.34,48.73,48.19,48.18,47.76,47.49,46.96,46.32,47.01,47.34,47.55,47.2,47.21,47.24,46.6,46.43,47.22,47.99,48.39,48.06,48.97,48.89,49.08,49.08,49.83,48.86,48.68,49.11,48.84,48.47,48.82,47.94,47.29,46.95,47.17,46.85,46.77,46.49,46.22,46.96,47.67,47.21,47.67,47.09,46.86,46.32,45.58,46.06,45.82,45.34,45.44,45.27,45.23,45.01,45.2,44.96,44.63,43.41,42.05,41.35,40.59,40.4,40.69,41.18,40.71,40.23,39.89,40.17,39.21,38.92,39.2,39,38.82,38.86,39.24,40.06,39.56,38.76,39.24,39.03,39.51,38.99,40.23,40.52,40.55,40.48,40.14,40.44,40.33,39.89,39.63,39.86,39.64,39.15,37.96,38.23,38.6,38.81,38.65,38.49,39,37.95,38.07,38.41,37.93,37.76,36.58,36.79,36.05,36.07,35.88,35.83,35.46,35.3,34.57,34.57,34.11,34.43,34.53,34.36,34.98,35.13,35.29,35.61,35.75,35.59,35.18,34.42,33.74,33.49,33.38,33.36,32.68,32.49,32.41,32.21,31.79,31.78,32.25,31.67,32.53,32.43,32.12,31.81,31.89,31.81,31.62,31.9,32.42,32.79,33.37,33.79,34.24,33.58,33.83,33.53,33.66,34,34,33.26,33.06,32.92,32.61,33.52,33.19,33.12,33.23,33.21,33.3,32.89,33.09,32.8,32.45,32.95,32.54,32.11,32.1,32.12,32.14,32.07,32.33,32.48,32.59,32.46,32.11,31.71,32.03,32.58,32.78,32.85,32.5,32.47,32.71,32.91,33.45,33.17,33.18,33.69,34.18,33.91,33.42,33.73,33.55,33.63,33.6,34.17,34.11,34.45,34.04,33.77,33.88,33.57,33.57,33.53,34.16,34.08,33.88,33.18,33.3,33.79,34.15,34.07,34.44,34.24,34.55,34.68,34.18,33.87,33.67,33.35,33.74,33.43,33.47,33.13,33.25,33.08,32.74,32.78,32.75,33.18,32.65,32.03,32.44,32.28,32.07,32.5,32.37,32.62,33.58,33.96,34.12,33.98,33.53,33.84,33.64,34.03,34.11,33.86,33.73,33.1,33.11,33.19,33.34,33.53,34.03,34.71,33.93,33.98,33.9,33.5,33.02,33.26,33.15,33.67,33.63,33.63,34.1,34.28,34.21,34.65,35.18,35.61,35.56,35.3,35.01,34.56,34.77,34.79,34.9,35.42,35.68,35.94,36.42,35.96,35.43,35.36,34.93,34.75,35.11,34.32,34.46,34.34,34.45,34.56,34.55,34.6,34.19,34.65,35.17,34.01,33.58,33.75,33.91,33.29,33.49,33.4,33.8,33.94,33.55,33.97,34.34,33.83,34.5,34.93,34.81,34.93,35.42,35.78,36.17,36.66,36.21,36.43,36.84,36.97,36.4,37.1,36.89,36.92,36.4,37.07,36.82,36.76,36.67,36.63,36.16,36.33,36.37,36.49,36.59,36.94,37.26,37.16,36.37,36.52,36.15,36.23,36.17,36.13,37.07,37.41,36.81,37.82,37.8,38.52,38.25,38.63,38.96,39.22,39.59,39.98,39.77,39.11,38.35,38.23,38.39,38.03,38.21,38.17,39.02,39.34,40.07,40.28,40.99,41.21,41.85,42.31,42.1,42.33,42.5,42.46,43.09,42.35,42.04,42.65,42.89,43,41.63,42.25,42.16,42.08,41.97,42.66,43.17,43.17,43.85,43.03,43,43.06,42.22,42.78,42.61,42.24,42.2,41.31,40.9,41.45,41.62,41.6,41.2,41.8,42.07,42.36,42.26,42.77,42.74,42.15,41.47,40.92,40.57,40.35,40.19],"entry_z":2,"exit_z":0.5,"cost_bps_per_leg":5,"fit_share_pct":50},"example_note":"Made-up illustrative numbers, not market data, a price, a quote or a real position; send your own.","input":{"type":"object","required":["series_a","series_b","entry_z","exit_z","cost_bps_per_leg"],"properties":{"series_a":{"type":"array","description":"Prices of A, oldest first, above zero. 40 to 2000 points.","items":{"type":"number","description":"One price, above zero.","minimum":1e-9,"maximum":1000000000000},"maxItems":2000,"minItems":40},"series_b":{"type":"array","description":"Prices of B, same dates and length as series_a.","items":{"type":"number","description":"One price, above zero.","minimum":1e-9,"maximum":1000000000000},"maxItems":2000,"minItems":40},"entry_z":{"type":"number","description":"The walk opens a hypothetical trade when the z-score is past this size. Must be above exit_z.","minimum":0.1,"maximum":10},"exit_z":{"type":"number","description":"The walk closes a hypothetical trade once the z-score is back inside this size. 0 means at the mean.","minimum":0,"maximum":9},"cost_bps_per_leg":{"type":"number","description":"Cost per leg, in basis points. A round trip pays four legs.","minimum":0,"maximum":1000},"fit_share_pct":{"type":"number","description":"Share of the points used to fit. The rest is walked. Default 50.","minimum":20,"maximum":80}}}},{"name":"merger_spread","title":"Merger spread","description":"Computes a deal's offer value, gross spread, simple and compounded annualized return, return net of financing, borrow and dividends, the completion probability the price implies, and the break-even probability after carry. Prices and terms come from the caller. It is arithmetic on those numbers, not a view on whether any deal closes.","get":"https://hedgefund.md/api/v1/merger_spread","post":"https://hedgefund.md/api/v1/merger_spread","example_get":"https://hedgefund.md/api/v1/merger_spread?deal_cash=20&deal_stock_ratio=0.5&acquirer_price=60&target_price=47&break_price=35&days_to_close=120&dividends_target=0.25&dividends_acquirer=0.4&financing_rate_pct=5&borrow_bps=50","example_body":{"deal_cash":20,"deal_stock_ratio":0.5,"acquirer_price":60,"target_price":47,"break_price":35,"days_to_close":120,"dividends_target":0.25,"dividends_acquirer":0.4,"financing_rate_pct":5,"borrow_bps":50},"example_note":"Made-up illustrative numbers, not market data, a price, a quote or a real position; send your own.","input":{"type":"object","required":["target_price","break_price","days_to_close","financing_rate_pct"],"properties":{"deal_cash":{"type":"number","description":"Cash paid per target share. Default 0.","minimum":0,"maximum":10000000},"deal_stock_ratio":{"type":"number","description":"Acquirer shares paid per target share. Default 0.","minimum":0,"maximum":10000},"acquirer_price":{"type":"number","description":"Acquirer share price. Required when deal_stock_ratio is above 0.","minimum":0.0001,"maximum":10000000},"target_price":{"type":"number","description":"Target share price now.","minimum":0.0001,"maximum":10000000},"break_price":{"type":"number","description":"Where the target would trade if the deal broke.","minimum":0,"maximum":10000000},"days_to_close":{"type":"number","description":"Calendar days until the deal closes.","minimum":1,"maximum":3650},"dividends_target":{"type":"number","description":"Dividends per target share expected before close. Default 0.","minimum":0,"maximum":1000000},"dividends_acquirer":{"type":"number","description":"Dividends per acquirer share expected before close. Default 0.","minimum":0,"maximum":1000000},"financing_rate_pct":{"type":"number","description":"Annual rate on the whole target price, in percent.","minimum":-10,"maximum":100},"borrow_bps":{"type":"number","description":"Annual borrow fee on the acquirer short, in basis points of its value. Default 0.","minimum":0,"maximum":100000}}}},{"name":"trend_vol_target","title":"Trend with a vol target","description":"Walks a hypothetical trend book through the prices sent: sign of the trailing return, sized to a vol target, capped, with each day's weight set from prices through the day before, after turnover costs. Reports vol, mean, drawdown, hit rate, gross, turnover and each market's part. It is a hypothetical walk on the caller's numbers, not a record of trading, a forecast or a signal to follow.","get":"https://hedgefund.md/api/v1/trend_vol_target","post":"https://hedgefund.md/api/v1/trend_vol_target","example_body":{"markets":[{"name":"Market A","prices":[100,100.75,101.5,100.58,100.6,100.67,100.47,101.2,101.41,101.65,101.94,102.84,105.17,105.55,105.61,104.46,103.6,101.81,101.97,102.47,101.82,102.83,102.63,103.33,103.71,103.92,105.19,105.67,106.18,104.98,104.41,104.57,104.43,103.44,103.42,104.85,105.56,103.6,102.56,103.77,103.04,102.06,101.88,102.44,103.09,104.63,105.06,104.62,107.61,107.76,107.08,107.32,107.97,108.93,109.2,109.84,111.49,112.69,113.29,113.88,113.95,111.6,110.9,111.46,113.46,113.83,111.87,112.15,113.03,113.47,114.16,114.68,114.23,114.84,116.6,116.44,116.68,117.1,117.12,116.21,115.73,115.65,115.04,115.33,114.9,116.37,115.62,116.93,117.77,118.28,119.32,116.7,114.84,113.48,112.14,114.2,113.23,111.96,112.44,113.18,113.66,115.72,116.51,117.58,118.9,118.11,119.46,117.12,116.18,117.11,115.91,115.88,115.89,116.5,118.34,119.64,119.61,119.05,118.45,119.04,118.26,118.66,119.54,122.23,123.01,124.49,124.53,123.77,122.91,123.75,125.02,126.37,127.02,125.88,126.2,127.8,126.41,126.18,127.78,126.7,127.73,126.6,127.41,127.72,126.63,126.71,128.44,128.39,128.32,130.73,133.16,132.23,132.48,133.26,133.23,134.34,132.26,129.77,129.75,130.69,131.68,132.14,132.26,133.93,133.05,132.99,131.49,131.54,134.37,135.63,136.33,136.68,136.64,135.85,136.7,136.69,138.63,138.05,137.48,138.22,137.24,137.78,139.63,139.58,142.4,140.94,141.49,142.13,144.49,146.43,147.69,146.5,147.79,148.51,149.6,148.48,150.1,152.78,155.12,155.54,155.2,156.4,157.75,159.6,159,158.07,157.95,157.71,158.75,157.66,157.33,157.3,155.53,155.46,155.65,155.89,156.05,156.13,155.14,156.23,155.64,156.58,156.11,154.65,155.08,155.92,158.2,159.01,160.73,161.66,161.4,162.48,165.56,166.34,164.35,163.7,163.78,166.87,164.54,165.84,166.62,165.54,163.49,164.4,165.86,166.41,167.84,167.1,167.74,165.26,166.27,167.87,168.75,167.9,168.26,169.75,169.1,169.93,169.32,172.34,173.22,168.91,168.88,167.08,167.11,168.36,166.73,164.48,163.33,164.81,165.79,164.41,166.28,168.77,171.47,172.77,171.37,170.91,170.77,169.17,168.4,166.12,166.25,166.97,166.36,166,165.02,166.34,167.38,167.71,166.95,163.85,163.25,163.65,163.6,163.23,165.87,166.64,165.79,165.28,164.55,163.49,164.73,162.78,165.43,166.58,165.41,164.98,164.82,163.34,163.55,159.99,161.73,158.72,158.43,158.16,159.71,161.02,159.42,160.59,162.4,162.45,163.53,161.9,162.12,161.97,163.62,162.45,163.8,163.72,161.77,165.06,166.79,166.55,166.55,167.46,169.15,168.84,166.77,168.58,168.62,168.57,168.23,166.81,164.73,165.35,165.71,166.57,167.02,168.76,169.22,167.52,169.37,166.66,168.91,168.16,166.34,166.11,165.54,168.3,169.33,168.88,170.96,168.55,169.89,169.83,172.41,175.11,175.37,174.33,175.83,174.73,174.15,176.33,175.08,176.28,177.32,174.66,172.8,172.67,174.02,173.45,177.46,173.14,173.99,174.6,175.76,172.61,172.29,172.02,172.14,172.92,174.54,171.18,171.33,171.35,172.1,172.88,172.83,172.22,172.63,173.31,170.85,171.62,171.26,171.24,169.54,172.43,171.71,171.86,171.06,170.41,171.36,170.31,171.34,169.3,168.77,167.73,166.99,167.13,163.4,162.07,163.52,162.01,160.94,159.92,160.27,161.69,160.9,162.03,160.23,160.9,160.85,160.19,160.75,160.56,160.79,161.97,162.24,161.03,159.61,159.45,158.89,158.92,158.49,160.8,161.64,161.31,160.24,159.26,160.57,161.07,161.56,159.84,158.94,158.68,159.84,160.85,159.45,158.89,158.12,158.09,157.35,156.85,157.61,157.62,156.28,159.55,158.47,159.69,159.42,157.19,155.94,156.03,154.61,152.5,151.69,153.23,152.41,154.44,155.44,155.66,155.07,154.29,155.04,154.8,157.76,157.87,158.59,157.17,156.89,154.73,154.35,153.59,154.19,153.79,153.68,154.21,153.87,153.55,155.22,153.65,150.93,150.6]},{"name":"Market B","prices":[100,100.03,100.41,99.77,99.15,98.75,98.47,98.62,98.52,98.62,99.11,99.9,100.37,99.69,99.74,99.31,99.65,99.7,99.54,100,99.36,99.68,99.93,100.23,101.25,101.16,101.61,101.18,100.76,100.26,100.73,100.85,100.66,100.73,101.06,100.77,100.2,99.4,99.17,99.51,99.32,99.23,99.22,99.63,100.07,100.44,100.08,99.75,99.94,100.32,99.79,99.35,98.88,99.34,99.15,99.59,99.81,100.45,100.35,99.23,99.33,98.88,98.11,98.6,98.31,98.9,99.13,98.16,98.24,98.2,98.62,99.04,98.43,97.9,98.6,98.46,98.5,99.17,98.86,98.4,98.87,99.08,98.95,98.54,97.91,97.55,97.2,96.91,98.2,99.17,99.5,99.49,99.42,98.98,98.39,98.56,98.5,98.4,97.92,97.69,98.5,98.78,99.4,99.96,100.79,101.17,100.43,99.9,99.99,100.12,99.54,99.53,98.58,99.61,100.63,100.61,101.44,101.1,101.01,101.31,102.24,102.28,102.51,103.3,104.17,105.27,105.22,105.36,105.04,104.7,105.18,105.41,105.15,105.38,105.36,105.56,105.49,106.02,106.01,105.16,105.01,104.31,104.39,104.98,104.53,104.4,104.8,105.36,105.86,106.8,107.04,106.45,106.61,107.35,107.03,107.17,106.36,105.95,107.18,107.2,108.12,108.28,107.73,107.68,107.37,106.93,106.6,106.79,106.55,106.41,106.72,107.17,107.11,106.81,107.88,107.27,108.17,108.35,108.55,108.49,108.41,108.48,108.79,108.63,109.76,109.41,109.79,109.24,109.24,109.35,110.33,110.88,110.65,109.69,110.19,110.36,110.72,111.71,112.6,112.34,111.99,112.97,112.94,112.65,112.21,112.09,112.07,111.77,112.44,111.02,110.14,110.38,109.28,109.58,108.76,109.18,110.52,109.82,108.59,108.67,108.48,109.06,109.48,109.59,109.95,109.5,108.63,109.17,109.27,108.5,109.09,108.7,109.22,109.23,108.58,108.11,108.78,110.19,109.06,109.61,109.21,108.82,107.97,108.82,109.08,108.57,108.61,108.55,107.57,107.23,107.07,107.15,107.42,107.51,107.64,107.56,107.37,107.6,107.42,106.82,107.08,106.21,105.22,104.66,104.66,104.79,104.57,103.65,104.38,104.56,104.37,104.41,104.47,104.7,105.23,105.16,105.06,106.02,107.16,107.4,107.21,106.19,105.61,105.51,105.48,104.77,104.58,104.46,104.59,104.64,103.67,102.58,102.06,102.53,102.2,101.88,102.63,103.25,103.08,103.25,104.02,103.91,104.29,103.92,104.46,105.34,105.14,103.88,104.3,104.69,105.07,104.39,104.15,104.15,104.16,103.84,103.49,103.12,103.68,104.32,104.68,105.12,105.47,105.41,105.3,105.73,105.8,104.75,104.76,105.07,104.97,105.74,106.67,106.57,106.52,106.91,107.34,107.74,106.8,107.7,107.95,107.47,108.33,108.11,108.16,108.17,108.23,108.65,108.56,109.1,109.25,108.86,110.04,109.46,110.25,110.06,109.35,107.93,107.88,108.27,108.42,108.05,108.63,107.98,107.77,108.17,108.73,109.7,109.71,109.36,109.47,109.23,109.71,109.71,110.16,110.29,109.88,110.14,110.5,110.23,110.65,110.6,112.15,111.66,111.69,112.04,113.01,112.62,113.51,113.75,113.46,113.46,113.63,112.46,112.54,112.01,112.16,111.66,112.73,112.24,112.56,112.52,112.61,112.21,112.17,112.44,111.76,112.5,111.86,112,112.88,113.36,114.43,115.09,114.95,114.27,114.27,113.7,114.07,113.84,113.22,112.64,112.05,111.66,111.42,111.27,111.28,111.99,112.08,112.61,113.06,112.51,111.6,110.85,110.35,110.57,111.69,112.27,112.38,112.62,113.21,112.32,112.18,111.08,111.43,111.93,112.88,113.45,113.54,113.47,114.05,114.67,115.48,115.1,114.54,113.64,114.3,113.77,112.67,112.37,112.84,112.73,112.27,112.53,113.09,113.2,113.47,114.37,113.74,113.9,113.61,112.08,113.18,112.93,113.1,113.53,113.83,113.84,113.52,113.76,113.75,114.18,114.43,114.14,113.97,114.56,115.08,114.72,114.32,114.05,114,113.37,113.06,113.12,113.03,112.91,112.87,113.62,112.78,113.01,113.02,112.57,112.58,112.27]},{"name":"Market C","prices":[80,79.43,80.14,80.44,78.01,77.12,78.2,78.74,79.15,81.07,82.6,84.21,84.53,82.38,83.75,82.32,81.45,78.5,78.03,81.04,79.98,80.23,80.21,80.4,82.49,83.22,83.15,83.06,81.59,79.86,79.48,79.37,78.74,79.19,80.83,81.47,81.77,80.17,80.36,81.36,81.28,82.72,82.86,82.74,84,84.54,86.31,86.97,90.45,92.64,91.28,90.29,90.28,91.73,90.71,91.48,92.76,93.23,91.63,89.64,89.48,89.69,89.27,89.51,90.32,93.17,92.46,91.73,92.22,91.03,91.58,92.16,91.39,92.18,92.67,93.09,93.52,93.08,92.84,92.13,92.9,92.72,92.82,91.14,91.28,92.43,90.49,91.85,94.42,95.49,96.43,95.25,94.83,94.3,92.56,93.05,93.71,91.74,90.83,91.75,90.59,89.12,88.96,89.31,92.2,91.29,90.91,91.1,90.14,90.14,89.58,88.86,89.04,90.97,93.04,93.15,92.81,93.28,92.66,91.3,91.58,92.55,93.25,93.8,95.8,96.73,96.27,96.66,94.86,93.53,95.12,96.29,96.98,95.91,98.02,97.98,96.79,97.97,98.65,98.55,99.05,97.45,98.21,98.2,97.17,98.29,95.87,96.72,97.31,100.23,101.09,101.43,102.25,104.66,103.59,104.63,103.59,102.6,103.58,104.51,105.26,102.86,101.97,102.59,103.19,102.21,99.11,99.16,98.75,100.02,99.07,98.75,99.63,98,100.16,101.43,103.07,102.45,102.85,103.06,99.76,101.1,102.32,103.79,106.87,105.62,106.44,105.12,105.96,108.62,110.62,111.08,111.35,111.22,111.88,110.23,112.79,112.73,111,111.57,111.37,113.23,115.61,118.73,118.58,117.51,117.02,112.83,113.36,111.29,109.51,110.19,107.94,108.25,107.37,109.28,110.33,108.41,109.72,111.55,111.06,112.33,112.72,110.54,111.71,111.35,109.74,112.96,113.16,113.69,115.12,114.83,116.79,117.48,116.45,118.39,116.68,119.67,119.07,120.19,119.04,118.93,120.48,122.43,122.87,122.64,123.31,124.51,122.88,120.09,121.84,122.19,121.99,122.54,125.99,126.98,126.91,128.82,131.76,132.03,132.03,129.17,127.74,128.13,130.37,129.29,126.89,125.16,125.9,126.21,126.45,122.3,122.85,122.67,125.89,130.03,129.19,129.83,133.04,133.54,132.19,130.29,130.49,132.02,132.09,132.22,128.86,129.9,132.02,132.65,131.08,128.38,126.66,130.1,129.25,130.21,132.53,133.7,134.28,132.91,134.3,131.73,132.53,130.55,132.37,134.73,133.82,131.74,132.79,134.83,134.69,131.12,131.23,129.4,131.45,130.6,129.01,129.73,127.83,129.66,130.34,131.78,134.2,133.24,131.7,129.6,130.15,129.1,130.63,133.17,133.78,134.72,137.18,135.75,136.62,138.03,140.02,141.77,140.21,141.73,142.95,140.13,140.87,140.88,140.01,140.4,140.45,141.93,141.65,143.87,143.92,141.26,142.54,139.32,140.52,140.28,138.55,136.4,137.02,138.48,137.01,136.03,133.98,130.53,129.15,131.38,131.63,134.14,133.76,133.07,132.3,130.91,132.57,134.3,134.81,137.35,139.06,138.74,136.75,139.45,139.79,139.62,143.87,140.35,138.86,137.63,135.86,135.05,134.38,133.93,134.25,135.32,134.64,131.28,131.41,131.53,132.72,132.35,132.56,132.83,133.1,134.57,131.72,129.65,130.59,130.22,128.25,128.17,128.51,127.49,129.14,127.23,125.89,127.41,126.14,124.5,124.3,123.75,122.74,123.45,122.05,122.22,120.58,119.86,121.9,120.83,120.99,121.88,122.9,123.49,123.69,123.3,122.26,121.49,120.66,119.5,118.77,118.88,118.41,118.91,120.01,116.57,116.16,115.1,112.26,114.07,115.62,116.31,116.03,115.38,116.39,117.82,121.71,121.26,119.95,118.08,119.46,120.85,118.15,117.22,120.59,120.71,120.45,120.1,120.34,119.21,122.94,126.18,124.54,123.8,123.31,120.22,121.59,123.56,123.81,124.45,126.44,126.72,123.94,125.3,123.79,123.75,122.64,123.26,123.86,125.78,130.23,130.65,130.76,127.99,125.72,122.8,121.34,119.16,119.19,120.02,120.11,119.35,119.14,118.67,119.82,117.23,118.08,116.33]},{"name":"Market D","prices":[120,119.94,121.62,121.9,120.79,120.17,120.6,120.74,120.65,121.5,121.61,122.17,122.32,122.86,123.42,122.52,122.26,120.88,119.32,120.03,119.42,120.1,119.73,120.23,120.22,120.48,121.19,121.54,120.87,119.84,120.66,121.48,121.88,121.25,121.81,120.63,119.9,119.93,118.69,120.06,118.86,118.26,118.02,118.47,118.92,119.92,119.51,119.57,121.77,121.77,121.34,121.3,121.25,121.2,121.42,121.71,122.5,121.95,122.18,121.5,121.69,121.46,121.35,121.12,121.4,121.72,121.72,121.46,121.33,121.61,121.37,122.08,121.78,121.82,121.86,122.16,122.49,122.48,122.94,122.1,123.25,123.1,122.47,122,121.67,123.44,122.33,123.06,124.52,124.53,124.88,124.57,124.59,124.88,124.83,125.29,124.73,124.99,123.76,123.67,123.9,123.88,125.47,125.57,127.26,127.3,126.84,126.87,127.11,126.13,125.27,125.54,125.45,126.41,127.9,128.16,129.14,129.67,129.63,129.61,130.17,130.89,131.03,132.29,133.99,134.98,135.05,134.5,133.91,134.38,134.92,135.15,135.99,136.61,135.72,136.17,135.39,135.65,135.78,135.81,136.15,135.45,136.14,136.11,135.26,135.17,134.15,134.6,134.99,137.18,137.61,138,137.6,137.61,136.46,135.89,135.3,134.28,135.11,136.36,135.75,135.04,135.35,134.37,135.28,135.32,134.2,134.77,135.73,136.61,136.7,136.82,137.54,137.43,138.35,138.69,137.68,137.27,136.85,137.63,137.63,138.04,138.25,138.35,140.41,140.16,139.52,139.3,140.01,140.53,141.79,141.72,143.37,142.39,143.13,142.68,141.42,142.33,143.01,143.27,143.01,143.76,145.02,144.65,143.5,143.43,142.92,142.11,142.15,141.57,140.35,140.4,138.89,139.37,139.39,139.18,140.64,140.05,140.04,140.37,140.63,141.55,142.06,142.25,143.26,142.76,141.95,142.52,142.96,142.96,143.58,143.68,144.25,144.21,143.51,142.47,142.17,143.37,143.06,143.3,142.34,141.01,141.58,142.69,143.39,142.74,142.35,141.81,140.51,138.99,140.45,142.26,143.64,144.06,143.86,144.24,144.74,144.89,144.81,145.08,146.15,144.54,143.03,142.46,142.49,141.33,140.57,139.27,140.04,139.72,140.16,138.83,138.27,139.13,139.57,138.99,138.36,138.84,139.77,139.5,139.44,139.51,138.85,139.28,139.3,138.35,137.96,138.41,139.15,138.14,136.97,135.52,135.01,136.17,134.95,135.55,136.67,135.63,135.75,134.73,134.55,134.49,134.46,133.19,133.63,134.78,134.31,133.91,133.38,132.57,132.64,131.38,130.3,131.14,131.16,131.14,132.53,132.81,131.87,133.84,134.77,134.38,135.88,135.65,135.65,134.5,135.94,135.08,134.68,135.2,134.55,136.3,137.95,137.74,137.51,138.31,139.65,139.49,138.85,139.32,138.65,138.61,139.92,138.39,137.41,137.16,138.56,138.28,138.24,139.41,139.46,137.95,138.79,138.01,139.34,139.62,140.16,139.78,140.97,142.33,142.1,142.02,142.81,141.66,141.47,142.49,142.32,143.36,143.51,143.48,143.43,142.66,143.3,144.09,144.02,144.24,145.09,144.4,143.91,144.8,144.77,146.35,147.91,145.31,144.22,144.56,144.66,143.72,144.94,143.65,144.26,144.45,145.39,143.08,142.62,143.52,144.09,144.37,145.19,144.69,143.67,143.64,143.13,142.59,143.37,143.41,142.9,145.92,145.96,145.96,145.84,146.75,147.39,147.36,147.94,148.73,147.96,147.09,145.43,145,142.71,143.28,143.51,143.16,144.48,145.27,143.44,143.84,143.4,144.24,144.15,143.83,142.99,142.61,143.04,142.73,143.3,144.3,143.74,144.27,143.71,143.22,142.98,142.02,141.34,142.83,143.95,143.94,144.8,145.17,144.81,145.58,146.09,145.89,144.7,143.82,144.41,144.59,143.06,143.86,144.49,143.85,143.84,143.38,143.73,142.52,142.27,143.34,141.99,142.68,141.41,139.64,140.18,140.51,141.46,141.41,141.85,142.15,141.88,142.3,142.32,143.41,144.73,143.56,143.8,144.73,146.49,146.4,146.36,145.85,146.01,145.16,144.77,145.26,146.25,146.75,145.63,146.69,147.28,147.41,148.24,146.03,145.14,144.95]}],"lookback_days":126,"vol_days":63,"target_vol_pct":10,"max_leverage":2,"cost_bps":5,"periods_per_year":252},"example_note":"Made-up illustrative numbers, not market data, a price, a quote or a real position; send your own.","input":{"type":"object","required":["markets","target_vol_pct","max_leverage","cost_bps","periods_per_year"],"properties":{"markets":{"type":"array","description":"The markets, up to 12, with equal numbers of prices.","items":{"type":"object","required":["name","prices"],"properties":{"name":{"type":"string","description":"A label for the market, such as Market A.","maxLength":60},"prices":{"type":"array","description":"Prices, oldest first, above zero. 60 to 2000 points.","items":{"type":"number","description":"One price, above zero.","minimum":1e-9,"maximum":1000000000000},"maxItems":2000,"minItems":60}}},"maxItems":12,"minItems":1},"lookback_days":{"type":"integer","description":"Trailing window for the direction, in points. Default 126.","minimum":1,"maximum":1500},"vol_days":{"type":"integer","description":"Trailing window for rolling vol, in points. Default 63.","minimum":2,"maximum":1500},"target_vol_pct":{"type":"number","description":"Annual vol target for the whole book, in percent.","minimum":0.01,"maximum":200},"max_leverage":{"type":"number","description":"Cap on the size of each market's weight: 2 is 200% of NAV.","minimum":0.01,"maximum":100},"cost_bps":{"type":"number","description":"Cost per unit of turnover, in basis points.","minimum":0,"maximum":1000},"periods_per_year":{"type":"number","description":"Points per year, such as 252 for daily.","minimum":1,"maximum":366}}}},{"name":"risk_parity","title":"Risk parity","description":"Solves equal risk contribution weights for the vols and correlations sent, shows the leverage that reaches a vol target and what financing it costs, then moves every correlation up 0.3 with weights held and shows the new vol and the leverage cut. The vols and correlations come from the caller, and the 0.3 move is fixed. It is arithmetic on those estimates, not an allocation to follow and not a forecast.","get":"https://hedgefund.md/api/v1/risk_parity","post":"https://hedgefund.md/api/v1/risk_parity","example_body":{"assets":[{"name":"Stock sleeve","vol_pct":16,"expected_return_pct":7},{"name":"Bond sleeve","vol_pct":6,"expected_return_pct":4.5},{"name":"Commodity sleeve","vol_pct":18,"expected_return_pct":5},{"name":"Inflation bond sleeve","vol_pct":7,"expected_return_pct":4.5}],"corr":[[1,0.1,0.3,0.1],[0.1,1,-0.1,0.6],[0.3,-0.1,1,0.2],[0.1,0.6,0.2,1]],"target_vol_pct":10,"financing_rate_pct":4,"reference_weights_pct":[60,40,0,0]},"example_note":"Made-up illustrative numbers, not market data, a price, a quote or a real position; send your own.","input":{"type":"object","required":["assets","corr","target_vol_pct","financing_rate_pct"],"properties":{"assets":{"type":"array","description":"The assets, up to 40.","items":{"type":"object","required":["name","vol_pct"],"properties":{"name":{"type":"string","description":"A label for the asset, such as Bond sleeve.","maxLength":60},"vol_pct":{"type":"number","description":"Annual volatility, in percent. Must be above zero.","minimum":0.01,"maximum":500},"expected_return_pct":{"type":"number","description":"Optional hypothetical annual return, in percent. Send it for all assets or none.","minimum":-100,"maximum":500}}},"maxItems":40,"minItems":1},"corr":{"type":"array","description":"Correlation matrix, in the order of assets.","items":{"type":"array","description":"One row of the matrix.","items":{"type":"number","description":"A correlation.","minimum":-1,"maximum":1},"maxItems":40,"minItems":1},"maxItems":40,"minItems":1},"target_vol_pct":{"type":"number","description":"Annual vol target for the levered book, in percent.","minimum":0.01,"maximum":200},"financing_rate_pct":{"type":"number","description":"Annual rate on leverage above 1, in percent.","minimum":-10,"maximum":100},"reference_weights_pct":{"type":"array","description":"Optional weights to compare against, in percent, in the order of assets.","items":{"type":"number","description":"One reference weight, in percent.","minimum":-1000,"maximum":1000},"maxItems":40}}}},{"name":"rates_ladder","title":"Rates ladder","description":"Prices a ladder of fixed coupon bonds from the yields sent: dirty and clean price, Macaulay and modified duration, convexity, DV01, a shock table of full repricing against the duration and convexity estimate, carry and roll-down over a horizon, and the parallel shift that takes the horizon return to zero. Yields come from the caller. It is arithmetic on those numbers, not a view on rates.","get":"https://hedgefund.md/api/v1/rates_ladder","post":"https://hedgefund.md/api/v1/rates_ladder","example_body":{"bonds":[{"name":"Bond 1.25y","face":1000000,"coupon_pct":3.5,"maturity_years":1.25,"yield_pct":3.9,"freq":2},{"name":"Bond 2.5y","face":1000000,"coupon_pct":4,"maturity_years":2.5,"yield_pct":4.1,"freq":2},{"name":"Bond 3.75y","face":1000000,"coupon_pct":4,"maturity_years":3.75,"yield_pct":4.3,"freq":4},{"name":"Bond 5y","face":1000000,"coupon_pct":4.5,"maturity_years":5,"yield_pct":4.5,"freq":1},{"name":"Bond 10y","face":1000000,"coupon_pct":5,"maturity_years":10,"yield_pct":5.1,"freq":2}],"shocks_bps":[-100,-50,50,100,200],"horizon_years":0.5,"curve":[{"years":0.5,"yield_pct":3.6},{"years":1,"yield_pct":3.8},{"years":2,"yield_pct":4},{"years":3,"yield_pct":4.2},{"years":5,"yield_pct":4.5},{"years":10,"yield_pct":5}]},"example_note":"Made-up illustrative numbers, not market data, a price, a quote or a real position; send your own.","input":{"type":"object","required":["bonds","horizon_years"],"properties":{"bonds":{"type":"array","description":"The ladder, up to 40 fixed coupon bonds.","items":{"type":"object","required":["name","face","coupon_pct","maturity_years","yield_pct","freq"],"properties":{"name":{"type":"string","description":"A label for the bond, such as Bond 5y.","maxLength":60},"face":{"type":"number","description":"Face amount held.","minimum":0.01,"maximum":1000000000000},"coupon_pct":{"type":"number","description":"Annual coupon on face, in percent.","minimum":0,"maximum":100},"maturity_years":{"type":"number","description":"Years to maturity. Flows are counted back from it, so a fraction makes a stub.","minimum":0.01,"maximum":50},"yield_pct":{"type":"number","description":"Yield to maturity, compounded freq times a year, in percent.","minimum":-5,"maximum":60},"freq":{"type":"integer","description":"Coupons a year: 1, 2 or 4.","minimum":1,"maximum":4}}},"maxItems":40,"minItems":1},"shocks_bps":{"type":"array","description":"Parallel yield shocks to reprice, in basis points. Default -100, -50, 50, 100.","items":{"type":"number","description":"One shock, in basis points.","minimum":-1000,"maximum":3000},"maxItems":15},"horizon_years":{"type":"number","description":"Years to carry the ladder forward.","minimum":0.01,"maximum":30},"curve":{"type":"array","description":"Optional curve for roll-down, up to 30 points.","items":{"type":"object","required":["years","yield_pct"],"properties":{"years":{"type":"number","description":"Point on the curve, in years.","minimum":0.01,"maximum":100},"yield_pct":{"type":"number","description":"Yield at that point, in percent.","minimum":-5,"maximum":60}}},"maxItems":30,"minItems":1}}}},{"name":"options_book","title":"Options book","description":"Prices a book of European options by Black-Scholes-Merton and gives value, delta, gamma, vega, theta and rho per leg and for the book, a full-reprice P and L grid across spot and vol shocks, the worst node against capital, and exact expiry break-evens. Every price, vol and rate comes from the caller. Not a quote, a margin figure or advice.","get":"https://hedgefund.md/api/v1/options_book","post":"https://hedgefund.md/api/v1/options_book","example_body":{"spot":100,"rate_pct":4,"dividend_yield_pct":1,"capital":50000,"loss_limit_pct":25,"legs":[{"type":"put","qty":-10,"strike":90,"expiry_years":0.25,"vol_pct":26,"multiplier":100},{"type":"put","qty":10,"strike":80,"expiry_years":0.25,"vol_pct":32,"multiplier":100},{"type":"call","qty":-10,"strike":110,"expiry_years":0.25,"vol_pct":20,"multiplier":100}],"spot_shocks_pct":[-30,-20,-10,-5,0,5,10,20,30],"vol_shocks_pts":[-5,0,5,10,20]},"example_note":"Made-up illustrative numbers, not market data, a price, a quote or a real position; send your own.","input":{"type":"object","required":["spot","rate_pct","dividend_yield_pct","capital","legs"],"additionalProperties":false,"properties":{"spot":{"type":"number","minimum":0.000001,"maximum":1000000000,"description":"Spot price of the underlying."},"rate_pct":{"type":"number","minimum":-10,"maximum":50,"description":"Continuously compounded interest rate. 4 means 4%."},"dividend_yield_pct":{"type":"number","minimum":-10,"maximum":50,"description":"Continuous dividend yield on the underlying. 1 means 1%."},"capital":{"type":"number","minimum":0.01,"maximum":10000000000000,"description":"Capital the worst loss is measured against."},"legs":{"type":"array","minItems":1,"maxItems":30,"description":"The options in the book. Up to 30.","items":{"type":"object","required":["type","qty","strike","expiry_years","vol_pct"],"additionalProperties":false,"properties":{"type":{"type":"string","enum":["call","put"],"description":"Call or put."},"qty":{"type":"number","minimum":-10000000,"maximum":10000000,"description":"Contracts, signed. Negative is short."},"strike":{"type":"number","minimum":0.000001,"maximum":1000000000,"description":"Strike price."},"expiry_years":{"type":"number","minimum":0,"maximum":30,"description":"Years to expiry. 0 means expiring now."},"vol_pct":{"type":"number","minimum":0,"maximum":500,"description":"This leg's volatility. 20 means 20%."},"multiplier":{"type":"number","minimum":0.000001,"maximum":1000000,"description":"Units of underlying per contract. Default 100."}}}},"spot_shocks_pct":{"type":"array","maxItems":15,"description":"Instant spot moves for the grid. -10 means down 10%. Left out or empty uses -30 to +30.","items":{"type":"number","minimum":-99,"maximum":500,"description":"A spot move in percent."}},"vol_shocks_pts":{"type":"array","maxItems":15,"description":"Vol shifts for the grid, in vol points on every leg. Left out or empty uses -5 to +20.","items":{"type":"number","minimum":-100,"maximum":300,"description":"A vol shift in points."}},"loss_limit_pct":{"type":"number","minimum":0.01,"maximum":1000,"description":"The caller's own loss line, as a share of capital, for flags and flips. Default 25."}}}},{"name":"variance_carry","title":"Variance carry","description":"Computes the settlement P and L of a variance position from its strike and vega notional, with realized vol taken from the caller's prices or sent directly. Shows the convexity from half the strike to three times it, and how much faster a short loses than it earns. All numbers come from the caller. Not a quote, a forecast of vol or advice.","get":"https://hedgefund.md/api/v1/variance_carry","post":"https://hedgefund.md/api/v1/variance_carry","example_get":"https://hedgefund.md/api/v1/variance_carry?strike_vol_pct=20&vega_notional=10000&side=short&realized_vol_pct=26&capital=1000000","example_body":{"strike_vol_pct":20,"vega_notional":10000,"side":"short","realized_vol_pct":26,"capital":1000000},"example_note":"Made-up illustrative numbers, not market data, a price, a quote or a real position; send your own.","input":{"type":"object","required":["strike_vol_pct","vega_notional","side"],"additionalProperties":false,"properties":{"strike_vol_pct":{"type":"number","minimum":0.01,"maximum":500,"description":"Variance strike quoted in vol. 20 means 20%."},"vega_notional":{"type":"number","minimum":0.01,"maximum":10000000000,"description":"Money per vol point at the strike."},"side":{"type":"string","enum":["long","short"],"description":"Long receives realized variance. Short pays it."},"prices":{"type":"array","minItems":2,"maxItems":2000,"description":"Price series for realized vol, oldest first. Send this or realized_vol_pct, not both.","items":{"type":"number","minimum":0.000001,"maximum":1000000000000,"description":"A price."}},"realized_vol_pct":{"type":"number","minimum":0,"maximum":2000,"description":"Realized vol, if not sending prices. 25 means 25%."},"periods_per_year":{"type":"number","minimum":1,"maximum":100000,"description":"Price periods in a year, needed with prices. 252 for trading days, 365 for calendar days."},"capital":{"type":"number","minimum":0.01,"maximum":10000000000000,"description":"Optional. Capital behind the position, for the sleeve and the wipe-out flip."}}}},{"name":"credit_carry","title":"Credit carry","description":"Turns each credit's spread and recovery into a hazard rate and a one-year default chance, then gives carry, spread DV01, jump to default, excess spread over a real-world default rate, a widening table and the break-even widening. All spreads and default rates come from the caller. Not a rating, a price or advice.","get":"https://hedgefund.md/api/v1/credit_carry","post":"https://hedgefund.md/api/v1/credit_carry","example_body":{"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]},"example_note":"Made-up illustrative numbers, not market data, a price, a quote or a real position; send your own.","input":{"type":"object","required":["credits","nav"],"additionalProperties":false,"properties":{"credits":{"type":"array","minItems":1,"maxItems":100,"description":"The credits held long, each earning its spread. Up to 100.","items":{"type":"object","required":["name","notional","spread_bps","recovery_pct","spread_duration_years"],"additionalProperties":false,"properties":{"name":{"type":"string","maxLength":60,"description":"A label, such as Credit A."},"notional":{"type":"number","minimum":0.01,"maximum":10000000000000,"description":"Position size."},"spread_bps":{"type":"number","minimum":0,"maximum":10000,"description":"Credit spread in basis points."},"recovery_pct":{"type":"number","minimum":0,"maximum":99,"description":"Recovery at default. 40 means 40%."},"spread_duration_years":{"type":"number","minimum":0,"maximum":30,"description":"Spread duration in years."},"real_world_pd_pct":{"type":"number","minimum":0,"maximum":100,"description":"Optional. The caller's yearly real-world default rate. 2 means 2%."}}}},"nav":{"type":"number","minimum":0.01,"maximum":100000000000000,"description":"Net asset value the positions are measured against."},"widening_bps":{"type":"array","maxItems":12,"description":"Parallel spread moves for the table. Left out or empty uses 25 to 400.","items":{"type":"number","minimum":-5000,"maximum":20000,"description":"A spread move in basis points."}}}}},{"name":"private_credit_tape","title":"Private credit tape","description":"Runs a loan tape through a one-factor Gaussian copula and a senior-first waterfall. Gives each tranche's expected loss, impairment chance, 99% tail loss and coupon cover, the pool loss distribution, and the junior size that puts the senior's impairment chance at 1%. Loans, rates and default rates come from the caller. Not a rating, an offering or advice.","get":"https://hedgefund.md/api/v1/private_credit_tape","post":"https://hedgefund.md/api/v1/private_credit_tape","example_body":{"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},"example_note":"Made-up illustrative numbers, not market data, a price, a quote or a real position; send your own.","input":{"type":"object","required":["loans","tranches","asset_correlation_pct","horizon_years"],"additionalProperties":false,"properties":{"loans":{"type":"array","minItems":1,"maxItems":100,"description":"The loan tape. Up to 100 loans.","items":{"type":"object","required":["name","balance","rate_pct","pd_annual_pct","lgd_pct"],"additionalProperties":false,"properties":{"name":{"type":"string","maxLength":60,"description":"A label, such as Loan 3."},"balance":{"type":"number","minimum":0.01,"maximum":10000000000000,"description":"Loan balance."},"rate_pct":{"type":"number","minimum":0,"maximum":100,"description":"Interest rate a year. 10 means 10%."},"pd_annual_pct":{"type":"number","minimum":0,"maximum":100,"description":"Yearly default chance. 3 means 3%."},"lgd_pct":{"type":"number","minimum":0,"maximum":100,"description":"Loss given default, as a share of balance. 45 means 45%."}}}},"tranches":{"type":"array","minItems":1,"maxItems":10,"description":"Tranches, senior first, sizes summing to 100.","items":{"type":"object","required":["name","size_pct","coupon_pct"],"additionalProperties":false,"properties":{"name":{"type":"string","maxLength":60,"description":"A label, such as Senior."},"size_pct":{"type":"number","minimum":0.01,"maximum":100,"description":"Share of the pool. 70 means 70%."},"coupon_pct":{"type":"number","minimum":0,"maximum":100,"description":"Coupon a year on the tranche's starting size. 0 for a residual."}}}},"asset_correlation_pct":{"type":"number","minimum":0,"maximum":100,"description":"Asset correlation rho in the one-factor copula. 20 means 20%."},"horizon_years":{"type":"number","minimum":0.25,"maximum":30,"description":"Years the tape runs."},"servicing_bps":{"type":"number","minimum":0,"maximum":1000,"description":"Servicing fee a year on the starting pool, paid first from interest. Default 0."},"sims":{"type":"integer","minimum":100,"maximum":5000,"description":"Monte Carlo paths, up to 5000. Default 5000."},"seed":{"type":"integer","minimum":0,"maximum":2147483647,"description":"Seed for the draws. The same seed gives the same bytes. Default 1."}}}},{"name":"basis_carry","title":"Basis carry","description":"Computes a long spot, short derivative position: annualized basis, net carry after fees and financing, the price rise that liquidates the short, extra margin needed at larger rises, and the funding where net carry is zero. Prices, funding and rates come from the caller. Funding can turn negative. Not a quote, a forecast or advice.","get":"https://hedgefund.md/api/v1/basis_carry","post":"https://hedgefund.md/api/v1/basis_carry","example_get":"https://hedgefund.md/api/v1/basis_carry?instrument=perp&spot_price=1000&derivative_price=1002&funding_bps_per_8h=1&notional=1000000&short_leverage=4&maintenance_margin_pct=2&fees_bps_round_trip=12&borrow_rate_pct=8&financed_share_pct=50&collateral_haircut_pct=15&holding_days=90","example_body":{"instrument":"perp","spot_price":1000,"derivative_price":1002,"funding_bps_per_8h":1,"notional":1000000,"short_leverage":4,"maintenance_margin_pct":2,"fees_bps_round_trip":12,"borrow_rate_pct":8,"financed_share_pct":50,"collateral_haircut_pct":15,"holding_days":90},"example_note":"Made-up illustrative numbers, not market data, a price, a quote or a real position; send your own.","input":{"type":"object","required":["instrument","spot_price","derivative_price","notional","short_leverage","maintenance_margin_pct","fees_bps_round_trip","holding_days"],"additionalProperties":false,"properties":{"instrument":{"type":"string","enum":["perp","dated"],"description":"The short leg: a perpetual with funding, or a future with an expiry."},"spot_price":{"type":"number","minimum":0.000001,"maximum":1000000000,"description":"Spot price."},"derivative_price":{"type":"number","minimum":0.000001,"maximum":1000000000,"description":"Price of the short leg at entry."},"funding_bps_per_8h":{"type":"number","minimum":-1000,"maximum":1000,"description":"Perp only, and required for it. Funding a short receives per 8 hours, in basis points. Negative means the short pays."},"days_to_expiry":{"type":"number","minimum":0.01,"maximum":3650,"description":"Dated only, and required for it. Calendar days to expiry."},"notional":{"type":"number","minimum":0.01,"maximum":10000000000000,"description":"Size of the short leg at the derivative price."},"short_leverage":{"type":"number","minimum":0.01,"maximum":200,"description":"Notional over posted collateral on the short leg. 4 means 4 times."},"maintenance_margin_pct":{"type":"number","minimum":0,"maximum":100,"description":"Maintenance margin as a share of the short's value at the current price."},"fees_bps_round_trip":{"type":"number","minimum":0,"maximum":1000,"description":"All entry and exit costs on both legs, in basis points of notional, charged once."},"borrow_rate_pct":{"type":"number","minimum":0,"maximum":200,"description":"Yearly rate on any financed spot. 8 means 8%. Default 0."},"financed_share_pct":{"type":"number","minimum":0,"maximum":100,"description":"Share of the spot cost that is borrowed. Default 0."},"collateral_haircut_pct":{"type":"number","minimum":0,"maximum":100,"description":"Haircut on the posted collateral. Default 0."},"holding_days":{"type":"number","minimum":0.01,"maximum":3650,"description":"Calendar days the position stays on."}}}},{"name":"reserve_coverage","title":"Reserve coverage","description":"Tests a reserve against redemptions at par: coverage after haircuts, cash available by day against cumulative redemptions, the first shortfall day and the largest daily redemption rate with no shortfall, plus net income on the reserve yield. All balances and rates come from the caller. Not an audit, an attestation or advice.","get":"https://hedgefund.md/api/v1/reserve_coverage","post":"https://hedgefund.md/api/v1/reserve_coverage","example_body":{"tokens_outstanding":100000000,"reserves":[{"name":"Bank cash","amount":10000000,"haircut_pct":0,"days_to_cash":0},{"name":"Bill 30d","amount":30000000,"haircut_pct":0.5,"days_to_cash":3},{"name":"Bill 90d","amount":30000000,"haircut_pct":1,"days_to_cash":5},{"name":"Loan note","amount":25000000,"haircut_pct":5,"days_to_cash":30},{"name":"Property note","amount":10000000,"haircut_pct":15,"days_to_cash":120}],"daily_redemption_pct":5,"horizon_days":60,"reserve_yield_pct":4,"fee_bps":30},"example_note":"Made-up illustrative numbers, not market data, a price, a quote or a real position; send your own.","input":{"type":"object","required":["tokens_outstanding","reserves","daily_redemption_pct","horizon_days"],"additionalProperties":false,"properties":{"tokens_outstanding":{"type":"number","minimum":0.01,"maximum":100000000000000,"description":"Tokens outstanding, redeemable at par of 1."},"reserves":{"type":"array","minItems":1,"maxItems":30,"description":"The reserve ladder. Up to 30 lines.","items":{"type":"object","required":["name","amount","haircut_pct","days_to_cash"],"additionalProperties":false,"properties":{"name":{"type":"string","maxLength":60,"description":"A label, such as Bill 90d."},"amount":{"type":"number","minimum":0,"maximum":100000000000000,"description":"Face amount of this reserve."},"haircut_pct":{"type":"number","minimum":0,"maximum":100,"description":"Loss on turning it into cash. 5 means 5%."},"days_to_cash":{"type":"integer","minimum":0,"maximum":3650,"description":"Days until it's cash. 0 means today."}}}},"daily_redemption_pct":{"type":"number","minimum":0,"maximum":100,"description":"Share of tokens still outstanding redeemed each day. 2 means 2%."},"horizon_days":{"type":"integer","minimum":1,"maximum":730,"description":"Days to test."},"reserve_yield_pct":{"type":"number","minimum":-10,"maximum":100,"description":"Yearly yield on the reserve's face amount. 4 means 4%. Default 0."},"fee_bps":{"type":"number","minimum":0,"maximum":2000,"description":"Yearly fee on the reserve's face amount, in basis points. Default 0."}}}},{"name":"fee_waterfall","title":"Fee waterfall","description":"Runs a series of gross returns through a management fee, a performance fee, a hurdle and a high-water mark, period by period. Shows net against gross, fees by kind, the mark and the drag. All numbers come from the caller. It is arithmetic on the terms sent, not a reading of any fund's documents and not a forecast.","get":"https://hedgefund.md/api/v1/fee_waterfall","post":"https://hedgefund.md/api/v1/fee_waterfall","example_body":{"nav_start":100000000,"gross_returns_pct":[5,3,4,2,-6,-5,1,-2,6,5,4,3,2,3],"periods_per_year":4,"mgmt_fee_pct_annual":2,"perf_fee_pct":20,"hurdle_pct_annual":4,"hurdle_type":"hard","crystallize_every":4,"use_hwm":true},"example_note":"Made-up illustrative numbers, not market data, a price, a quote or a real position; send your own.","input":{"type":"object","required":["nav_start","gross_returns_pct","periods_per_year","mgmt_fee_pct_annual","perf_fee_pct","crystallize_every"],"properties":{"nav_start":{"type":"number","exclusiveMinimum":0,"maximum":10000000000000,"description":"NAV at the start, in money."},"gross_returns_pct":{"type":"array","minItems":1,"maxItems":240,"items":{"type":"number","minimum":-100,"maximum":200,"description":"Gross return of one period in percent. 2 means 2%."},"description":"Gross return of each period in percent, oldest first."},"periods_per_year":{"type":"integer","minimum":1,"maximum":365,"description":"Periods in a year: 12 for months, 4 for quarters."},"mgmt_fee_pct_annual":{"type":"number","minimum":0,"maximum":20,"description":"Management fee a year in percent. One period pays this divided by periods_per_year, on opening NAV."},"perf_fee_pct":{"type":"number","minimum":0,"maximum":100,"description":"Performance fee in percent of the gains it applies to."},"hurdle_pct_annual":{"type":"number","minimum":0,"maximum":100,"default":0,"description":"Hurdle a year in percent. Ignored when hurdle_type is none."},"hurdle_type":{"type":"string","enum":["none","hard","soft"],"default":"none","description":"none; hard, a fee only on gains above the hurdle line; soft, a fee on all gains above the mark once past the line."},"crystallize_every":{"type":"integer","minimum":1,"maximum":240,"description":"Periods between dates when the accrued performance fee is paid."},"use_hwm":{"type":"boolean","default":true,"description":"true compares with the high-water mark. false compares with the NAV after fees at the last date, up or down."}}}},{"name":"redemption_gates","title":"Redemption gates","description":"Walks a redemption request through notice, dealing dates and a gate against assets with their own days to cash and haircuts. Shows what is paid, sold and left on each date, and what the holders who stay end up with. All numbers come from the caller. It is arithmetic on a list of assets, not a liquidity opinion or a reading of any fund's terms.","get":"https://hedgefund.md/api/v1/redemption_gates","post":"https://hedgefund.md/api/v1/redemption_gates","example_body":{"assets":[{"name":"Cash","value":5000000,"days_to_cash":0,"haircut_pct":0},{"name":"Bill 90d","value":10000000,"days_to_cash":2,"haircut_pct":0},{"name":"Stock basket A","value":15000000,"days_to_cash":10,"haircut_pct":1},{"name":"Loan book B","value":40000000,"days_to_cash":180,"haircut_pct":6},{"name":"Office tower A tokens","value":30000000,"days_to_cash":365,"haircut_pct":20}],"redemption_request_pct":40,"notice_days":30,"frequency_days":30,"gate_pct_per_period":10},"example_note":"Made-up illustrative numbers, not market data, a price, a quote or a real position; send your own.","input":{"type":"object","required":["assets","redemption_request_pct","notice_days","frequency_days","gate_pct_per_period"],"properties":{"assets":{"type":"array","minItems":1,"maxItems":40,"description":"What the fund has, at carrying value.","items":{"type":"object","required":["name","value","days_to_cash","haircut_pct"],"properties":{"name":{"type":"string","maxLength":60,"description":"A label, such as Bill 90d."},"value":{"type":"number","minimum":0,"maximum":10000000000000,"description":"Carrying value in money."},"days_to_cash":{"type":"integer","minimum":0,"maximum":3650,"description":"Days from starting a sale to having the cash."},"haircut_pct":{"type":"number","minimum":0,"maximum":99,"description":"Percent below carrying value that a sale brings in."}}}},"redemption_request_pct":{"type":"number","minimum":0,"maximum":100,"description":"Share of the fund asked for on day 0, in percent."},"notice_days":{"type":"integer","minimum":0,"maximum":730,"description":"Days from the request to the first redemption date."},"frequency_days":{"type":"integer","minimum":1,"maximum":730,"description":"Days between redemption dates."},"gate_pct_per_period":{"type":"number","minimum":0,"maximum":100,"description":"Most that can be paid on one date, in percent of NAV on that date. 100 means no gate."}}}},{"name":"book_risk","title":"Book risk","description":"Takes a return series and gives annual vol, skew, kurtosis, historical VaR and expected shortfall, normal and Cornish-Fisher VaR, and the max drawdown with its length and recovery, in percent and money. All returns come from the caller. It describes the series sent. It is not a forecast of loss, and it says when too few observations sit behind a tail figure.","get":"https://hedgefund.md/api/v1/book_risk","post":"https://hedgefund.md/api/v1/book_risk","example_body":{"returns_pct":[1.2,0.8,1,0.6,1.4,-0.4,1,0.8,1.2,0.4,0.6,1,0.8,1.2,-0.6,1,0.6,0.8,1.4,0.2,-6,-3,1.6,2,1,0.8,0.4,1.2,-0.8,1,0.6,1.2,0.8,0.4,1,0.6,1.2,-1,0.8,1,0.6,1.4,0.8,-0.2,1,1.2,0.4,0.8,-4,0.4,1,1.2,0.8,0.6,1,0.4,0.8,1.2,0.6,1],"periods_per_year":12,"confidence_pct":95,"nav":100000000},"example_note":"Made-up illustrative numbers, not market data, a price, a quote or a real position; send your own.","input":{"type":"object","required":["returns_pct","periods_per_year","confidence_pct","nav"],"properties":{"returns_pct":{"type":"array","minItems":2,"maxItems":2000,"items":{"type":"number","minimum":-100,"maximum":200,"description":"Return of one period in percent. 1.5 means 1.5%."},"description":"Simple return of each period in percent, oldest first."},"periods_per_year":{"type":"integer","minimum":1,"maximum":365,"description":"Periods in a year: 252 for trading days, 12 for months."},"confidence_pct":{"type":"number","minimum":90,"maximum":99.9,"description":"Confidence for VaR and shortfall, in percent."},"nav":{"type":"number","exclusiveMinimum":0,"maximum":10000000000000,"description":"NAV in money, for the money figures."}}}},{"name":"stress_book","title":"Stress the book","description":"Applies shocks to equity, rates, spreads, vol, token discounts and FX across a book of weighted sleeves, using the sensitivities sent. Shows P and L by sleeve, factor and scenario, the worst scenario and what drove it. The sensitivities come from the caller. With no scenarios sent it uses generic shocks chosen for round numbers, not history. It is a first-order map, not a probability or a forecast.","get":"https://hedgefund.md/api/v1/stress_book","post":"https://hedgefund.md/api/v1/stress_book","example_body":{"sleeves":[{"name":"Long-short equity","weight_pct":30,"equity_beta":0.5},{"name":"Credit carry","weight_pct":25,"equity_beta":0.2,"rates_dv01_pct_per_100bp":-1,"spread_duration_years":4},{"name":"Tokenized bills","weight_pct":15,"rates_dv01_pct_per_100bp":-0.25,"token_discount_share_pct":100},{"name":"Tokenized property","weight_pct":20,"equity_beta":0.1,"rates_dv01_pct_per_100bp":-3,"spread_duration_years":3,"token_discount_share_pct":100,"fx_delta_pct":20},{"name":"Vol overlay","weight_pct":10,"equity_beta":-0.5,"vega_pct_per_vol_pt":2}],"scenarios":[{"name":"Equities fall","equity_pct":-25,"rates_bps":-50,"spread_bps":150,"vol_pts":20,"token_discount_pct":3,"fx_pct":-2},{"name":"Rates up, spreads wider","equity_pct":-8,"rates_bps":150,"spread_bps":100,"vol_pts":5,"token_discount_pct":2,"fx_pct":0},{"name":"Token discount opens","equity_pct":-3,"rates_bps":0,"spread_bps":50,"vol_pts":2,"token_discount_pct":15,"fx_pct":0},{"name":"Currency slides","equity_pct":-2,"rates_bps":0,"spread_bps":0,"vol_pts":2,"token_discount_pct":1,"fx_pct":-15}],"max_loss_pct":5},"example_note":"Made-up illustrative numbers, not market data, a price, a quote or a real position; send your own.","input":{"type":"object","required":["sleeves"],"properties":{"sleeves":{"type":"array","minItems":1,"maxItems":40,"description":"The book. Weights are percent of NAV. Whatever they don't cover is cash at zero P and L.","items":{"type":"object","required":["name","weight_pct"],"properties":{"name":{"type":"string","maxLength":60,"description":"A label, such as Credit carry."},"weight_pct":{"type":"number","minimum":-500,"maximum":500,"description":"Weight in percent of NAV. Negative for a short sleeve."},"equity_beta":{"type":"number","minimum":-20,"maximum":20,"description":"Percent the sleeve moves per 1% on equities."},"rates_dv01_pct_per_100bp":{"type":"number","minimum":-100,"maximum":100,"description":"Percent the sleeve gains when rates rise 100 bp. A long bond sleeve is negative: about -5 for a 5-year."},"spread_duration_years":{"type":"number","minimum":-50,"maximum":50,"description":"Spread duration in years. Positive loses when spreads widen."},"vega_pct_per_vol_pt":{"type":"number","minimum":-50,"maximum":50,"description":"Percent the sleeve gains per vol point up."},"token_discount_share_pct":{"type":"number","minimum":0,"maximum":100,"description":"Share of the sleeve held as tokens that can trade under NAV, in percent."},"fx_delta_pct":{"type":"number","minimum":-500,"maximum":500,"description":"Percent of the sleeve exposed to the foreign currency. Gains when that currency rises."}}}},"scenarios":{"type":"array","maxItems":40,"description":"Shocks. Leave out to use generic shocks, not history.","items":{"type":"object","required":["name"],"properties":{"name":{"type":"string","maxLength":60,"description":"A label for the shock."},"equity_pct":{"type":"number","minimum":-100,"maximum":300,"description":"Equity move in percent."},"rates_bps":{"type":"number","minimum":-2000,"maximum":2000,"description":"Rate move in basis points."},"spread_bps":{"type":"number","minimum":-2000,"maximum":5000,"description":"Spread move in basis points. Up is wider."},"vol_pts":{"type":"number","minimum":-100,"maximum":300,"description":"Implied vol move in vol points."},"token_discount_pct":{"type":"number","minimum":0,"maximum":100,"description":"Discount of tokens to NAV in percent."},"fx_pct":{"type":"number","minimum":-100,"maximum":300,"description":"Move of the foreign currency in percent."}}}},"max_loss_pct":{"type":"number","exclusiveMinimum":0,"maximum":100,"description":"Optional limit on a scenario's loss, in percent of NAV."}}}},{"name":"size_position","title":"Position size limits","description":"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.","get":"https://hedgefund.md/api/v1/size_position","post":"https://hedgefund.md/api/v1/size_position","example_get":"https://hedgefund.md/api/v1/size_position?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","example_body":{"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},"example_note":"Made-up illustrative numbers, not market data, a price, a quote or a real position; send your own.","input":{"type":"object","required":["nav","vol_pct","expected_return_pct","risk_budget_pct_nav","adv_value","max_participation_pct","days_to_build"],"properties":{"nav":{"type":"number","exclusiveMinimum":0,"maximum":10000000000000,"description":"NAV in money."},"vol_pct":{"type":"number","minimum":0,"maximum":500,"description":"Annual vol of the position in percent."},"expected_return_pct":{"type":"number","minimum":-100,"maximum":500,"description":"Expected return a year in percent, read as over the funding cost. The caller's own estimate."},"kelly_fraction":{"type":"number","exclusiveMinimum":0,"maximum":2,"default":0.25,"description":"Fraction of full Kelly. 0.25 means a quarter."},"risk_budget_pct_nav":{"type":"number","minimum":0,"maximum":100,"description":"Risk budget in percent of NAV: one year's vol for the vol budget, the loss at the stop for the stop."},"stop_pct":{"type":"number","minimum":0,"maximum":100,"description":"Optional stop distance in percent of the position's value."},"adv_value":{"type":"number","minimum":0,"maximum":10000000000000,"description":"Average daily traded value, in money."},"max_participation_pct":{"type":"number","minimum":0,"maximum":100,"description":"Most of the daily value to trade, in percent."},"days_to_build":{"type":"number","minimum":1,"maximum":252,"description":"Trading days allowed to build the position."},"impact_coeff":{"type":"number","minimum":0,"maximum":10,"default":1,"description":"Coefficient on the square-root impact."},"trading_days_per_year":{"type":"integer","minimum":200,"maximum":366,"default":252,"description":"Days a year for turning annual vol into daily vol: 252, or 365 for assets that trade every day."}}}},{"name":"deflated_sharpe","title":"Deflated Sharpe","description":"Tests a reported Sharpe against what the best of many trials would show by luck, with skew, kurtosis and sample length. Gives the probabilistic and deflated Sharpe, the minimum sample length and the trial count where it falls below the confidence. All numbers come from the caller. It measures selection only. It can't detect lookahead or fitting that was not counted.","get":"https://hedgefund.md/api/v1/deflated_sharpe","post":"https://hedgefund.md/api/v1/deflated_sharpe","example_get":"https://hedgefund.md/api/v1/deflated_sharpe?sharpe_annual=1.8&periods_per_year=252&observations=1260&skew=-0.5&kurtosis=6&trials=100&trial_sharpe_std_annual=0.5&benchmark_sharpe_annual=0&confidence_pct=95","example_body":{"sharpe_annual":1.8,"periods_per_year":252,"observations":1260,"skew":-0.5,"kurtosis":6,"trials":100,"trial_sharpe_std_annual":0.5,"benchmark_sharpe_annual":0,"confidence_pct":95},"example_note":"Made-up illustrative numbers, not market data, a price, a quote or a real position; send your own.","input":{"type":"object","required":["sharpe_annual","periods_per_year","observations","skew","kurtosis","trials","trial_sharpe_std_annual","confidence_pct"],"properties":{"sharpe_annual":{"type":"number","minimum":-10,"maximum":20,"description":"Annual Sharpe of the chosen strategy."},"periods_per_year":{"type":"integer","minimum":1,"maximum":365,"description":"Periods in a year of the returns: 252, 52 or 12."},"observations":{"type":"integer","minimum":2,"maximum":1000000,"description":"Number of return periods in the sample."},"skew":{"type":"number","minimum":-50,"maximum":50,"description":"Skew of the returns. A normal is 0."},"kurtosis":{"type":"number","minimum":0,"maximum":3000,"description":"Kurtosis of the returns, not excess. A normal is 3."},"trials":{"type":"integer","minimum":1,"maximum":1000000000,"description":"Independent trials the strategy was picked from, including every one discarded."},"trial_sharpe_std_annual":{"type":"number","minimum":0,"maximum":20,"description":"Stdev across the trials' annual Sharpes."},"benchmark_sharpe_annual":{"type":"number","minimum":-10,"maximum":20,"default":0,"description":"Annual Sharpe to test against in the plain probabilistic figure."},"confidence_pct":{"type":"number","minimum":50,"maximum":99.99,"description":"Confidence to compare with, in percent."}}}},{"name":"run_book","title":"Run a whole book","description":"Runs every sleeve's model on its own numbers and adds them up: capital, gross, net, volatility from the caller's correlation, a 99% tail, sleeve tails added up, carry, a liquidity ladder, limit checks and the biggest source of risk. Says which figures came from models and which were assumed, and names any sleeve missing one. All numbers are the caller's. Not a forecast or advice.","post_only":true,"post":"https://hedgefund.md/api/v1/run_book","example_body":{"book":{"name":"Example book","currency":"USD","nav":1000000,"updated":"2026-11-01","limits":{"max_gross_pct":150,"max_vol_pct":12,"min_liquid_30d_pct":50},"correlation":0.3,"sleeves":[{"id":"sleeve_a","model":"merger_spread","capital_pct":40,"assumed":{"vol_pct":8,"liquidity_days":10},"inputs":{"deal_cash":50,"target_price":47,"break_price":35,"days_to_close":120,"financing_rate_pct":5}},{"id":"sleeve_b","model":"size_position","capital_pct":30,"assumed":{"tail_loss_pct":5,"carry_pct":2},"inputs":{"nav":1000000,"vol_pct":25,"expected_return_pct":8,"risk_budget_pct_nav":1,"adv_value":500000,"max_participation_pct":10,"days_to_build":5}}]}},"example_note":"Made-up illustrative numbers, not market data, a price, a quote or a real position; send your own.","input":{"type":"object","properties":{"book":{"type":"object","description":"The book: name, currency, nav, limits, correlation, and sleeves of { id, model, capital_pct, inputs, assumed }. Every number is your own.","required":["name","currency","nav","sleeves"],"additionalProperties":false,"properties":{"hedgefund":{"const":1,"description":"The format version."},"name":{"type":"string","minLength":1,"maxLength":120,"description":"A short name for the book, on one line."},"currency":{"type":"string","maxLength":3,"pattern":"^[A-Z]{3}$","description":"Three capital letters. A label: nothing converts it."},"nav":{"type":"number","exclusiveMinimum":0,"maximum":1000000000000000,"description":"Net asset value, in that currency."},"updated":{"type":"string","maxLength":10,"pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The date of these numbers, YYYY-MM-DD."},"limits":{"type":"object","additionalProperties":false,"description":"The limits. A book run and check_order share these names. An unknown name is refused, so a typo can't switch a limit off.","properties":{"max_capital_pct":{"type":"number","minimum":0,"maximum":100000,"description":"The most of NAV the sleeves may take, in percent."},"max_gross_pct":{"type":"number","minimum":0,"maximum":100000,"description":"The most gross exposure, in percent of NAV."},"max_net_pct":{"type":"number","minimum":0,"maximum":100000,"description":"The most net exposure either way, in percent of NAV. Compared with the size of net."},"max_vol_pct":{"type":"number","minimum":0,"maximum":100000,"description":"The most book volatility a year, in percent of NAV."},"max_var99_pct":{"type":"number","minimum":0,"maximum":100000,"description":"The most one-day 99% parametric tail, in percent of NAV."},"max_tail_sum_pct":{"type":"number","minimum":0,"maximum":100000,"description":"The most for the sleeve tails added up with no offsets, in percent of NAV."},"max_sleeve_capital_pct":{"type":"number","minimum":0,"maximum":100000,"description":"The most capital in any one sleeve, in percent of NAV."},"max_risk_share_pct":{"type":"number","minimum":0,"maximum":100000,"description":"The most share of book variance from any one sleeve, in percent."},"min_liquid_1d_pct":{"type":"number","minimum":0,"maximum":100000,"description":"The least share of NAV reachable within 1 day, in percent."},"min_liquid_7d_pct":{"type":"number","minimum":0,"maximum":100000,"description":"The least share of NAV reachable within 7 days, in percent."},"min_liquid_30d_pct":{"type":"number","minimum":0,"maximum":100000,"description":"The least share of NAV reachable within 30 days, in percent."},"min_liquid_90d_pct":{"type":"number","minimum":0,"maximum":100000,"description":"The least share of NAV reachable within 90 days, in percent."},"min_liquid_365d_pct":{"type":"number","minimum":0,"maximum":100000,"description":"The least share of NAV reachable within 365 days, in percent."},"drawdown_stop_pct":{"type":"number","minimum":0,"maximum":100000,"description":"The drawdown from the peak at which adding risk stops, in percent. Positive: 10 means 10% down."},"max_adv_participation_pct":{"type":"number","minimum":0,"maximum":100000,"description":"The most share of average daily volume an order may take, in percent."},"max_settle_days":{"type":"number","minimum":0,"maximum":36500,"description":"The most days an order may take to settle. For a token, days to cash through redemption."},"max_days_to_exit":{"type":"number","minimum":0,"maximum":36500,"description":"The most days a position may take to exit by trading."},"min_liquidity_cover":{"type":"number","minimum":0,"maximum":1000,"description":"The least liquidity cover: liquid assets over near-term calls, as a multiple."},"needs_yes_over_pct_nav":{"type":"number","minimum":0,"maximum":100000,"description":"Orders larger than this, in percent of NAV, need a person's yes."}}},"correlation":{"description":"One pairwise correlation for every pair, or a matrix in the order of the sleeves. Default 0.3. This is the caller's assumption.","oneOf":[{"type":"number","minimum":-1,"maximum":1},{"type":"array","maxItems":40,"items":{"type":"array","maxItems":40,"items":{"type":"number","minimum":-1,"maximum":1}}}]},"sleeves":{"type":"array","minItems":1,"maxItems":40,"description":"The sleeves, in file order.","items":{"type":"object","required":["id","model","capital_pct","inputs"],"additionalProperties":false,"properties":{"id":{"type":"string","maxLength":40,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]{0,39}$","description":"The sleeve's name: its ### heading in the file."},"model":{"type":"string","enum":["tokenized_bills","tokenized_property","commodity_token","token_nav_gap","rwa_collateral","long_short_book","factor_regress","pairs_spread","merger_spread","trend_vol_target","risk_parity","rates_ladder","options_book","variance_carry","credit_carry","private_credit_tape","basis_carry","reserve_coverage","fee_waterfall","redemption_gates","book_risk","stress_book","size_position","deflated_sharpe"],"description":"Which model runs on this sleeve's inputs."},"capital_pct":{"type":"number","minimum":0,"maximum":1000,"description":"Capital given to the sleeve, in percent of NAV."},"inputs":{"type":"object","description":"The model's own inputs: the caller's numbers."},"assumed":{"type":"object","additionalProperties":false,"description":"Figures the caller assumes, used only where the model gives none.","properties":{"vol_pct":{"type":"number","minimum":0,"maximum":1000,"description":"Volatility a year, per 100 of the sleeve's capital, in percent."},"gross_pct":{"type":"number","minimum":0,"maximum":100000,"description":"Gross exposure per 100 of the sleeve's capital, in percent."},"net_pct":{"type":"number","minimum":-100000,"maximum":100000,"description":"Net exposure per 100 of the sleeve's capital, in percent."},"tail_loss_pct":{"type":"number","minimum":0,"maximum":1000,"description":"Tail loss per 100 of the sleeve's capital, in percent. Positive is a loss."},"liquidity_days":{"type":"number","minimum":0,"maximum":36500,"description":"Days until the whole sleeve is reachable as cash."},"carry_pct":{"type":"number","minimum":-1000,"maximum":1000,"description":"Carry a year per 100 of the sleeve's capital, in percent."}}}}}}}},"text":{"type":"string","maxLength":65536,"description":"A whole HEDGEFUND.md file as text, up to 65536 characters here. The local library takes up to 524288."}}}},{"name":"book_starter","title":"A starter book to run or edit","description":"A complete made-up book and its short story, as JSON and as a HEDGEFUND.md file, that runs as it stands: multi_desk, tokenized_assets, trend_and_rates, credit_book, digital_assets. Every number is made up and resembles no real position. With no kind, it lists them. Change the numbers, then send it to run_book.","get":"https://hedgefund.md/api/v1/book_starter","post":"https://hedgefund.md/api/v1/book_starter","example_get":"https://hedgefund.md/api/v1/book_starter?kind=multi_desk","example_body":{"kind":"multi_desk"},"example_note":"Made-up illustrative numbers, not market data, a price, a quote or a real position; send your own.","input":{"type":"object","properties":{"kind":{"type":"string","enum":["multi_desk","tokenized_assets","trend_and_rates","credit_book","digital_assets"],"description":"Which starter: multi_desk, tokenized_assets, trend_and_rates, credit_book, digital_assets. Leave out to list them."}}}},{"name":"check_hedgefund_md","title":"Check a HEDGEFUND.md","description":"Reads a HEDGEFUND.md and runs every sleeve. Returns ok, errors and warnings with stable codes, and the id of the exact book when it reads: hf1_ and 24 hex. Warns on template numbers, missing figures, limits gone past and capital over 100. Nothing in the file is executed or stored. A clean check says the file can run, not that its numbers are right.","post_only":true,"post":"https://hedgefund.md/api/v1/check_hedgefund_md","example_body":{"text":"---\nhedgefund: 1\nname: Example book\ncurrency: USD\nnav: 1000000\nupdated: 2026-11-01\n---\n\n# Example book\n\nThe numbers in this file are the author's own. A run describes only these numbers. It is not a forecast, an offer, a record of real trading or advice. It isn't a fund document, and it isn't for investors or clients. Format: https://hedgefund.md/spec.md Terms: https://hedgefund.md/terms\n\n## Limits\n\n```json\n{ \"max_gross_pct\": 150, \"max_vol_pct\": 12, \"min_liquid_30d_pct\": 50 }\n```\n\n## Correlation\n\n```json\n0.3\n```\n\n## Sleeves\n\n### sleeve_a\n\n```json\n{\n  \"model\": \"merger_spread\",\n  \"capital_pct\": 40,\n  \"assumed\": { \"vol_pct\": 8, \"liquidity_days\": 10 },\n  \"inputs\": {\n    \"deal_cash\": 50,\n    \"target_price\": 47,\n    \"break_price\": 35,\n    \"days_to_close\": 120,\n    \"financing_rate_pct\": 5\n  }\n}\n```\n\n### sleeve_b\n\n```json\n{\n  \"model\": \"size_position\",\n  \"capital_pct\": 30,\n  \"assumed\": { \"tail_loss_pct\": 5, \"carry_pct\": 2 },\n  \"inputs\": {\n    \"nav\": 1000000,\n    \"vol_pct\": 25,\n    \"expected_return_pct\": 8,\n    \"risk_budget_pct_nav\": 1,\n    \"adv_value\": 500000,\n    \"max_participation_pct\": 10,\n    \"days_to_build\": 5\n  }\n}\n```\n"},"example_note":"Made-up illustrative numbers, not market data, a price, a quote or a real position; send your own.","input":{"type":"object","properties":{"text":{"type":"string","maxLength":65536,"description":"A whole HEDGEFUND.md file as text, up to 65536 characters here. The local library takes up to 524288."}},"required":["text"]}},{"name":"build_hedgefund_md","title":"Write a book as HEDGEFUND.md","description":"Turns a book into a HEDGEFUND.md file: frontmatter, limits, correlation and one section per sleeve, plus any prose you add. The text is read back before it is returned, so what it shows is what it runs. Returns the text, the book's id and what a check says of it. Nothing is stored.","post_only":true,"post":"https://hedgefund.md/api/v1/build_hedgefund_md","example_body":{"book":{"name":"Example book","currency":"USD","nav":1000000,"updated":"2026-11-01","limits":{"max_gross_pct":150,"max_vol_pct":12,"min_liquid_30d_pct":50},"correlation":0.3,"sleeves":[{"id":"sleeve_a","model":"merger_spread","capital_pct":40,"assumed":{"vol_pct":8,"liquidity_days":10},"inputs":{"deal_cash":50,"target_price":47,"break_price":35,"days_to_close":120,"financing_rate_pct":5}},{"id":"sleeve_b","model":"size_position","capital_pct":30,"assumed":{"tail_loss_pct":5,"carry_pct":2},"inputs":{"nav":1000000,"vol_pct":25,"expected_return_pct":8,"risk_budget_pct_nav":1,"adv_value":500000,"max_participation_pct":10,"days_to_build":5}}]},"about":"A made-up example. Every number is made up."},"example_note":"Made-up illustrative numbers, not market data, a price, a quote or a real position; send your own.","input":{"type":"object","properties":{"book":{"type":"object","description":"The book: name, currency, nav, limits, correlation, and sleeves of { id, model, capital_pct, inputs, assumed }. Every number is your own.","required":["name","currency","nav","sleeves"],"additionalProperties":false,"properties":{"hedgefund":{"const":1,"description":"The format version."},"name":{"type":"string","minLength":1,"maxLength":120,"description":"A short name for the book, on one line."},"currency":{"type":"string","maxLength":3,"pattern":"^[A-Z]{3}$","description":"Three capital letters. A label: nothing converts it."},"nav":{"type":"number","exclusiveMinimum":0,"maximum":1000000000000000,"description":"Net asset value, in that currency."},"updated":{"type":"string","maxLength":10,"pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The date of these numbers, YYYY-MM-DD."},"limits":{"type":"object","additionalProperties":false,"description":"The limits. A book run and check_order share these names. An unknown name is refused, so a typo can't switch a limit off.","properties":{"max_capital_pct":{"type":"number","minimum":0,"maximum":100000,"description":"The most of NAV the sleeves may take, in percent."},"max_gross_pct":{"type":"number","minimum":0,"maximum":100000,"description":"The most gross exposure, in percent of NAV."},"max_net_pct":{"type":"number","minimum":0,"maximum":100000,"description":"The most net exposure either way, in percent of NAV. Compared with the size of net."},"max_vol_pct":{"type":"number","minimum":0,"maximum":100000,"description":"The most book volatility a year, in percent of NAV."},"max_var99_pct":{"type":"number","minimum":0,"maximum":100000,"description":"The most one-day 99% parametric tail, in percent of NAV."},"max_tail_sum_pct":{"type":"number","minimum":0,"maximum":100000,"description":"The most for the sleeve tails added up with no offsets, in percent of NAV."},"max_sleeve_capital_pct":{"type":"number","minimum":0,"maximum":100000,"description":"The most capital in any one sleeve, in percent of NAV."},"max_risk_share_pct":{"type":"number","minimum":0,"maximum":100000,"description":"The most share of book variance from any one sleeve, in percent."},"min_liquid_1d_pct":{"type":"number","minimum":0,"maximum":100000,"description":"The least share of NAV reachable within 1 day, in percent."},"min_liquid_7d_pct":{"type":"number","minimum":0,"maximum":100000,"description":"The least share of NAV reachable within 7 days, in percent."},"min_liquid_30d_pct":{"type":"number","minimum":0,"maximum":100000,"description":"The least share of NAV reachable within 30 days, in percent."},"min_liquid_90d_pct":{"type":"number","minimum":0,"maximum":100000,"description":"The least share of NAV reachable within 90 days, in percent."},"min_liquid_365d_pct":{"type":"number","minimum":0,"maximum":100000,"description":"The least share of NAV reachable within 365 days, in percent."},"drawdown_stop_pct":{"type":"number","minimum":0,"maximum":100000,"description":"The drawdown from the peak at which adding risk stops, in percent. Positive: 10 means 10% down."},"max_adv_participation_pct":{"type":"number","minimum":0,"maximum":100000,"description":"The most share of average daily volume an order may take, in percent."},"max_settle_days":{"type":"number","minimum":0,"maximum":36500,"description":"The most days an order may take to settle. For a token, days to cash through redemption."},"max_days_to_exit":{"type":"number","minimum":0,"maximum":36500,"description":"The most days a position may take to exit by trading."},"min_liquidity_cover":{"type":"number","minimum":0,"maximum":1000,"description":"The least liquidity cover: liquid assets over near-term calls, as a multiple."},"needs_yes_over_pct_nav":{"type":"number","minimum":0,"maximum":100000,"description":"Orders larger than this, in percent of NAV, need a person's yes."}}},"correlation":{"description":"One pairwise correlation for every pair, or a matrix in the order of the sleeves. Default 0.3. This is the caller's assumption.","oneOf":[{"type":"number","minimum":-1,"maximum":1},{"type":"array","maxItems":40,"items":{"type":"array","maxItems":40,"items":{"type":"number","minimum":-1,"maximum":1}}}]},"sleeves":{"type":"array","minItems":1,"maxItems":40,"description":"The sleeves, in file order.","items":{"type":"object","required":["id","model","capital_pct","inputs"],"additionalProperties":false,"properties":{"id":{"type":"string","maxLength":40,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]{0,39}$","description":"The sleeve's name: its ### heading in the file."},"model":{"type":"string","enum":["tokenized_bills","tokenized_property","commodity_token","token_nav_gap","rwa_collateral","long_short_book","factor_regress","pairs_spread","merger_spread","trend_vol_target","risk_parity","rates_ladder","options_book","variance_carry","credit_carry","private_credit_tape","basis_carry","reserve_coverage","fee_waterfall","redemption_gates","book_risk","stress_book","size_position","deflated_sharpe"],"description":"Which model runs on this sleeve's inputs."},"capital_pct":{"type":"number","minimum":0,"maximum":1000,"description":"Capital given to the sleeve, in percent of NAV."},"inputs":{"type":"object","description":"The model's own inputs: the caller's numbers."},"assumed":{"type":"object","additionalProperties":false,"description":"Figures the caller assumes, used only where the model gives none.","properties":{"vol_pct":{"type":"number","minimum":0,"maximum":1000,"description":"Volatility a year, per 100 of the sleeve's capital, in percent."},"gross_pct":{"type":"number","minimum":0,"maximum":100000,"description":"Gross exposure per 100 of the sleeve's capital, in percent."},"net_pct":{"type":"number","minimum":-100000,"maximum":100000,"description":"Net exposure per 100 of the sleeve's capital, in percent."},"tail_loss_pct":{"type":"number","minimum":0,"maximum":1000,"description":"Tail loss per 100 of the sleeve's capital, in percent. Positive is a loss."},"liquidity_days":{"type":"number","minimum":0,"maximum":36500,"description":"Days until the whole sleeve is reachable as cash."},"carry_pct":{"type":"number","minimum":-1000,"maximum":1000,"description":"Carry a year per 100 of the sleeve's capital, in percent."}}}}}}}},"about":{"type":"string","maxLength":4000,"description":"Optional prose under the title. Leave headings, code fences and HTML comments out of it."}},"required":["book"]}},{"name":"check_order","title":"Check one order against limits","description":"Checks one proposed order against the limits sent, using the book's numbers as sent. Outcomes: over_limit, needs_a_yes, within_limits, no_limits_checked. Lists the limits checked and not checked, with the numbers each rests on. It checks only what it is told, and the caller could be wrong. It approves nothing, places nothing, and an empty check is never a pass.","post_only":true,"post":"https://hedgefund.md/api/v1/check_order","example_body":{"order":{"sleeve":"Sleeve A","notional_pct_nav":2,"side":"add","direction":"long","adv_participation_pct":5,"settle_days":2},"book":{"gross_pct":180,"net_pct":40,"var99_pct":1.2,"drawdown_pct":3,"liquidity_cover":2},"limits":{"max_gross_pct":200,"max_net_pct":60,"max_var99_pct":2,"drawdown_stop_pct":10,"max_adv_participation_pct":15,"max_settle_days":5,"min_liquidity_cover":1.5,"needs_yes_over_pct_nav":5}},"example_note":"Made-up illustrative numbers, not market data, a price, a quote or a real position; send your own.","input":{"type":"object","required":["order"],"properties":{"order":{"type":"object","description":"The order. Sizes are percent of NAV.","required":["notional_pct_nav","side"],"additionalProperties":false,"properties":{"sleeve":{"type":"string","maxLength":60,"description":"Which sleeve it belongs to. A label, repeated in the result."},"notional_pct_nav":{"type":"number","exclusiveMinimum":0,"maximum":100000,"description":"Size of the order, in percent of NAV. Positive whichever the side."},"side":{"type":"string","enum":["add","reduce"],"description":"add grows a position. reduce shrinks one."},"direction":{"type":"string","enum":["long","short"],"description":"Whether the position is long or short. Without it, net could go either way, so both ways are compared."},"adv_participation_pct":{"type":"number","minimum":0,"maximum":100000,"description":"The order's share of average daily volume, in percent."},"days_to_exit":{"type":"number","minimum":0,"maximum":36500,"description":"Days to exit the position by trading."},"tokenized":{"type":"boolean","description":"True for a token. Then settle_days means days to cash through redemption, not the transfer time."},"settle_days":{"type":"number","minimum":0,"maximum":36500,"description":"Days for the order to settle."},"var99_add_pct":{"type":"number","minimum":-1000,"maximum":1000,"description":"What the order adds to var99_pct, in percent of NAV, by the caller's own figure. Negative if it lowers it. Without this, var99_pct is scaled by gross."}}},"book":{"type":"object","description":"The book as it stands now, before the order. Anything left out can't be checked.","additionalProperties":false,"properties":{"gross_pct":{"type":"number","minimum":0,"maximum":100000,"description":"Gross exposure now, in percent of NAV."},"net_pct":{"type":"number","minimum":-100000,"maximum":100000,"description":"Net exposure now, in percent of NAV. Negative if net short."},"var99_pct":{"type":"number","minimum":0,"maximum":1000,"description":"The book's 99% tail now, in percent of NAV, on the same horizon as max_var99_pct."},"drawdown_pct":{"type":"number","minimum":0,"maximum":100,"description":"Drawdown from the peak now, in percent. Positive: 12 means 12% down."},"liquidity_cover":{"type":"number","minimum":0,"maximum":1000,"description":"Liquid assets over near-term calls, as a multiple, now."}}},"limits":{"type":"object","description":"The limits to check against. A limit left out isn't checked. Names a book uses but an order doesn't are noted and set aside.","additionalProperties":false,"properties":{"max_capital_pct":{"type":"number","minimum":0,"maximum":100000,"description":"The most of NAV the sleeves may take, in percent."},"max_gross_pct":{"type":"number","minimum":0,"maximum":100000,"description":"The most gross exposure, in percent of NAV."},"max_net_pct":{"type":"number","minimum":0,"maximum":100000,"description":"The most net exposure either way, in percent of NAV. Compared with the size of net."},"max_vol_pct":{"type":"number","minimum":0,"maximum":100000,"description":"The most book volatility a year, in percent of NAV."},"max_var99_pct":{"type":"number","minimum":0,"maximum":100000,"description":"The most one-day 99% parametric tail, in percent of NAV."},"max_tail_sum_pct":{"type":"number","minimum":0,"maximum":100000,"description":"The most for the sleeve tails added up with no offsets, in percent of NAV."},"max_sleeve_capital_pct":{"type":"number","minimum":0,"maximum":100000,"description":"The most capital in any one sleeve, in percent of NAV."},"max_risk_share_pct":{"type":"number","minimum":0,"maximum":100000,"description":"The most share of book variance from any one sleeve, in percent."},"min_liquid_1d_pct":{"type":"number","minimum":0,"maximum":100000,"description":"The least share of NAV reachable within 1 day, in percent."},"min_liquid_7d_pct":{"type":"number","minimum":0,"maximum":100000,"description":"The least share of NAV reachable within 7 days, in percent."},"min_liquid_30d_pct":{"type":"number","minimum":0,"maximum":100000,"description":"The least share of NAV reachable within 30 days, in percent."},"min_liquid_90d_pct":{"type":"number","minimum":0,"maximum":100000,"description":"The least share of NAV reachable within 90 days, in percent."},"min_liquid_365d_pct":{"type":"number","minimum":0,"maximum":100000,"description":"The least share of NAV reachable within 365 days, in percent."},"drawdown_stop_pct":{"type":"number","minimum":0,"maximum":100000,"description":"The drawdown from the peak at which adding risk stops, in percent. Positive: 10 means 10% down."},"max_adv_participation_pct":{"type":"number","minimum":0,"maximum":100000,"description":"The most share of average daily volume an order may take, in percent."},"max_settle_days":{"type":"number","minimum":0,"maximum":36500,"description":"The most days an order may take to settle. For a token, days to cash through redemption."},"max_days_to_exit":{"type":"number","minimum":0,"maximum":36500,"description":"The most days a position may take to exit by trading."},"min_liquidity_cover":{"type":"number","minimum":0,"maximum":1000,"description":"The least liquidity cover: liquid assets over near-term calls, as a multiple."},"needs_yes_over_pct_nav":{"type":"number","minimum":0,"maximum":100000,"description":"Orders larger than this, in percent of NAV, need a person's yes."}}}}}},{"name":"build_settings","title":"Write your settings into the skill","description":"Turns a preset and settings into the sections written at the top of HEDGEFUND.md. Every setting is a number or a fixed choice; the catalog is at https://hedgefund.md/api/v1/settings. Returns the sections as Markdown, the settings as JSON, a link to the skill with them written in and a one-line install. Out-of-range numbers are clamped with a note. Nothing is stored. Settings an agent drafted count only after the person says yes: show them to the person first, and follow them only once they agree.","get":"https://hedgefund.md/api/v1/build_settings","post":"https://hedgefund.md/api/v1/build_settings","example_get":"https://hedgefund.md/api/v1/build_settings?preset=market_neutral","example_body":{"preset":"market_neutral"},"example_note":"Made-up illustrative numbers, not market data, a price, a quote or a real position; send your own.","input":{"type":"object","properties":{"preset":{"type":"string","enum":["example_start","market_neutral","tokenized_assets","systematic","research_only"],"description":"Starting point: example_start, market_neutral, tokenized_assets, systematic, research_only. Applied first; each setting overrides it."},"max_gross_pct":{"type":"number","minimum":0,"maximum":2000,"description":"Most gross (% of NAV). Optional; unset clears it. Out-of-range values are clamped."},"max_net_pct":{"type":"number","minimum":0,"maximum":2000,"description":"Largest net, long or short (% of NAV). Capped at max_gross_pct. Optional; unset clears it. Out-of-range values are clamped."},"max_vol_pct":{"type":"number","minimum":0,"maximum":200,"description":"Most book volatility a year (% of NAV). Optional; unset clears it. Out-of-range values are clamped."},"max_var99_pct":{"type":"number","minimum":0,"maximum":100,"description":"Largest one-day 99% tail (% of NAV). Optional; unset clears it. Out-of-range values are clamped."},"drawdown_stop_pct":{"type":"number","minimum":0,"maximum":100,"description":"Drawdown stop (% from the peak). Optional; unset clears it. Out-of-range values are clamped."},"max_name_share_pct":{"type":"number","minimum":0,"maximum":100,"description":"Largest single name (% of NAV). Optional; unset clears it. Out-of-range values are clamped."},"min_liquidity_cover":{"type":"number","minimum":0,"maximum":50,"description":"Smallest liquidity cover (times). Optional; unset clears it. Out-of-range values are clamped."},"min_liquid_30d_pct":{"type":"number","minimum":0,"maximum":100,"description":"Reachable within 30 days, at least (% of NAV). Optional; unset clears it. Out-of-range values are clamped."},"max_adv_participation_pct":{"type":"number","minimum":0,"maximum":100,"description":"Largest share of a day's volume (%). Optional; unset clears it. Out-of-range values are clamped."},"max_settle_days":{"type":"integer","minimum":0,"maximum":3650,"description":"Longest settlement (days). Optional; unset clears it. Out-of-range values are clamped."},"max_days_to_exit":{"type":"integer","minimum":0,"maximum":3650,"description":"Longest exit by trading (days). Optional; unset clears it. Out-of-range values are clamped."},"max_redemption_wait_days":{"type":"integer","minimum":0,"maximum":3650,"description":"Longest wait to redeem (days). Optional; unset clears it. Out-of-range values are clamped."},"max_pool_share_pct":{"type":"number","minimum":0,"maximum":100,"description":"Largest position against a pool (% of pool depth). Optional; unset clears it. Out-of-range values are clamped."},"token_no_redemption":{"type":"string","enum":["no","ask","yes","unset"],"description":"A token with no redemption right: no (Not allowed), ask (Ask me first), yes (Allowed, and say so each time). Optional; unset clears it."},"unaudited_reserves":{"type":"string","enum":["no","ask","yes","unset"],"description":"A token with unaudited reserves: no (Not allowed), ask (Ask me first), yes (Allowed, and say so each time). Optional; unset clears it."},"orders":{"type":"string","enum":["none","draft_only","send_after_yes"],"description":"What your agent may do with an order: none (No orders at all; research only), draft_only (Draft them; I send them), send_after_yes (Send one only after my yes). Default draft_only."},"needs_yes_over_pct_nav":{"type":"number","minimum":0,"maximum":100,"description":"Ask before any order over (% of NAV). Default 0. Out-of-range values are clamped."},"new_asset_class":{"type":"string","enum":["ask","no","unset"],"description":"A new asset class: ask (Ask me first), no (Not allowed). Optional; unset clears it."},"new_venue":{"type":"string","enum":["ask","no","unset"],"description":"A new venue: ask (Ask me first), no (Not allowed). Optional; unset clears it."},"money_moves":{"type":"string","enum":["yes_only"],"description":"Moving money and keys: yes_only (Money only on my yes; keys never). Default yes_only."},"fund_marketing":{"type":"string","enum":["never"],"description":"Marketing and raising money: never (Never done by the agent). Default never."},"min_holdout_pct":{"type":"integer","minimum":0,"maximum":80,"description":"Smallest hold-out (% of the data). Optional; unset clears it. Out-of-range values are clamped."},"count_trials":{"type":"string","enum":["every_run","independent","unset"],"description":"How trials are counted: every_run (Every run, kept or dropped), independent (Independent trials, with the raw count beside them). Optional; unset clears it."},"units":{"type":"string","enum":["percent","bps","unset"],"description":"Units: percent (Percent), bps (Basis points for rates and costs). Optional; unset clears it."},"decimals":{"type":"integer","minimum":0,"maximum":6,"description":"Decimal places (digits). Optional; unset clears it. Out-of-range values are clamped."},"format":{"type":"string","enum":["section","skill"],"description":"section (default): the settings sections only; skill: the whole skill file too."}}}},{"name":"whats_new","title":"What's new here, and what's next","description":"What changed on hedgefund.md and when, what is being built, when to check back, and the other .md sites. Pass since (a date) to get only newer entries, for example the updated date of the skill you have. Reads a list kept with the code; fetches nothing and stores nothing.","get":"https://hedgefund.md/api/v1/whats_new","post":"https://hedgefund.md/api/v1/whats_new","example_get":"https://hedgefund.md/api/v1/whats_new?since=2026-10-01","example_body":{"since":"2026-10-01"},"example_note":"Made-up illustrative numbers, not market data, a price, a quote or a real position; send your own.","input":{"type":"object","properties":{"since":{"type":"string","maxLength":10,"pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Only entries after this date (YYYY-MM-DD)."},"planned":{"type":"boolean","default":true,"description":"Include what is being built and the ideas being weighed. Default true."}}}}],"mcp":{"url":"https://hedgefund.md/mcp","transport":"streamable-http, stateless, JSON responses, no auth","add":"claude mcp add --transport http hedgefund https://hedgefund.md/mcp","tools":["tokenized_bills","tokenized_property","commodity_token","token_nav_gap","rwa_collateral","long_short_book","factor_regress","pairs_spread","merger_spread","trend_vol_target","risk_parity","rates_ladder","options_book","variance_carry","credit_carry","private_credit_tape","basis_carry","reserve_coverage","fee_waterfall","redemption_gates","book_risk","stress_book","size_position","deflated_sharpe","run_book","book_starter","check_hedgefund_md","build_hedgefund_md","check_order","build_settings","whats_new"],"prompts":["hedgefund"],"resources":["https://hedgefund.md/hedgefund.md","https://hedgefund.md/api/v1/settings","https://hedgefund.md/changelog.md"]},"openapi":"https://hedgefund.md/openapi.json","llms_txt":"https://hedgefund.md/llms.txt","manifest":"https://hedgefund.md/.well-known/hedgefund.json","rule":"Settings an agent drafted count only after the person says yes: show them to the person first, and follow them only once they agree.","never":["fetches or shows third-party data, prices or rates","keeps what you send to a tool","approves, enforces or certifies anything","never trades, takes money, holds keys or assets, issues or sells any security or token, runs a fund or gives investment advice"],"disclaimer":"Use at your own risk. hedgefund.md is provided as is, without warranty. It is not a fund, and it isn't anyone's adviser. Information here may be inaccurate, incomplete or not current, and is not verified. Nothing here is investment, legal, tax, accounting or regulatory advice, a recommendation, or an offer of any security, token or fund interest. Results are hypothetical: simplified arithmetic on the numbers sent, a made-up template or a stated default, prepared with hindsight. Nobody achieved them, they are not a record of real trading, and they don't indicate future results. hedgefund.md never trades, takes money, holds keys or assets, issues or sells any security or token, runs a fund or gives investment advice. Don't show any output to investors or clients, or use it to market an investment. Check everything yourself before you act on it.","terms":"https://hedgefund.md/terms","contact":"support [ at ] mailbox.bot"}