Class FxVolSurface

java.lang.Object
com.quantfinlib.fx.FxVolSurface

public final class FxVolSurface extends Object
FX volatility surface built from the market's delta-quoted smile: ATM, 25-delta risk reversal and butterfly, optionally 10-delta wings.

Pillar vols (Reiswich and Wystup 2010, "FX volatility smile construction", Wilmott; Clark 2011, Foreign Exchange Option Pricing, chapter 3). The smile (or "smile strangle") butterfly BF_s defines

  σ(Δ call) = σ_ATM + BF_s + RR / 2
  σ(Δ put)  = σ_ATM + BF_s − RR / 2

and each pillar strike is solved from its delta at its own vol. A broker screen does not show BF_s. It shows the market (broker) strangle BF_m: one vol σ_ATM + BF_m at which a Δ-strangle is priced, its two strikes solved at that single vol. With FxVolSurface.ButterflyQuote.BROKER_STRANGLE (the default) the builder finds BF_s so that the market strangle's strikes, priced on the resulting smile, are worth the same as the strangle priced at σ_ATM + BF_m (Clark 2011, section 3.6). With RR = 0 the two coincide; with skew BF_s is larger, by up to a few tenths of a vol on skewed pairs. With 10-delta wings both levels are solved jointly. Use FxVolSurface.ButterflyQuote.SMILE_STRANGLE when the input already is BF_s.

Conventions

FxVolSurface.DeltaConvention: forward or spot delta, each with or without premium adjustment. Spot deltas need the foreign discount factor e^{−r_f T}, supplied per expiry through FxVolSurface.Builder.add(double, double, double, double, double, double, double, double). FxVolSurface.AtmConvention: delta-neutral straddle (the usual quote) or ATM forward (K = F, used for long-dated and some EM pairs). The choice of convention per pair and tenor belongs to the caller; Clark (2011) table 3.1 lists the common ones.

Interpolation

Within an expiry: linear in vol against log-moneyness ln(K/F), flat beyond the outermost pillars. Across expiries: linear in total variance σ²τ at fixed log-moneyness, flat outside the quoted range. Forwards interpolate log-linearly in time. Lookups after FxVolSurface.Builder.build() are allocation-free.

  • Method Details

    • builder

      public static FxVolSurface.Builder builder()
    • atmStrike

      public static double atmStrike(double forward, double vol, double tYears, FxVolSurface.DeltaConvention delta, FxVolSurface.AtmConvention atm)
      ATM strike under the given conventions.
    • strikeForDelta

      public static double strikeForDelta(double forward, double vol, double tYears, double delta, boolean isCall, FxVolSurface.DeltaConvention convention, double foreignDiscountFactor)
      Strike for a target delta under any FxVolSurface.DeltaConvention. Spot deltas are divided by foreignDiscountFactor = e^{−r_f T} to get the forward delta, then solved as below.
    • dnsStrike

      public static double dnsStrike(double forward, double vol, double tYears, boolean premiumAdjusted)
      Delta-neutral-straddle (ATM) strike: F·e^{+σ²τ/2} for forward delta, F·e^{−σ²τ/2} premium-adjusted. At this strike the call and put deltas cancel exactly.
    • strikeForDelta

      public static double strikeForDelta(double forward, double vol, double tYears, double delta, boolean isCall, boolean premiumAdjusted)
      Strike for a target forward delta (call delta in (0,1), put delta in (−1,0)). Unadjusted deltas invert in closed form; premium-adjusted deltas are solved by bisection on the OTM branch.
    • vol

      public double vol(double expiryYears, double strike)
      Interpolated vol for an absolute strike at an expiry. Wings are flat beyond the quoted pillars; time interpolation is linear in total variance and flat outside the quoted expiries.
    • atmVol

      public double atmVol(double expiryYears)
      ATM (delta-neutral straddle) vol at an expiry: the smile at zero skew.
    • forwardAt

      public double forwardAt(double expiryYears)
      Log-linear interpolated forward at an expiry, flat outside pillars.
    • pillar

      public FxVolSurface.SmilePillar pillar(int i)
      The solved pillar smile at index i (reporting, VannaVolga inputs).
    • pillarCount

      public int pillarCount()
    • isPremiumAdjusted

      public boolean isPremiumAdjusted()
    • deltaConvention

      public FxVolSurface.DeltaConvention deltaConvention()
    • atmConvention

      public FxVolSurface.AtmConvention atmConvention()
    • smileButterfly25

      public double smileButterfly25(int i)
      Smile-strangle 25Δ butterfly solved (or taken as given) at pillar i.
    • smileButterfly10

      public double smileButterfly10(int i)
      Smile-strangle 10Δ butterfly at pillar i, NaN without 10Δ wings.