A derivative is a contract, not a thing. Its value is a function of somebody else’s price — and everything difficult about trading one lives in the fine print: what you post, when you are marked, what you owe at expiry, and how fast your exposure changes while you are looking the other way.
Buy a share of Apple and you own a fraction of a company: a legal claim on its assets and
cash flows that exists whether or not anybody quotes it. Buy an option on Apple and you own
a promise from a counterparty, whose value is a function f(S, t) of the
Apple price and the time left. Nothing was created; risk was moved from one balance sheet to another.
Every derivative is, in the end, someone else’s obligation.
An airline needs jet fuel in six months and cannot store it. A pension fund owns $400 m of equity it does not want to sell but does not want the next 5 % drawdown either. Both buy a contract that pays when the thing they fear happens. The hedge is not a bet — it is the removal of a bet they were already carrying by accident.
A future on a $290 index costs $40 of posted margin, not $290 of cash — a 7.3× exposure ratio. That is the same economic position for 14 % of the capital. It is also the same loss, in full, on the whole $290 of notional, which is why Part 3 of this page is mostly about how that ends.
You cannot buy “the S&P 500”, or 3-month interest rates, or “volatility”, or the difference between Brent and WTI. You can buy a contract whose payoff is defined on any of them. Derivatives are how a view becomes a position when the view is not a thing that trades.
Almost every listed derivative is one of four shapes. Pick one — click, or tab to it and press Enter — to see its payoff, who owes what, and, most importantly, the fields your trading system has to carry for it that it never needed for a share.
Three mechanics blocks. Futures first, because their machinery (margin, daily marks, cost of carry, settlement) is the machinery of every cleared derivative. Then options, where the payoff is non-linear and the sensitivities become the position. Then swaps, in one diagram.
You and a bank agree today: in 90 days you pay $292.75 and receive one unit of the index. Nothing changes hands now. The contract is a private agreement — negotiated size, negotiated date, negotiated collateral — and it is a credit exposure for the whole 90 days. If the index goes to $340, the bank owes you $47.25 per unit and your profit is only as good as the bank.
An exchange publishes a contract — fixed size, fixed expiry, fixed settlement rule — and interposes a clearing house between the two sides. After the trade you are not facing the person who sold to you; you are facing the clearer, which is facing them. That single substitution (novation) is what makes an anonymous order book possible: you never have to price your counterparty’s credit.
A long position in the ARENA10 future, marked every settlement cycle. You post initial margin; each cycle’s price change is debited or credited in cash. When equity falls below the maintenance level, the clearer issues a margin call — top back up to initial, in cash, now. Step through a path and watch a position that is merely wrong for a while consume more cash than it ever risked.
Maintenance is checked against the current notional, so a rising market raises the requirement too. Equity below zero means the clearer closes you out and sends the bill.
A future for delivery in T years is not a forecast. It is spot plus the cost of holding
spot until then. Borrow $S at rate r, buy the asset, collect its dividend or coupon yield
q, deliver it at expiry: the only price that leaves you flat is
This is an arbitrage relation, not a model: if the future trades above F you
sell the future, buy the basket with borrowed cash, and carry it to expiry for a locked-in profit —
cash-and-carry. That is why the basis is one of the few signals in this course with a
fair value you can actually write down. Note what happens as T → 0: the carry goes to
zero and the future must converge to spot. Convergence is the mechanism a basis trade harvests.
Defaults are the ARENA10 base level (290.20 = the equal-weighted average of the ten listed names) with a 3-month contract.
At expiry the short delivers the asset and the long pays the price. Real, and full of operational teeth: warehouse receipts, delivery windows, grade adjustments, the famous risk of forgetting to roll a crude contract and being invoiced for 1,000 barrels. For a systematic system the requirement is blunt: a hard rule that flattens or rolls before the last trading day, enforced by the risk layer and not by a human remembering.
At expiry nobody delivers anything. The exchange computes a settlement level from a published reference — usually an average over a window, to make it hard to manipulate — and pays the difference in cash. Index futures, rate futures and every crypto perpetual work this way. Your system only needs the settlement formula and the timestamp.
The course exchange lists exactly one derivative, and it is deliberately the simplest possible one: a cash-settled future on an equal-weighted index of the ten listed equities. Read the registration and the venue config together and you have the complete contract specification.
# plugins/securities/futures.py INDEX_MEMBERS = ("AAPL", "MSFT", "NVDA", "TSLA", "AMZN", "GOOGL", "META", "NFLX", "AMD", "INTC") def index_level(prices): """Equal-weighted average of the members.""" v = [prices[s] for s in INDEX_MEMBERS if prices.get(s, 0) > 0] return sum(v) / len(v) if v else None arena.register_security( id="ARENA10", name="ARENA-10 Index Future", asset_type="future", base_price=290.20, price_fn=arena10_price_fn, vol=None, # derived from members, not drawn tick_order=1, # priced AFTER every member )
# exchange/config.py — the contract spec FUTURES = {"ARENA10"} # settles as a future # Initial margin per contract, each side. Symmetric: # a short carries the same requirement as a long. FUTURES_MARGIN_PER_CONTRACT = 40.0 # Ticks between variation-margin settlements # — this venue's "daily" mark. FUTURES_SETTLE_TICKS = 300 # How much the future's OWN book moves its mark. # ZERO: a cash-settled future is marked against # its index, so its book may trade at a basis # without moving the settlement price. FUTURES_MID_BLEND_WEIGHT = 0.0
Note also the pedagogical point in the module docstring: ARENA10 is the brokers’ first real hedge. A market maker who is long a basket of single names from quoting can sell the index against it, keep the spread income, and shed most of the directional risk. Before the future existed, the only way to reduce inventory risk was to stop quoting — which is to say, to stop earning.
A future is a linear promise: one point of index is one point of P&L, up or down, forever. An option is a right without an obligation, and that asymmetry is what makes the payoff a hinge instead of a line. Four attributes define one completely, and your system needs all four in the position row: call or put, long or short, strike K, expiry T. The fifth number, the premium, is what the market charges you for the hinge.
The buyer pays premium up front and can never lose more than that. The seller receives premium up front and takes on an obligation that can cost far more — a naked short call is theoretically unbounded. Those two positions are not two sides of a symmetric coin: the buyer’s worst case is known at trade time, the seller’s is not. Everything about how they are margined and risk-managed follows from that.
A call at strike K pays max(S−K, 0) at expiry; a put pays
max(K−S, 0). That is the entire payoff definition, and it is two lines of code.
Getting from there to a price is the hard part.
Split any option premium in two. Intrinsic is what it would pay if
expiry were now — max(S−K,0), never negative. Time value is
the rest: everything you are paying for the possibility that the next weeks go your way.
Time value is largest at the money and decays to zero at expiry, non-linearly: slow at first, then a cliff. It is also the only part of the premium that volatility can move. A deep in-the-money option is nearly all intrinsic and behaves almost like the underlying; a far out-of-the-money option is all time value, which is a polite way of saying it is a lottery ticket with a decay schedule.
S = 100, K = 130 call. Intrinsic 0. All time value. Delta ~0.06 — barely responds to spot.
S = 100, K = 100. Intrinsic 0, maximum time value, maximum gamma. Delta ~0.5: the most uncertain option there is.
S = 100, K = 70 call. Almost all intrinsic, delta ~0.97. A stock position with a coupon of decay attached.
Usually quoted as K/S or
ln(K/S)/(σ√T) — strike distance measured in standard deviations, which is the
only version that compares across names.
Stack up to four legs. Every premium is priced by the Black–Scholes function further down this page at the volatility, rate and maturity you set, so the P&L line is honest about what the structure costs. The dashed line is the position’s value at expiry; the solid line is that minus what you paid. Load a preset, then disable one leg and watch which risk comes back.
Rate fixed at 4.00 %. One contract = one unit of underlying, so every number is per unit — multiply by 100 for a listed US equity option.
| On | Side | Instrument | Strike | Qty | Premium |
|---|
The premium is a function of five inputs. The Greeks are its partial derivatives — nothing deeper than that. What matters for a system is that each one converts a market move into a dollar number, and each one has a unit you must state or the number is meaningless.
| Greek | Derivative | Reads as | What a system does with it |
|---|---|---|---|
| Delta Δ | ∂V/∂S | units of underlying per option | Aggregate it to get portfolio exposure; hedge it to zero to isolate other risks. |
| Gamma Γ | ∂²V/∂S² | delta change per 1.00 of spot | Sets how often you must rebalance. High gamma = your hedge is stale in minutes. |
| Vega | ∂V/∂σ | $ per volatility point | The size of your view on volatility, whether or not you meant to have one. |
| Theta Θ | ∂V/∂t | $ per calendar day | The rent. Long options pay it; short options collect it and owe the gamma. |
| Rho ρ | ∂V/∂r | $ per 1 % of rate | Small for short-dated equity options; dominant for anything on rates. |
Black–Scholes is on this page in about twenty lines of JavaScript, and the widget below is its output. Treat it the way a desk does — not as truth, but as a translation device between a quoted premium and a set of sensitivities everyone agrees to measure the same way. Its assumptions (constant volatility, continuous hedging, lognormal returns) are all wrong in the direction that matters; its value is that it is wrong identically for everybody.
Realised volatility is a measurement: the annualised standard deviation of the returns that already happened. Implied volatility is a quote — the σ you must feed Black–Scholes to reproduce the premium the market is charging. One looks backwards and is a fact; the other looks forwards and is an opinion with a bid-ask spread.
The gap between them is the option market’s core trade. Implied 24 % against realised 17 % says options are expensive relative to how the underlying has actually been moving — sell volatility, hedge the delta, collect theta, and pray the regime holds. The premium is persistent (that is the variance risk premium) and so is the tail that periodically pays for it.
A swap has no strike and no hinge. Two parties simply agree to exchange payment streams
on a notional that never changes hands. The plain-vanilla interest-rate swap is the largest derivatives
market on earth: one side pays a fixed rate, the other pays a floating
reference (SOFR, EURIBOR), and only the net difference moves each period. Notional $100 m, fixed
3.5 %, floating 4.1 %, semiannual: the fixed payer receives
100m × (4.1−3.5) % / 2 = $300k and nothing else happens.
You are the fixed payer / floating receiver — the position a borrower with a floating loan takes to become fixed, and the position a systematic book takes to be long rates.
One side pays financing, the other pays the total return (price plus dividends) of an asset it may not own. Economically identical to a leveraged long, with the position sitting on a dealer’s balance sheet rather than yours. Archegos in 2021 is the standard case study in what happens when several dealers each write one and none can see the others.
Crypto perpetuals have no expiry, so they cannot converge to spot by expiring. Instead a funding rate is paid every eight hours from longs to shorts (or the reverse), proportional to the perp’s premium over the index. It is a swap bolted onto a future: the funding leg is the carry, made explicit and paid continuously.
The numbers are not small. Funding of 0.03 % per 8 hours is 0.09 % per day and ~32.8 % per year. A carry trade — long spot, short perp, collect funding — is a real systematic strategy, and forgetting the funding leg is the single most common way a crypto backtest reports profits that never existed.
Three concrete uses and one warning. The warning first, because it is the one that ends seasons: derivatives are the fastest way to turn a modest edge into a large position, and a large position into a closed account.
Set your account equity and how much notional you want against it. The widget computes the adverse move that takes your equity to the maintenance level — your liquidation distance — and expresses it in daily standard deviations, which is the only unit that tells you whether it will happen. Push the leverage slider and watch the distance collapse faster than your intuition does.
| Leverage | Notional | Liquidating move | Daily sigmas | Odds in 60 days |
|---|
A market maker ends the session long 640 shares across ten names because that is what the flow gave it. That inventory is a directional bet nobody chose. Compute the basket’s delta in index units, sell that many ARENA10 contracts, and the residual is the spread income you actually earned. The hedge costs margin and basis risk; it buys you the ability to keep quoting.
The system requirement: a portfolio delta in one currency, recomputed on every fill, and a hedger that acts on a band rather than on every tick — otherwise you pay the spread to the market you are hedging in more often than you save.
You believe the next earnings print moves the stock more than 4 %, but you have no
idea which way. There is no stock position that expresses that. A delta-hedged straddle does: buy the
hinge, sell the direction, and your P&L becomes roughly
½Γ(ΔS)² − ΘΔt — realised variance against
implied. You are now trading the gap between two volatility numbers, which is a signal you can
backtest.
The system requirement: mark vega and gamma as first-class positions, and rehedge on a rule (time band or delta band) that you chose deliberately, because the rehedge policy is part of the strategy’s return.
The fair value F = S·e^((r−q)T) is one of very few prices in
this course with an arbitrage-enforced anchor. Compute it every tick, subtract the future’s
market price, and you have a mean-reverting series with a known terminal value: zero, at expiry.
On the course venue the anchor is even harder, because
FUTURES_MID_BLEND_WEIGHT = 0.0 means the future’s own book cannot drag the
settlement price with it.
The system requirement: index level and future price on the same timestamp. A basis computed from a 200 ms-stale index is mostly a measurement of your own latency, and it will look like alpha right up until you trade it.
Every one of these has been shipped by a team that understood the theory perfectly. Open them.
The index is 290.20, so the future is worth 290.20 — no. The future is worth what the future is worth, and the difference is the basis: carry, plus whatever the order book is doing. Mark a long future position at spot and you will book a phantom loss on a contango contract every single day, then “discover” a mysterious profit at expiry when it converges.
The reverse error is worse and more subtle: marking at the future’s own last
trade when that is a stale or manipulated print. On the course venue the venue itself marks
ARENA10 against the index (FUTURES_MID_BLEND_WEIGHT = 0.0), so your P&L and the
exchange’s will diverge unless you copy that convention.
Fix: store a mark source per instrument, not a mark. Then make your P&L
reconcile against the venue’s PortfolioUpdate every settlement, and treat a
persistent gap as a bug, never as an edge.
“I have $50,000 and margin is $40 per contract, so I can hold 1,250 contracts.” You can indeed open them. You are then long $362,500 of index against $50,000 of equity — 7.3× — and a 3 % move is 22 % of your account. The margin requirement is the broker’s tolerance for your default, not a statement about how much risk is sensible.
The same error wearing a suit: risk limits written in contracts or shares. Ten contracts of a 1 %-vol contract and ten of a 6 %-vol contract are not the same limit, and a limit that cannot tell them apart is decoration.
Fix: size on risk. Position = (risk budget in $) / (daily vol × notional per contract). Write every limit in dollars of daily volatility or dollars of 1 % move, and have the risk layer reject on that, before the order leaves the process.
You compute delta 0.52, short 52 units, and record “delta neutral” in the log. Spot moves 4 % and delta is 0.63; you are long 11 units and did not place a trade. That is gamma, and it is not an edge case — it is the defining property of the instrument you bought.
Long gamma means the drift works for you (each rehedge sells high and buys low) but you pay theta for the privilege. Short gamma is the mirror image and is the reason so many “consistent-income” option books have exactly one bad month in their history.
Fix: recompute Greeks from the current state on every mark, never cache them across a price move, and define the rehedge trigger explicitly — a delta band, a time band, or both. Log the hedge error so you can see how much of your P&L came from the rehedge policy rather than the view.
A derivative position has a date on which it stops existing. A backtest that holds “the future” for two years is holding an instrument that does not exist; a live system without a roll rule holds a contract into its final settlement window and gets whatever the settlement formula says, which may be an average over a period when liquidity had already left.
Then there is the splice. Chaining contract prices without adjusting for the roll gap manufactures a jump at every expiry, and a momentum signal will happily trade it. Back-adjusted series remove the jump but change every historical price level, so any rule with an absolute price in it is now wrong.
Fix: keep expiry, last_trade and settle_rule on
the instrument; make the risk layer force a flatten-or-roll N days out; and in research, build the
continuous series explicitly, state the adjustment method, and never let a signal see an unadjusted
splice.
Selling out-of-the-money puts credits cash on day one and expires worthless most months. The equity curve is a beautiful straight line and the Sharpe ratio over two years is fictitious, because you have not sampled the event you were paid to insure. You did not find an edge; you sold a lottery ticket and pocketed the float.
The premium is real — the variance risk premium is one of the most persistent effects in finance — but it is compensation for a specific, measurable, left-tail exposure. Book it as such: short gamma, short vega, unbounded loss, and margin that expands exactly when you can least fund it.
Fix: for any short-option book, report the stress loss at −20 % spot and +15 volatility points next to the P&L, always. Size against that number, not against the premium collected. If the strategy does not survive the stress line, the straight line was never the strategy.
Three questions, instant feedback, nothing recorded.
Q1The ARENA10 index sits at 290.20. Financing is 5.0 %, the basket yields 1.5 %, and the 3-month future trades at 293.60. What does a systematic desk do?
Q2You are long 100 calls at delta 0.52 and short 52 units of the underlying — “delta neutral”. Spot rallies 5 % and delta is now 0.68. What is true?
Q3ARENA10 at 290.00. Initial margin 10 % (29.00 per contract), maintenance 7 % (20.30, held fixed). You are long. How far can the index fall before the margin call?
fair_value(S, r, q, T) function and a live basis series against a future’s
book. Plot it. Convince yourself it converges.make install.