Interest Rates

Building Blocks

DiffFusion.NumeraireType
struct Numeraire <: Leaf
    obs_time::ModelTime
    curve_key::String
end

The price of our numeraire asset price N(t) at observation time t.

Typically, this coincides with the bank account price in numeraire (i.e. domestic) currency.

source
DiffFusion.BankAccountType
struct BankAccount <: Leaf
    obs_time::ModelTime
    key::String
end

The price of a continuous compounded bank account B(t) at observation time t and with unit notional at inception.

source
DiffFusion.ZeroBondType
struct ZeroBond <: Leaf
    obs_time::ModelTime
    maturity_time::ModelTime
    key::String
end

The price of a zero coupon bond P(t,T) with observation time t and bond maturity time T.

source
DiffFusion.FixingType
struct Fixing <: Leaf
    obs_time::ModelTime
    key::String
end

The value of an index fixing Idx(t) at observation time t.

The value is obtained from a term structure linked to the path.

source

Rates Payoffs

DiffFusion.LiborRateType
struct LiborRate <: Leaf
    obs_time::ModelTime
    start_time::ModelTime
    end_time::ModelTime
    year_fraction::ModelValue
    key::String
end

A simple compounded forward Libor rate.

source
DiffFusion.LiborRateMethod
LiborRate(
   obs_time::ModelTime,
   start_time::ModelTime,
   end_time::ModelTime,
   key::String,
   )

A simple compounded forward Libor rate with year fraction from model time.

source
DiffFusion.CompoundedRateType
struct CompoundedRate <: Payoff
    obs_time::ModelTime
    start_time::ModelTime
    end_time::ModelTime
    year_fraction::ModelValue
    fixed_compounding::Union{Payoff, Nothing}
    key::String
    fixed_type::DataType  # distinguish from constructors
end

A continuously compounded backward looking rate.

This is a proxy for daily compounded RFR coupon rates.

For obstime less starttime it is equivalent to a Libor rate.

source
DiffFusion.CompoundedRateMethod
CompoundedRate(
    obs_time::ModelTime,
    start_time::ModelTime,
    end_time::ModelTime,
    key::String,
    fixed_compounding::Union{Payoff, Nothing} = nothing,
    )

A continuously compounded backward looking rate with year fraction from model time.

source
DiffFusion.OptionletType
struct Optionlet <: Payoff
    obs_time::ModelTime
    expiry_time::ModelTime
    gearing_factor::Payoff
    forward_rate::Union{LiborRate, CompoundedRate}
    strike_rate::Payoff
    call_put::ModelValue
end

The time-t forward price of an option paying [ϕ(R-K)]^+. Rate R is determined at expiry_time. The rate R can be forward-looking or backward-looking.

forward price is calculated as expectation in T-forward measure where T corresponds to the period end time. Conditioning (for time-t price) is on information at obs_time.

The rate R is written in terms of a compounding factor C and R = [G C - 1]/τ. Here, G is an additional gearing factor to capture past OIS fixings.

Then, option payoff becomes G/τ [ϕ(C - (1 + τK)/G)]^+.

source
DiffFusion.OptionletType
Optionlet(
    obs_time_::ModelTime,
    expiry_time::ModelTime,
    forward_rate::Union{LiborRate, CompoundedRate},
    strike_rate::Payoff,
    call_put::ModelValue,
    gearing_factor::Payoff = ScalarValue(1.0),
    )

Create an Optionlet payoff.

source
DiffFusion.SwaptionType
struct Swaption <: Payoff
    obs_time::ModelTime
    expiry_time::ModelTime
    settlement_time::ModelTime
    forward_rates::AbstractVector
    forward_rate_pay_times::AbstractVector
    fixed_times::AbstractVector
    fixed_weights::AbstractVector
    fixed_rate::ModelValue
    payer_receiver::ModelValue
    disc_key::String
    zcb_pay_times::AbstractVector
    rate_type::DataType  # to distinguish from functions
end

Time-t forward price of an option paying An⋅[ϕ(S-K)]^+. Swap rate S is determined at expiry_time. Floating rates in S can be forward looking of backward looking rates.

Forward price is calculated in T-forward measure where T corresponds to settlement_time. Conditioning (for time-t price) is on information at obs_time.

source
DiffFusion.SwaptionMethod
Swaption(
    obs_time_::ModelTime,
    expiry_time::ModelTime,
    settlement_time::ModelTime,
    forward_rates::AbstractVector,
    fixed_times::AbstractVector,
    fixed_weights::AbstractVector,
    fixed_rate::ModelValue,
    payer_receiver::ModelValue,
    disc_key::String,
    )

Create a Swaption payoff.

source