Finance Lab · Delta Defender
Delta Defender Strategy Guide
Write a hedgeRatio function that tracks a short call's true Black-Scholes delta across a fresh random scenario and GBM price path every run.

What is delta hedging?
An option gives its holder the right, not the obligation, to buy or sell an underlying asset at a fixed price by some future date. Whoever sold that option carries the opposite exposure: as the underlying price moves, the value of the option position moves too, and the seller's account gains or loses accordingly. Delta is the name for how sensitive an option's value is to a small move in the underlying price - roughly, how many shares of the underlying the option currently behaves like.
Hedging, in general, means taking an offsetting position so that a risk you are exposed to is cancelled out. Delta hedging applies that idea directly: if you are short an option with a delta of 0.6, holding 0.6 shares of the underlying per option makes your combined position insensitive, to a first approximation, to small moves in the underlying's price. Gains on one side are offset by losses on the other, leaving a position that no longer depends on which way the price moves next.
The catch is that delta itself is not constant. It shifts as the underlying price moves, as time passes, and as volatility changes - the rate of that shift is called gamma, and it is largest for options near their strike price as expiry approaches. Because of gamma, a hedge that was exactly right a moment ago drifts wrong as conditions change, which means delta hedging is a continuous process of recomputing the correct hedge ratio and adjusting the offsetting position to match it.
The standard formula for an option's delta and the rest of its sensitivities comes from an option-pricing model - most commonly Black-Scholes, which assumes the underlying follows a particular random process and derives, in closed form, what an option should be worth and how sensitive that value is to each input. Real markets deviate from the model's assumptions in known ways, but the framework and its vocabulary of Greeks (delta, gamma, theta, vega) remain the shared language for describing options risk.
Delta hedging is the core discipline behind how options dealers and market makers manage the risk of the books they run: every option they sell to a customer becomes a position they must hedge, continuously, against a large and constantly shifting portfolio of underlying exposures - which is why the skill of computing and updating a hedge ratio correctly, quickly, and under changing conditions is central to trading options professionally.
How it works
You are short one call option, and instead of adjusting a hedge by hand you write the rule: a JavaScript function hedgeRatio(S, K, T, r, sigma, tick) returning the fraction of a share to hold per option, from 0 to 1. Every run, the game draws a fresh scenario - strike fixed at 100, initial moneyness between 0.85 and 1.15, expiry from 2 to 20 trading days, volatility from 20% to 55%, rate 2% - then simulates a real geometric Brownian motion price path over 40 ticks and calls your function at every tick with the live inputs.
At each tick the game computes the true Black-Scholes delta of the call and compares it to your returned hedge ratio. Your net delta is your hedge minus the true delta; a tick counts as hedged when its absolute value is within 0.12. A playback screen shows the needle of your net delta tick by tick, with your hedge and the true delta side by side, before the final result.
Because the scenario and the path are re-randomized every run, a hard-coded constant or a formula tuned to one strike, expiry, or vol level will not survive the next click - the submission has to be a formula in the inputs. A reference implementation (Black-Scholes delta via the normal CDF) can be revealed in the editor, and if your code throws, the run reports the crash and returns you to the editor.
How scoring works
There is no points total. A run is a win when your function stays within the 0.12 net-delta tolerance on at least 70% of the 40 ticks. The result screen reports your percentage of hedged ticks, your average absolute net delta, and a benchmark: the fraction of ticks a static 0.5 hedge would have been within tolerance on the exact same path - the bar a real rule needs to clear.
Delta is N(d1) - and why that shape matters
For a European call under Black-Scholes, delta equals N(d1), the standard normal CDF evaluated at d1 = (ln(S/K) + (r + sigma^2/2)T) / (sigma * sqrt(T)). Intuitively, delta is close to a (risk-adjusted) probability that the option finishes in the money: deep out-of-the-money calls hedge near 0, deep in-the-money near 1, and at-the-money near 0.5 (slightly above, because of the +sigma^2/2 drift term).
The winning submission simply computes this. You need a normal CDF - the reference code uses the Abramowitz-Stegun polynomial approximation, accurate to about 7.5e-8, and you can write the same five-coefficient formula in a few lines. Handle the T = 0 edge exactly as the engine does: at expiry the hedge is 1 if S > K, else 0.
The reason delta is the hedge at all: a short call loses value at rate delta per dollar of stock rally, so holding delta shares of stock cancels the first-order exposure. That is a Taylor-expansion statement - it kills the linear term in the P&L, leaving the second-order (gamma) and time (theta) terms, which is why the losing banner reads 'gamma got you'.
Gamma intuition: where a hedge goes stale fastest
Gamma is the rate of change of delta with the stock price - phi(d1) / (S * sigma * sqrt(T)) in Black-Scholes. It is largest at the money and explodes as expiry approaches, because a small move near the strike flips the option between 'basically stock' and 'basically nothing'. That is where any fixed or sluggish hedge drifts out of the 0.12 tolerance the fastest.
This explains the static-0.5 benchmark's behaviour. On a short-dated at-the-money run that wanders around the strike, delta hovers near 0.5 and the constant hedge can look respectable. On any run that starts 10% away from the strike, or trends away from it, true delta pins toward 0 or 1 and the constant hedge fails almost every tick. Your formula wins by re-centering every tick as S, and T through the tick index, change.
If you want to go beyond the plain formula, gamma tells you where precision matters: near the strike with days left, delta moves several hundredths per dollar of stock, so any lag or coarse rounding in your rule burns tolerance there. Far from the strike, delta is flat and almost anything within reach of 0 or 1 stays hedged.
Mental delta checkpoints for the interview version
Quant interviews often ask for delta without a calculator, and a few anchors cover most cases. At the money: delta is approximately 0.5 plus a small correction, roughly 0.5 + 0.2 * sigma * sqrt(T) for low rates - for 20% vol and one month, about 0.52. The moneyness scale that matters is ln(S/K) measured in units of sigma * sqrt(T): one such standard deviation in the money puts delta near N(1), about 0.84; one out puts it near N(-1), about 0.16.
Time and vol enter only through sigma * sqrt(T). Halving time to expiry shrinks the standard-deviation yardstick by sqrt(2), which pushes deltas away from 0.5 for any option not exactly at the strike - short-dated options polarize. Raising vol does the opposite: it drags every delta toward the middle, because more uncertainty makes both finishes plausible.
You can sanity-check your function against the engine's own verified reference point: S = 100, K = 100, T = 1, r = 0.05, sigma = 0.2 gives price about 10.45 and delta about 0.637. If your normCDF and d1 reproduce that, the formula is right and the game becomes a formality.
A worked example
Given: 100-strike call, 10 days to expiry, sigma = 0.30, r = 0.02, and the path at S = 104 on tick 12:
Black-Scholes delta is N(d1), where d1 is:
Numerator: the log-moneyness plus the drift term:
Denominator: volatility scaled by the square root of time:
So d1, and the delta, are:
A correct hedge returns 0.758 and is exactly hedged; the static 0.5 benchmark misses by more than double the 0.12 tolerance:
Later, the path rallies to S = 112 with T down to about 0.005 years. The moneyness yardstick sigma·sqrt(T) shrinks to 0.021, and ln(112/100) = 0.113 is over 5 yardsticks, so d1 is huge and delta is essentially 1:
Common mistakes
• Hard-coding a number or tuning to one scenario. The strike, expiry, vol, and path change every run by design - only a function of the inputs survives.
• Forgetting the T = 0 (or tiny T) edge case. d1 divides by sigma * sqrt(T); at expiry return the intrinsic hedge, 1 if S > K else 0, as the engine itself does.
• Using ln(S/K) without the (r + sigma^2/2)T term, or putting sigma^2/2 with the wrong sign. Small formula errors matter most exactly where gamma is high - near the strike, close to expiry.
• Returning values outside 0 to 1 or crashing on edge inputs. A crash aborts the run; an out-of-range hedge is simply a bad hedge.
• Judging your rule only on runs it wins. Check the average absolute net delta and the static-0.5 benchmark - a good formula should beat the benchmark on paths far from the strike, where the constant hedge collapses.
Why interviews test this
'Walk me through delta hedging' is a staple of options-desk and quant-trading interviews. This game asks for the working version of the answer, a rule that holds up as spot, time, and vol move. Follow-ups you should expect map directly onto the playback screen - why the hedge bleeds near the strike into expiry (gamma), what you are paid for rebalancing (theta versus gamma P&L), and what happens to delta when vol rises (it pulls toward 0.5).
The coding format also mirrors modern quant interviews, where you implement Black-Scholes or a normal CDF live. Being able to write d1, handle the expiry edge case, and sanity-check against a known value (S=100, K=100, T=1, r=0.05, sigma=0.2 gives delta about 0.637) is a compact, demonstrable skill.
Play Delta Defender on Outcry
Delta Defender is free to play on Outcry, in the Finance Lab section, and every run is timed and scored. Read the guide once, then play Delta Defender and check your score against the strategy above. The guide book has a written guide for every other game, and the practice hub and mock assessments put the same skills under a real screen's clock.