Class FixingRisk

java.lang.Object
com.quantfinlib.fx.FixingRisk

public final class FixingRisk extends Object
Analytics for benchmark-fixing exposure — the risk concentrated in the short calculation window of an official fix (WM/R 4pm London, the RBI reference rate an NDF settles on, an equity closing auction).

A book that must trade at the fix (to hedge an NDF settlement or match a benchmarked mandate) cannot execute at a single instant: it works the order through the window and receives roughly the window TWAP/VWAP, while its liability references the fix print. These helpers quantify both sides:

All methods are static and allocation-free — usable from a pre-trade gate as well as post-trade TCA.

  • Method Summary

    Modifier and Type
    Method
    Description
    static double
    participationRate(double orderQty, double expectedWindowVolume)
    Order size as a fraction of expected window volume — above ~20% the order moves the fix it is trying to match, and impact (not tracking noise) dominates.
    static double
    slippageVsFix(CurrencyPair pair, double achievedPrice, double fixPrice)
    Realized slippage of an achieved price vs the fix print, in pips (signed, buy side).
    static double
    trackingErrorStd(double volPerSqrtMinute, double windowMinutes)
    Ex-ante 1σ tracking error (price terms) between a fix print and a uniform execution across the window, from diffusion alone.
    static double
    windowTwap(double[] prices)
    Time-weighted average of window prices (equally spaced observations).
    static double
    windowVwap(double[] prices, double[] sizes)
    Volume-weighted average of window prices.

    Methods inherited from class java.lang.Object

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

    • windowTwap

      public static double windowTwap(double[] prices)
      Time-weighted average of window prices (equally spaced observations).
    • windowVwap

      public static double windowVwap(double[] prices, double[] sizes)
      Volume-weighted average of window prices.
    • slippageVsFix

      public static double slippageVsFix(CurrencyPair pair, double achievedPrice, double fixPrice)
      Realized slippage of an achieved price vs the fix print, in pips (signed, buy side).
    • trackingErrorStd

      public static double trackingErrorStd(double volPerSqrtMinute, double windowMinutes)
      Ex-ante 1σ tracking error (price terms) between a fix print and a uniform execution across the window, from diffusion alone.

      For arithmetic Brownian motion with per-√minute vol σ, the variance of (fix − TWAP) over a window of length T minutes ending at the fix is σ²·T/3 — the classic TWAP-vs-close result. Multiply by notional for a P&L figure.

      Parameters:
      volPerSqrtMinute - price vol per √minute (e.g. daily vol / √(24·60))
      windowMinutes - fix calculation window length
    • participationRate

      public static double participationRate(double orderQty, double expectedWindowVolume)
      Order size as a fraction of expected window volume — above ~20% the order moves the fix it is trying to match, and impact (not tracking noise) dominates.