FREE4/4+0ACC--

Delta Defender - options hedging practice

← Finance Lab

About Delta Defender

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.

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.

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

The Delta Defender guide covers how scoring works, the strategy that wins, a worked example and the mistakes most players make.

More Finance games