Class FxSwap
An at-market swap has zero value at inception: both legs trade at the
prevailing outrights, so only the points differential between the
legs is economically exchanged. Value appears as the points move; this
class marks each leg against a current SwapPointsCurve and
(optionally) discounts the leg P&Ls with a quote-currency
YieldCurve.
Sign convention: baseNotional > 0 means the near leg buys
base currency (and the far leg sells it back). All results are in quote
currency per the pair's quotation.
-
Method Summary
Modifier and TypeMethodDescriptionstatic FxSwapatMarket(SwapPointsCurve curve, String nearTenor, String farTenor, double baseNotional) At-market swap struck off a points curve: both legs at the curve's outrights, so inception value is zero by construction.doublefarDate()doublefarRate()doublemarkToMarket(SwapPointsCurve current) Undiscounted mark-to-market in quote currency against a current curve: each leg's (current forward − traded rate) × signed base notional.doublemarkToMarket(SwapPointsCurve current, YieldCurve quoteDiscount) Discounted mark-to-market: live-leg P&Ls discounted off a quote-currency zero curve (ACT/365 from the valuation curve's spot date).nearDate()doublenearRate()static FxSwapof(CurrencyPair pair, double baseNotional, LocalDate nearDate, double nearRate, LocalDate farDate, double farRate) Explicit legs (off-market swaps, historical bookings).pair()static doublerollCost(CurrencyPair pair, double baseNotional, double tomNextPips) Cost in quote currency of rolling a base position one day at a quoted tom-next rate: what a position holder pays (or earns, when negative) to push settlement from tomorrow to the next day.doubleThe swap's traded points differential (far − near) in pips — what the two counterparties actually negotiated.toString()
-
Method Details
-
of
public static FxSwap of(CurrencyPair pair, double baseNotional, LocalDate nearDate, double nearRate, LocalDate farDate, double farRate) Explicit legs (off-market swaps, historical bookings). -
atMarket
public static FxSwap atMarket(SwapPointsCurve curve, String nearTenor, String farTenor, double baseNotional) At-market swap struck off a points curve: both legs at the curve's outrights, so inception value is zero by construction."SPOT"is accepted as the near tenor for the classic spot-against-forward swap. -
markToMarket
Undiscounted mark-to-market in quote currency against a current curve: each leg's (current forward − traded rate) × signed base notional. The near leg is long base whenbaseNotional > 0, the far leg short — so an at-market swap marks to ~zero on its own curve.Aged swaps: a leg whose settlement date lies before the marking curve's spot has already settled — its P&L is realized cash in the books, not mark-to-market — so it contributes zero here. Routine daily marking of a seasoned swap therefore values only the remaining live leg(s).
-
markToMarket
Discounted mark-to-market: live-leg P&Ls discounted off a quote-currency zero curve (ACT/365 from the valuation curve's spot date). Settled legs contribute zero, as in the undiscounted form. -
swapPointsPips
public double swapPointsPips()The swap's traded points differential (far − near) in pips — what the two counterparties actually negotiated. -
rollCost
Cost in quote currency of rolling a base position one day at a quoted tom-next rate: what a position holder pays (or earns, when negative) to push settlement from tomorrow to the next day. -
pair
-
baseNotional
public double baseNotional() -
nearDate
-
nearRate
public double nearRate() -
farDate
-
farRate
public double farRate() -
toString
-