Skip to main content

Formula handbook

Every formula the pricing uses, explained from first principles. Each chapter covers what the formula is, why it is used, how it works, every symbol, its limits, and a worked example using the figures from the walkthrough. The chapters build on each other.

  1. Returns, and why rates are modelled with logarithms
  2. The normal distribution and Φ
  3. Volatility, and the RiskMetrics average
  4. GARCH(1,1): volatility that returns to normal
  5. Covered interest parity and the forward rate
  6. Black-Scholes
  7. Garman-Kohlhagen: Black-Scholes for currencies
  8. Merton jump-diffusion
  9. Option spreads: a payout between two levels
  10. Computing Φ: the Abramowitz and Stegun approximation
  11. Putting it together

1. Returns, and why rates are modelled with logarithms​

What it is. A return is how much the rate changed from one day to the next. Finance measures it as a log return: the natural logarithm of today's rate divided by yesterday's.

Why it is used. Log returns add up over time, and if each day's log return is random and roughly normal, the rate can never fall below zero. This model of prices, geometric Brownian motion, is the starting point of every option formula here.

How it works.

  1. Each day the rate moves by a small random percentage.
  2. Daily log returns are treated as independent and normal, with an average (drift) and a spread (volatility).
  3. Over TT years the total log return is normal, with average (μ−σ2/2)T(\mu - \sigma^2/2)T and spread σT\sigma\sqrt T.
  4. So the rate at expiry is lognormal: its logarithm is normal.
ut=ln⁡StSt−1dSS=μ dt+σ dWln⁡ST∼N ⁣(ln⁡S0+(μ−12σ2)T, σ2T)u_t = \ln\frac{S_t}{S_{t-1}} \qquad \frac{dS}{S} = \mu\,dt + \sigma\,dW \qquad \ln S_T \sim \mathcal N\!\left(\ln S_0 + \big(\mu - \tfrac12\sigma^2\big)T,\ \sigma^2 T\right)
SymbolMeaning
utu_tlog return on day tt
StS_trate on day tt
μ\mu, σ\sigmayearly drift and volatility
dWdWa random shock (Brownian motion)

The −σ2/2-\sigma^2/2 term (from Itô's lemma) separates the average of the rate from the average of its logarithm; without it the average rate would be overstated.

Limits. Real currencies have more extreme days than a normal distribution predicts, and volatility changes over time. Chapters 4 and 8 address both.

Example. With SS = 11.20, μ\mu = 12%, σ\sigma = 16.84% and TT = 0.0821: the middle of the likely rates at expiry is 11.30, and about two thirds of outcomes fall between 10.77 and 11.86.

2. The normal distribution and Φ​

What it is. The bell curve. Φ(x)\Phi(x) is the chance that a standard normal number is below xx.

Why it is used. Because log returns are normal, every "chance the rate ends above KK" question becomes a lookup of Φ\Phi. It appears in every option formula here.

Φ(x)=12π∫−∞xe−z2/2 dzΦ(−x)=1−Φ(x)\Phi(x) = \frac{1}{\sqrt{2\pi}}\int_{-\infty}^{x} e^{-z^2/2}\,dz \qquad \Phi(-x) = 1 - \Phi(x)

Example. Φ(0)\Phi(0) = 0.5000, Φ(1)\Phi(1) = 0.8413, Φ(−1)\Phi(-1) = 0.1587, Φ(2)\Phi(2) = 0.9772.

3. Volatility, and the RiskMetrics average​

What it is. Volatility σ\sigma is the typical size of the rate's moves, stated per year.

Why it is used. It is the most important input to an option price. The RiskMetrics method [4] weights recent days more than old ones, so it reacts quickly when a currency becomes turbulent.

How it works.

  1. Square each day's log return: that is the day's contribution to variance.
  2. Each day keep 94% of yesterday's estimate and add 6% of today's squared return.
  3. Old days fade geometrically: after 30 days a return keeps 0.94300.94^{30} ≈ 16% of its weight.
  4. Convert daily variance to yearly volatility: square root, times 252\sqrt{252}.
σt2=λ σt−12+(1−λ) ut2σyear=σday252λ=0.94\sigma_t^2 = \lambda\,\sigma_{t-1}^2 + (1-\lambda)\,u_t^2 \qquad \sigma_{\text{year}} = \sigma_{\text{day}}\sqrt{252} \qquad \lambda = 0.94

The engine starts the average from the plain variance of the first 20 of its 60 returns.

Example (five illustrative days, starting from 9% a year):

DayReturnDaily variance (×10⁻⁶)
Start32.143
1+0.4%31.174
2−0.2%29.544
3+0.9%32.631
4−0.6%32.833
5+0.3%31.403
Yearly volatility8.90%

Limits. It only looks backwards. Banks prefer volatility implied by option prices, which frontier currencies lack; the engine adds a margin and a minimum for the market type instead.

4. GARCH(1,1): volatility that returns to normal​

What it is. A model of volatility that moves in waves, with turbulence fading back toward a long-run level [5].

Why it is used. A contract needs the average volatility over its whole life, not just today's. GARCH gives a closed form for that average.

How it works.

  1. Each day's variance blends a long-run level, yesterday's squared return and yesterday's variance.
  2. The persistence p=α+βp = \alpha + \beta sets how slowly shocks fade: at 0.93 about 7% of the gap to the long-run level closes each day.
  3. Averaging the forecast over NN days gives a weight ww between 0 and 1: short contracts use mostly today's volatility, long ones mostly the long-run level.
σt2=ω+αut−12+βσt−12σL2=ω1−α−βE[σt+n2]=σL2+pn(σ02−σL2)\sigma_t^2 = \omega + \alpha u_{t-1}^2 + \beta\sigma_{t-1}^2 \qquad \sigma_L^2 = \frac{\omega}{1-\alpha-\beta} \qquad \mathbb E\big[\sigma_{t+n}^2\big] = \sigma_L^2 + p^{n}(\sigma_0^2 - \sigma_L^2) σˉN2=σL2+1−pNN(1−p)⏟w (σ02−σL2)\bar\sigma_N^2 = \sigma_L^2 + \underbrace{\frac{1-p^N}{N(1-p)}}_{w}\,(\sigma_0^2 - \sigma_L^2)

The engine uses a persistence fitted for the pair where one exists, otherwise the default for its market type: 0.97 major currencies, 0.95 major emerging, 0.94 less liquid emerging, 0.93 frontier, 0.85 pegged.

Example. σ0\sigma_0 = 15.75%, σL\sigma_L = 18%, pp = 0.93, NN = 21: ww = 0.5321 and σˉ\bar\sigma = 16.84%.

Limits. The constants come from history and can shift after a change of exchange-rate policy.

5. Covered interest parity and the forward rate​

What it is. The forward rate is the rate agreed today for a future exchange. Parity says it equals today's rate adjusted by the two currencies' interest rates.

Why it is used. Option prices need the rate expected at expiry in the risk-neutral sense, and the forward rate is that number. Otherwise borrowing in one currency and lending in the other would give a riskless profit.

F=S e(rd−rf)TBlockFinaX: F=S e(r−q)T=S eμT  since q=r−μF = S\,e^{(r_d - r_f)T} \qquad \text{BlockFinaX: } F = S\,e^{(r-q)T} = S\,e^{\mu T}\ \ \text{since } q = r - \mu
SymbolMeaning
rdr_d, rfr_finterest rates of the quote currency (cedi) and the base currency (dollar)
μ\muthe pair's five-year trend, used in place of the rate gap

Limits. Parity needs money to move freely. Many frontier currencies have no reliable forward market or usable local rate, so the trend stands in; that is a modelling choice, not market data.

Example. SS = 11.20, μ\mu = 12%, TT = 0.0821: FF = 11.3109.

6. Black-Scholes​

What it is. The 1973 formula for the fair price of an option [2]. Scholes and Merton received the 1997 Nobel prize in economics for this work.

Why it is used. The price equals the cost of building the same payout by trading the asset and cash, so it depends on no one's forecast. It is the common language of option markets.

How it works.

  1. Assume the lognormal model of chapter 1 with constant volatility.
  2. Price as if investors were neutral to risk: grow the price at the risk-free rate and discount at it. Hedging arguments show this gives the right price.
  3. d2d_2 is how many standard deviations the expected price at expiry sits above the strike; Φ(d2)\Phi(d_2) is the risk-neutral chance of ending above it.
  4. The price is what you expect to receive, SΦ(d1)S\Phi(d_1), minus what you expect to pay, Ke−rTΦ(d2)K e^{-rT}\Phi(d_2).
c=S Φ(d1)−Ke−rTΦ(d2)d1=ln⁡(S/K)+(r+12σ2)TσTd2=d1−σTc = S\,\Phi(d_1) - K e^{-rT}\Phi(d_2) \qquad d_1 = \frac{\ln(S/K) + (r + \tfrac12\sigma^2)T}{\sigma\sqrt T} \qquad d_2 = d_1 - \sigma\sqrt T

Limits. Constant volatility and rates, no jumps, continuous trading without costs. Currencies most often break the no-jumps assumption (chapter 8).

7. Garman-Kohlhagen: Black-Scholes for currencies​

What it is. The 1983 adaptation of Black-Scholes to exchange rates [1], the standard formula for currency options.

Why it is used. A currency earns interest while held, like a dividend. The formula accounts for both currencies' rates.

How it works. Start from Black-Scholes; discount today's rate by the base currency's interest and the strike by the quote currency's; the gap between them sets the drift, matching the forward rate of chapter 5. A put follows with signs reversed.

Call=Se−qTΦ(d1)−Ke−rTΦ(d2)Put=Ke−rTΦ(−d2)−Se−qTΦ(−d1)\text{Call} = S e^{-qT}\Phi(d_1) - K e^{-rT}\Phi(d_2) \qquad \text{Put} = K e^{-rT}\Phi(-d_2) - S e^{-qT}\Phi(-d_1) d1=ln⁡(S/K)+(r−q+12σ2)TσTd2=d1−σTCall−Put=Se−qT−Ke−rTd_1 = \frac{\ln(S/K) + (r - q + \tfrac12\sigma^2)T}{\sigma\sqrt T} \qquad d_2 = d_1 - \sigma\sqrt T \qquad \text{Call} - \text{Put} = S e^{-qT} - K e^{-rT}
SymbolMeaning
rrdiscount rate; the engine uses the USD rate
qqcarry; in the standard method the other currency's interest rate, in the engine r−μr - \mu, so the drift r−qr - q equals the trend
Call − Putput-call parity, a consistency check

Example (no jumps, KK = 11.60): Call = 0.105120 GHS, Put = 0.393189 GHS; Call − Put = −0.288069, matching Se−qT−Ke−rTS e^{-qT} - K e^{-rT} = −0.288069.

8. Merton jump-diffusion​

What it is. The 1976 extension of Black-Scholes in which the price can also jump suddenly [3].

Why it is used. Frontier currencies often move in steps. A model without jumps calls those steps almost impossible and underprices protection against them.

How it works.

  1. On top of everyday moves, jumps arrive at random, λ\lambda times a year on average.
  2. Each jump's log size is normal, with average μJ\mu_J and spread σJ\sigma_J.
  3. Given exactly nn jumps, the rate is again lognormal, with more variance and shifted drift, so Garman-Kohlhagen prices that case.
  4. Weight each case by its chance and add them up.
dSS=(r−q−λk) dt+σ dW+dJk=eμJ+σJ2/2−1λ′=λ(1+k)\frac{dS}{S} = (r - q - \lambda k)\,dt + \sigma\,dW + dJ \qquad k = e^{\mu_J + \sigma_J^2/2} - 1 \qquad \lambda' = \lambda(1+k) Price=∑n=0∞e−λ′T(λ′T)nn! GK(S,K,T; rn,σn)σn2=σ2+nσJ2Trn=r−λk+n(μJ+12σJ2)T\text{Price} = \sum_{n=0}^{\infty} \frac{e^{-\lambda' T}(\lambda' T)^n}{n!}\ \text{GK}(S, K, T;\ r_n, \sigma_n) \qquad \sigma_n^2 = \sigma^2 + \frac{n\sigma_J^2}{T} \qquad r_n = r - \lambda k + \frac{n(\mu_J + \tfrac12\sigma_J^2)}{T}

The −λk-\lambda k term keeps the expected path on the forward rate, so jumps widen the spread of outcomes without moving their centre. The engine stops the sum at 50 jumps or when the chance becomes negligible. Jump settings come from the market type (frontier: λ\lambda = 2, μJ\mu_J = 8%, σJ\sigma_J = 12%) and can be set for a single pair.

Example. λ′T\lambda' T = 0.1792, so the chance of no jump before expiry is 83.59%, one jump 14.98%, two jumps 1.34%. Adding jumps raises Call(11.60) from 0.105120 to 0.206256 GHS.

Limits. Jump frequency and size are hard to estimate from few events.

9. Option spreads: a payout between two levels​

What it is. A call spread buys an option at the strike KK and sells one at the limit CC. It pays above KK and stops growing at CC.

Why it is used. Capping the payout makes protection cheaper and fixes the underwriters' maximum loss. Every contract is a spread: a call spread for an Up cover, a put spread for a Down cover.

max⁡(0, min⁡(R,C)−K)=(R−K)+−(R−C)+V=Call(K)−Call(C)\max\big(0,\ \min(R,C) - K\big) = (R-K)^+ - (R-C)^+ \qquad V = \text{Call}(K) - \text{Call}(C)

Example. VV = 0.206256 − 0.084845 = 0.121411 GHS per USD of notional. If the rate ends at 12.80, (R−K)+−(R−C)+(R-K)^+ - (R-C)^+ = 1.20 − 0.30 = 0.90 = C−KC - K.

10. Computing Φ: the Abramowitz and Stegun approximation​

What it is. Φ\Phi has no simple closed form. The engine (normalCDF in server/pricing/kernel.ts) uses formula 7.1.26 from Abramowitz and Stegun [7], accurate for Φ\Phi to about 7.5×10−87.5 \times 10^{-8}.

Φ(x)=12(1+erf⁡(x/2))erf⁡(z)≈1−(a1t+a2t2+a3t3+a4t4+a5t5) e−z2t=11+0.3275911 z\Phi(x) = \tfrac12\Big(1 + \operatorname{erf}\big(x/\sqrt2\big)\Big) \qquad \operatorname{erf}(z) \approx 1 - (a_1 t + a_2 t^2 + a_3 t^3 + a_4 t^4 + a_5 t^5)\,e^{-z^2} \qquad t = \frac{1}{1 + 0.3275911\,z}

a1a_1 = 0.254829592, a2a_2 = −0.284496736, a3a_3 = 1.421413741, a4a_4 = −1.453152027, a5a_5 = 1.061405429. For negative xx, Φ(−x)=1−Φ(x)\Phi(-x) = 1 - \Phi(x).

Example. Φ(1.2815516)\Phi(1.2815516) by the approximation is 0.8999999, against an exact 0.9000000: a difference of 6.3×10−86.3 \times 10^{-8}.

11. Putting it together​

The ten chapters fit together into one calculation. Each supplies one piece of the final price.

ChapterSuppliesWalkthrough step
1. Log returnsThe lognormal picture of where the rate can end5, 7
2 and 10. ΦThe probabilities inside every option value7
3. RiskMetricsToday's volatility σ0\sigma_0 from recent moves5
4. GARCHThe average volatility σ\sigma over the contract5
5. ParityThe expected drift, through q=r−μq = r - \mu4
6 and 7. Black-Scholes, Garman-KohlhagenThe value of an option at one level7
8. MertonThe allowance for sudden jumps6, 7
9. SpreadsThe contract as the difference of two options2, 7

Written as a single formula, the fair rate the engine signs is:

fair rate=1S∑n=050e−λ′T(λ′T)nn![GK(K; σn,rn)−GK(C; σn,rn)]\text{fair rate} = \frac{1}{S}\sum_{n=0}^{50} \frac{e^{-\lambda' T}(\lambda' T)^n}{n!}\Big[\text{GK}(K;\ \sigma_n, r_n) - \text{GK}(C;\ \sigma_n, r_n)\Big]

with σ\sigma from chapters 3 and 4, qq from chapter 5, the jump terms from chapter 8, and Φ\Phi from chapter 10. Everything in this formula is published and standard. The judgement lies in four inputs: the trend used as drift, the volatility margin and minimum for each market type, the persistence default, and the jump settings. Those are the inputs to review and recalibrate as frontier markets deepen and more data becomes available; the walkthrough shows how much each one moves the price.

Further reading. Hull's Options, Futures, and Other Derivatives [6] covers chapters 1 to 9 in depth; the original papers [1] [2] [3] [5] give the derivations.