Class ExchangeOption

java.lang.Object
com.quantfinlib.pricing.ExchangeOption

public final class ExchangeOption extends Object
TWO-ASSET closed forms: Margrabe's exchange option and Kirk's spread approximation — the workhorse formulas for relative-value option books (crack spreads, calendar spreads, stock-vs-index switches).

Margrabe (1978) — the right to exchange asset 2 for asset 1 (payoff max(0, S1 − S2)) is a Black-Scholes call in disguise: price asset 1 IN UNITS OF asset 2 and the strike becomes 1, the rate drops out entirely (a ratio has no financing cost) and the vol is the vol of the RATIO, σ² = σ1² + σ2² − 2ρσ1σ2. The observation worth knowing: with ρ = 1 and σ1 = σ2 the ratio has zero vol and the option is pure forward intrinsic — two perfectly correlated equal-vol assets can never finish crossed.

Kirk (1995) — a spread call max(0, F1 − F2 − K) has no exact lognormal closed form (a difference of lognormals is not lognormal); Kirk approximates F2 + K as one lognormal asset with vol scaled by its F2 share, σ_K = sqrt(σ1² − 2ρσ1σ2·f + σ2²·f²) with f = F2/(F2+K). Exact in both limits — K = 0 collapses to Margrabe, F2 = 0 collapses to Black-76 (both pinned) — and accurate to a few bps of premium for moderate K; known to degrade for very large K with high σ2 (stated: it is an approximation, not a theorem).

Research lane, deterministic, no smile (single flat vol per leg).

  • Method Summary

    Modifier and Type
    Method
    Description
    static double
    kirkSpreadCall(double f1, double f2, double strike, double rate, double vol1, double vol2, double rho, double timeYears)
    Kirk's approximation for a spread CALL on two forwards: max(0, F1 − F2 − K) paid at expiry, discounted at rate.
    static double
    margrabe(double s1, double s2, double q1, double q2, double vol1, double vol2, double rho, double timeYears)
    Margrabe: receive asset 1, deliver asset 2 at expiry.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • margrabe

      public static double margrabe(double s1, double s2, double q1, double q2, double vol1, double vol2, double rho, double timeYears)
      Margrabe: receive asset 1, deliver asset 2 at expiry.
      Parameters:
      s1 - spot of the asset received, > 0
      s2 - spot of the asset delivered, > 0
      q1 - asset 1 continuous yield
      q2 - asset 2 continuous yield
      rho - correlation of the two log-returns, in [-1, 1]
    • kirkSpreadCall

      public static double kirkSpreadCall(double f1, double f2, double strike, double rate, double vol1, double vol2, double rho, double timeYears)
      Kirk's approximation for a spread CALL on two forwards: max(0, F1 − F2 − K) paid at expiry, discounted at rate. strike may be 0 (Margrabe limit) but not negative — flip the legs instead.