Models / Options / options_book
Options book
What are this option book's Greeks, where does it break even, and which shock hurts it most?
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.
On these numbers, the book is worth -1,916.83 at the vols sent, with delta -92.27 units, and its worst grid node (spot +30%, vol +20 points) loses 21,592.5, or 43.18% of capital. Expiry break-evens at 88.08 and 111.92.
Hypothetical, and on made-up numbers until you replace them. Nobody traded this, and nothing here is on offer.
Readings
The numbers, with their units.
Book value
-1,916.83
Negative: the book is net short premium.
Delta
-92.27units of underlying
About -9,227.06 of underlying at this spot.
Gamma
-40.23units per 1 of spot
Vega
-207.42per vol point
Theta
23.4per calendar day
Rho
-18.28per 1% of rate
Worst grid node
-21,592.5
Spot +30%, vol +20 points.
Worst node, share of capital
breach43.18%
Against a 25% loss line.
What flips it
The value of one input where the outcome changes, with the others held.
spot_at_expiry
88.08
Expiry P and L is a loss below this spot and a gain above it.
spot_at_expiry
111.92
Expiry P and L is a gain below this spot and a loss above it.
spot_shock_pct
22.95
A spot rise of this size, at the vols sent, reaches an instant loss of 25% of capital, the loss line in use.
vol_shock_pts
54.37
A vol rise of this many points on every leg, at today's spot, reaches an instant loss of 25% of capital, the loss line in use.
spot
97.61now 100
The book's delta changes sign at this spot, at the vols sent.
Flags
What went past a line, and what to read before you trust the rest.
- watchAbove the top strike, expiry P and L falls by 1,000 for each 1 of spot, with no cap. The worst grid node stops where the grid stops. loss_grows_on_rise
- breachThe worst node loses 43.18% of capital, past the 25% loss line. loss_past_limit
- watchThe worst node sits on the edge of the grid. A wider shock could lose more, and the grid can't say how much. worst_on_grid_edge
What this leaves out
What the formula leaves out, by name.
- Early exercise of American options.
- Skew and term-structure moves: every leg's vol shifts by the same points.
- Discrete dividends and jumps. The spot is lognormal between shocks.
- Delta hedging and its costs. The grid is a one-time shock, not a path.
- Bid-ask spreads, commissions, slippage, margin and financing of the premium.
- Assignment, pin risk and settlement details at expiry.
- Taxes.
What it took as given (8)
What it took as given to get here.
- European exercise. One flat vol per leg, with a continuous rate and a continuous dividend yield.
- Delta is per unit of underlying, times qty and multiplier. Gamma is the change in that delta per 1 of spot. Vega is per one vol point. Theta is per calendar day: annual theta over 365. Rho is per one percent of rate.
- Grid shocks are instant. No time passes, the rate and yield stay put, and every leg's vol moves by the same points, floored at zero.
- Zero time is intrinsic on the spot, with no time left to earn or lose, so vega, theta and rho are zero.
- Zero vol with time left is intrinsic on the discounted forward: a call is max(S e^-qT - K e^-rT, 0), a put the mirror. Gamma is reported as zero there.
- A leg with zero vol exactly at its forward, or zero time exactly at its strike, takes N(d1) = one half, the limit of the formula.
- Values come from the vols sent, not from trade prices. Expiry P and L is the payoff minus today's model value, with no interest on that value.
- The sleeve's gross and net are delta times spot over capital, summed by leg. Its tail is the worst grid node.
- At expiry
- Now
The data
Legs and book
| leg | type | qty | strike | expiry_years | vol_pct | unit_value | value | delta | gamma | vega_per_point | theta_per_day | rho_per_pct |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Leg 1 | put | -10 | 90 | 0.25 | 26 | 1.3027 | -1,302.72 | 174.93 | -19.81 | -128.74 | 16.76 | 46.99 |
| Leg 2 | put | 10 | 80 | 0.25 | 32 | 0.474509 | 474.51 | -63.9 | 7.8163 | 62.53 | -10.39 | -17.16 |
| Leg 3 | call | -10 | 110 | 0.25 | 20 | 1.0886 | -1,088.62 | -203.3 | -28.24 | -141.22 | 17.03 | -48.1 |
| Book | -1,916.83 | -92.27 | -40.23 | -207.42 | 23.4 | -18.28 |
P and L by shock (rows: spot shock in percent, columns: vol shock in points)
| spot_shock_pct | vol -5 | vol 0 | vol +5 | vol +10 | vol +20 |
|---|---|---|---|---|---|
| -30 | -7,065.65 | -6,645.41 | -6,262.23 | -5,936.99 | -5,504.28 |
| -20 | -4,069.53 | -3,820.72 | -3,673.95 | -3,632.5 | -3,886.08 |
| -10 | -429.64 | -823.51 | -1,294.52 | -1,864.33 | -3,251.27 |
| -5 | 659.81 | -11.23 | -811.68 | -1,700.58 | -3,627.4 |
| 0 | 953.08 | 0 | -1,086.49 | -2,231.48 | -4,573.77 |
| 5 | 197.55 | -984.95 | -2,245.76 | -3,535.93 | -6,118.44 |
| 10 | -1,839 | -3,047.68 | -4,315.7 | -5,617.87 | -8,250.65 |
| 20 | -9,305.81 | -9,961.47 | -10,822.88 | -11,826.71 | -14,093.41 |
| 30 | -18,883.25 | -19,050.54 | -19,421.58 | -19,990.68 | -21,592.5 |
Expiry P and L at each kink and break-even
| spot_at_expiry | payoff | pnl_at_expiry | point |
|---|---|---|---|
| 0 | -10,000 | -8,083.17 | zero spot |
| 80 | -10,000 | -8,083.17 | strike |
| 88.08 | -1,916.83 | 0 | break-even |
| 90 | 0 | 1,916.83 | strike |
| 110 | 0 | 1,916.83 | strike |
| 111.92 | -1,916.83 | 0 | break-even |
Paste it into your agent
No connection needed. This prompt carries the method, the conventions and what this site's engine gives on the made-up numbers, so your agent can check its own work before it touches real ones. Every prompt, with its hash, is listed at /prompts.json. A copy that stays fixed for this version, for a stack to point at: /v/1.0/models/options_book.md.
# Options book: a prompt from hedgefund.mdPaste this into your AI agent. It needs no connection to hedgefund.md. An agent that can run code should write and run it, and shouldn't work a long series by hand.**Question.** What are this option book's Greeks, where does it break even, and which shock hurts it most?## Methodd1 = (ln(S/K) + (r - q + v^2/2) T) / (v sqrt(T)), d2 = d1 - v sqrt(T). Call = S e^(-qT) N(d1) - K e^(-rT) N(d2). Put = K e^(-rT) N(-d2) - S e^(-qT) N(-d1). Greeks are the closed-form partials, times qty and multiplier. A grid node's P and L is the full reprice at the shocked spot and vol, minus today's value.## Conventions- European exercise. One flat vol per leg, with a continuous rate and a continuous dividend yield.- Delta is per unit of underlying, times qty and multiplier. Gamma is the change in that delta per 1 of spot. Vega is per one vol point. Theta is per calendar day: annual theta over 365. Rho is per one percent of rate.- Grid shocks are instant. No time passes, the rate and yield stay put, and every leg's vol moves by the same points, floored at zero.- Zero time is intrinsic on the spot, with no time left to earn or lose, so vega, theta and rho are zero.- Zero vol with time left is intrinsic on the discounted forward: a call is max(S e^-qT - K e^-rT, 0), a put the mirror. Gamma is reported as zero there.- A leg with zero vol exactly at its forward, or zero time exactly at its strike, takes N(d1) = one half, the limit of the formula.- Values come from the vols sent, not from trade prices. Expiry P and L is the payoff minus today's model value, with no interest on that value.- The sleeve's gross and net are delta times spot over capital, summed by leg. Its tail is the worst grid node.## Step 1: check your method on these made-up numbersThe numbers and names below are made up. They aren't market levels, typical values or anyone's real figures.```json{ "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]}```Work them out with the method above. Yours should match these within 0.5%.- Book value: -1916.83026- Delta: -92.2706368 units of underlying- Gamma: -40.23277629 units per 1 of spot- Vega: -207.4236627 per vol point- Theta: 23.40056579 per calendar day- Rho: -18.27558355 per 1% of rate- Worst grid node: -21592.4974- Worst node, share of capital: 43.1849948 %Where the outcome flips, with the other inputs held:- spot_at_expiry at 88.08316974: Expiry P and L is a loss below this spot and a gain above it.- spot_at_expiry at 111.9168303: Expiry P and L is a gain below this spot and a loss above it.- spot_shock_pct at 22.94921041: A spot rise of this size, at the vols sent, reaches an instant loss of 25% of capital, the loss line in use.- vol_shock_pts at 54.37068462: A vol rise of this many points on every leg, at today's spot, reaches an instant loss of 25% of capital, the loss line in use.- spot at 97.60749653: The book's delta changes sign at this spot, at the vols sent.If yours differ, stop and tell the person which ones and by how much. Don't go on to real numbers until they match, or until the person has seen the difference. These values come from one engine and can be wrong too.## Step 2: run it on the person's numbersReplace every input with the person's own. Ask for any number you don't have, and don't invent one.## Step 3: reportGive one sentence beginning "On these numbers,", then the values, then where the outcome flips. Always add what this leaves out:- Early exercise of American options.- Skew and term-structure moves: every leg's vol shifts by the same points.- Discrete dividends and jumps. The spot is lognormal between shocks.- Delta hedging and its costs. The grid is a one-time shock, not a path.- Bid-ask spreads, commissions, slippage, margin and financing of the premium.- Assignment, pin risk and settlement details at expiry.- Taxes.## LimitsResults are hypothetical: arithmetic on the numbers given, prepared with hindsight. Nobody achieved them, and costs and liquidity are only as assumed. They aren't a forecast, a recommendation, an offer or a record of real trading. Don't say what to buy, sell or hold, and don't use them to market an investment. Whether a person may hold or trade an instrument is a legal question for counsel.Provided as is, at your own risk, by hedgefund.md, which is not a fund and isn't anyone's adviser. Version 1.0. Source: https://hedgefund.md/models/options_book/prompt.md. Terms: https://hedgefund.md/termsCall it
The same code answers on this page, over HTTP, over MCP and on your own machine, and the same inputs give the same bytes. No key, and nothing is stored. Send positions by POST or run the library, because a URL can land in a server log. model.md holds all of this for your agent.
POST the inputs to /api/v1/options_book.
curl -s https://hedgefund.md/api/v1/options_book \ -H 'content-type: application/json' \ -d '{"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]}' \ | jq '{summary, flags, flips, not_modeled, inputs_hash}'The tool is options_book on https://hedgefund.md/mcp.
curl -s https://hedgefund.md/mcp \ -H 'content-type: application/json' -H 'accept: application/json' \ -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"options_book","arguments":{"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]}}}' \ | jq '.result.structuredContent | {summary, flags, flips, not_modeled, inputs_hash}'One file with no dependencies, and nothing is sent anywhere.
curl -fsSL https://hedgefund.md/hedgefund.mjs -o hedgefund.mjs # read it before you run itnode hedgefund.mjs template options_book > mine.json # replace every number in itnode hedgefund.mjs run options_book mine.json | jq '{summary, flags, flips, not_modeled, inputs_hash}'Made-up numbers that run as they stand. Replace every one.
{ "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]}Inputs
| Input | Type | Range | Required | What it is |
|---|---|---|---|---|
| spot | number | 0.000001 to 1000000000 | yes | Spot price of the underlying. |
| rate_pct | number | -10 to 50 | yes | Continuously compounded interest rate. 4 means 4%. |
| dividend_yield_pct | number | -10 to 50 | yes | Continuous dividend yield on the underlying. 1 means 1%. |
| capital | number | 0.01 to 10000000000000 | yes | Capital the worst loss is measured against. |
| legs | array | 1 to 30 items | yes | The options in the book. Up to 30. |
| legs[].type | string | call | put | yes | Call or put. |
| legs[].qty | number | -10000000 to 10000000 | yes | Contracts, signed. Negative is short. |
| legs[].strike | number | 0.000001 to 1000000000 | yes | Strike price. |
| legs[].expiry_years | number | 0 to 30 | yes | Years to expiry. 0 means expiring now. |
| legs[].vol_pct | number | 0 to 500 | yes | This leg's volatility. 20 means 20%. |
| legs[].multiplier | number | 0.000001 to 1000000 | no | Units of underlying per contract. Default 100. |
| spot_shocks_pct | array | 0 to 15 items | no | Instant spot moves for the grid. -10 means down 10%. Left out or empty uses -30 to +30. |
| vol_shocks_pts | array | 0 to 15 items | no | Vol shifts for the grid, in vol points on every leg. Left out or empty uses -5 to +20. |
| loss_limit_pct | number | 0.01 to 1000 | no | The caller's own loss line, as a share of capital, for flags and flips. Default 25. |
Hypothetical, and on made-up numbers until you replace them. Nobody traded this, and nothing here is on offer.