OvernightIndexedSwap
Description
Create and price an OvernightIndexedSwap instrument object
for one or more Overnight Indexed Swap (OIS) instruments using this
workflow:
Use
fininstrumentto create anOvernightIndexedSwapinstrument object for one or more OIS instruments.Use
ratecurveto specify a curve model for theOvernightIndexedSwapinstrument object.Use
finpricerto specify aDiscountpricing method for one or moreOvernightIndexedSwapinstruments when using aratecurveobject.
Create an OvernightIndexedSwap instrument object for one or more
OIS instruments to use in curve construction using this workflow:
Use
fininstrumentto create anOvernightIndexedSwapinstrument object for one or more OIS instruments.Use
irbootstrapto create an interest-rate curve (ratecurve) for one or moreOvernightIndexedSwapinstruments.
For more information on these workflows, see Get Started with Workflows Using Object-Based Framework for Pricing Financial Instruments.
For more information on the available models and pricing methods for an
OvernightIndexedSwap instrument, see Choose Instruments, Models, and Pricers.
Creation
Syntax
Description
creates a OvernightIndexedSwapInst = fininstrument(InstrumentType,Maturity=maturity_date,LegRate=leg_rate)OvernightIndexedSwap object for one or more OIS
instruments by specifying InstrumentType and sets the
properties for the required
name-value arguments Maturity and
LegRate. The
OvernightIndexedSwap instrument supports vanilla
Overnight Indexed Swaps, amortizing Overnight Indexed Swaps, and forward
Overnight Indexed Swaps.
sets optional properties using additional
name-value arguments in addition to the required arguments in the previous
syntax. For example, OvernightIndexedSwapInst = fininstrument(___,Name=Value)OvernightIndexedSwapInst =
fininstrument("OvernightIndexedSwap",Maturity=datetime(2019,1,30),LegRate=[0.06
0.12],LegType=["fixed","fixed"],Basis=1,Notional=100,StartDate=datetime(2018,1,30),DaycountAdjustedCashFlow=true,BusinessDayConvention="follow",ProjectionCurve=ratecurve,Name="overnight_indexed_swap_instrument")
creates an OvernightIndexedSwap instrument with a
maturity of January 30, 2019. You can specify multiple name-value
arguments.
Input Arguments
Instrument type, specified as a string with the value of
"OvernigntIndexedSwap", a character vector with
the value of 'OvernigntIndexedSwap', an
NINST-by-1 string array with
values of "OvernigntIndexedSwap", or an
NINST-by-1 cell array of
character vectors with values of
'OvernigntIndexedSwap'.
Data Types: char | cell | string
Name-Value Arguments
Specify required
and optional pairs of arguments as
Name1=Value1,...,NameN=ValueN, where
Name is the argument name and Value is
the corresponding value. Name-value arguments must appear after other arguments,
but the order of the pairs does not matter.
Example: OvernightIndexedSwapInst =
fininstrument("OvernightIndexedSwap",Maturity=datetime(2019,1,30),LegRate=[0.06
0.12],LegType=["fixed","fixed"],Basis=1,Notional=100,StartDate=datetime(2018,1,30),DaycountAdjustedCashFlow=true,BusinessDayConvention="follow",ProjectionCurve=ratecurve,Name="overnight_indexed_swap_instrument")
Required OvernightIndexedSwap Name-Value Arguments
Swap maturity date, specified as Maturity and a
scalar or an NINST-by-1 vector
using a datetime array, string array, or date character
vectors.
To support existing code, OvernightIndexedSwap also
accepts serial date numbers as inputs, but they are not recommended.
If you use date characters vector or strings, the format must be
recognizable by datetime because
the Maturity property is stored as a
datetime.
Leg rate in decimal values, specified as
LegRate and a
NINST-by-2 matrix. Each
row can be defined as one of the following:
[CouponRate Spread](fixed-float)[Spread CouponRate](float-fixed)[CouponRate CouponRate](fixed-fixed)[Spread Spread](float-float)
CouponRate is the decimal annual rate.
Spread is the number of basis points in
decimals over the reference rate. The first column represents the
receiving leg, while the second column represents the paying
leg.
Data Types: double
Optional OvernightIndexedSwap Name-Value Arguments
OvernightIndexedSwap leg type, specified as
LegType and a cell array of character vectors
or a string array with the supported values. The
LegType defines the interpretation of the
values entered in LegRate.
Data Types: cell | string
Rate curve for projecting floating cash flows, specified as
ProjectionCurve and a scalar
ratecurve object or an
NINST-by-1 vector of
ratecurve objects. You must create this
object using ratecurve. Use
this optional input if the forward curve is different from the
discount curve.
Data Types: object
Frequency of payments per year, specified as
Reset and a scalar or a
NINST-by-2 matrix if
Reset is different for each leg) with one of
the following values: 0, 1,
2, 3,
4, 6, or
12.
Data Types: double
Day count basis representing the basis for each leg, specified as
Basis and a
NINST-by-1 matrix (or
NINST-by-2 matrix if
Basis is different for each leg).
0 — actual/actual
1 — 30/360 (SIA)
2 — actual/360
3 — actual/365
4 — 30/360 (PSA)
5 — 30/360 (ISDA)
6 — 30/360 (European)
7 — actual/365 (Japanese)
8 — actual/actual (ICMA)
9 — actual/360 (ICMA)
10 — actual/365 (ICMA)
11 — 30/360E (ICMA)
12 — actual/365 (ISDA)
13 — BUS/252
For more information, see Basis.
Data Types: double
Notional principal amount, specified as
Notional and a scalar numeric or an
NINST-by-1 numeric
vector.
Notional accepts a scalar for a principal
amount (or a NINST-by-2 matrix
if Notional is different for each leg).
Data Types: double
Historical fixing data, specified as
HistoricalFixing and a timetable.
Note
If you are creating one or more
OvernightIndexedSwap instruments and use
a timetable, the timetable specification applies to all of the
OvernightIndexedSwap instruments.
HistoricalFixing does not accept an
NINST-by-1 cell array
of timetables as input.
Data Types: timetable
Lag in rate setting, specified as ResetOffset
and a NINST-by-2
matrix.
Data Types: double
Since R2024a
Lag in payment, specified as an
NINST-by-2 matrix.
Data Types: double
Business day conventions, specified as
BusinessDayConvention and string (or
NINST-by-2 string array if
BusinessDayConvention is different for each
leg) or a character vector (or
NINST-by-2 cell array of
character vectors if BusinessDayConvention is
different for each leg). The selection for business day convention
determines how nonbusiness days are treated. Nonbusiness days are
defined as weekends plus any other date that businesses are not open
(for example, statutory holidays). Values are:
"actual"— Nonbusiness days are effectively ignored. Cash flows that fall on nonbusiness days are assumed to be distributed on the actual date."follow"— Cash flows that fall on a nonbusiness day are assumed to be distributed on the following business day."modifiedfollow"— Cash flows that fall on a nonbusiness day are assumed to be distributed on the following business day. However, if the following business day is in a different month, the previous business day is adopted instead."previous"— Cash flows that fall on a nonbusiness day are assumed to be distributed on the previous business day."modifiedprevious"— Cash flows that fall on a nonbusiness day are assumed to be distributed on the previous business day. However, if the previous business day is in a different month, the following business day is adopted instead.
Data Types: char | cell | string
Holidays used in computing business days, specified as
Holidays and dates using an
NINST-by-1 vector of a
datetime array, string array, or date character vectors. For
example:
H = holidays(datetime('today'),datetime(2025,12,15)); OvernightIndexedSwapInst = fininstrument("OvernightIndexedSwap",Maturity=datetime(2025,12,15),LegRate=[0.06 20],Holidays=H)
To support existing code, OvernightIndexedSwap also
accepts serial date numbers as inputs, but they are not recommended.
End-of-month rule flag for generating dates when
Maturity is an end-of-month date for a month
with 30 or fewer days, specified as EndMonthRule
and a logical value of true or
false using a
NINST-by-1 matrix (or
NINST-by-2 matrix if
EndMonthRule is different for each leg).
If you set
EndMonthRuletofalse, the software ignores the rule, meaning that a payment date is always the same numerical day of the month.If you set
EndMonthRuletotrue, the software sets the rule on, meaning that a payment date is always the last actual day of the month.
Data Types: logical
Since R2024a
Flag to adjust cash flows based on actual period day count,
specified as DaycountAdjustedCashFlow and a
NINST-by-1 matrix (or
NINST-by-2 matrix if
DaycountAdjustedCashFlow is different for
each leg) of logicals with values of true or
false.
Data Types: logical
Date OvernightIndexedSwap starts payments,
specified as StartDate and a scalar or an
NINST-by-1 vector using a
datetime array, string array, or date character vectors.
To support existing code, OvernightIndexedSwap also
accepts serial date numbers as inputs, but they are not recommended.
Use StartDate to price a forward
OvernightIndexedSwap, that is, an
OvernightIndexedSwap that starts at a future
date.
If you use a date character vector or string, the format must be
recognizable by datetime because
the StartDate property is stored as a
datetime.
User-defined name for the instrument, specified as
Name and a scalar string or character vector
or an NINST-by-1 cell array of
character vectors or string array.
Data Types: char | cell | string
Output Arguments
Overnight Indexed Swap instrument, returned as an
OvernightIndexedSwap object.
Properties
Maturity date, returned as a scalar datetime or an
NINST-by-1 vector of
datetimes.
Data Types: datetime
Leg rate, returned as a NINST-by-2
matrix of decimal values, with each row defined as one of the following:
[CouponRate Spread](fixed-float)[Spread CouponRate](float-fixed)[CouponRate CouponRate](fixed-fixed)[Spread Spread](float-float)
Data Types: double
Leg type, returned as a string array with the values
["fixed","fixed"],
["fixed","float"],
["float","fixed"], or
["float","float"].
Data Types: string
Rate curve used in projecting the future cash flows, returned as a
ratecurve object or an
NINST-by-1 vector of
ratecurve objects.
Data Types: object
Reset frequency per year for each swap, returned as an
1-by-2 matrix.
Data Types: double
Day count basis, returned as an
1-by-2 matrix.
Data Types: double
Lag in rate setting, returned as an
NINST-by-2 matrix.
Data Types: double
Since R2024a
Lag in payment, returned as an
NINST-by-2 matrix.
Data Types: double
Notional principal amount, returned as a scalar numeric or an
NINST-by-1 numeric vector.
Data Types: double
Historical fixing data, returned as a timetable.
Data Types: timetable
Business day conventions, returned as a string or a
NINST-by-2 string array if
BusinessDayConvention is different for each
leg.
Data Types: char | cell | string
Holidays used in computing business days, returned as an
NINST-by-1 vector of
datetimes.
Data Types: datetime
End-of-month rule flag for generating dates when
Maturity is an end-of-month date for a month with 30
or fewer days, returned as an
NINST-by-1 matrix (or
NINST-by-2 matrix if
EndMonthRule is different for each leg).
Data Types: logical
Since R2024a
Flag to adjust cash flows based on actual period day count, returned as an
NINST-by-1 matrix (or an
NINST-by-2 matrix if
DaycountAdjustedCashFlow is different for each leg)
of logicals with values of true or
false.
Data Types: logical
Date OvernightIndexedSwap starts payments, returned as
a scalar datetime or an NINST-by-1
vector of datetimes.
Data Types: datetime
User-defined name for the instrument, returned as a scalar string or an
NINST-by-1 string array.
Data Types: string
Object Functions
cashflows | Compute cash flow for FixedBond, FloatBond,
Swap, FRA, STIRFuture,
OISFuture, OvernightIndexedSwap, or
Deposit instrument |
parswaprate | Compute par swap rate for Swap and
OvernightIndexedSwap instrument |
Examples
This example shows the workflow to price an OvernightIndexedSwap instrument when you use a ratecurve object and a Discount pricing method.
Create ratecurve Object
Create a ratecurve object using ratecurve for the underlying interest-rate curve for the OvernightIndexedSwap instrument.
Settle = datetime(2019,9,15); Type = 'zero'; ZeroTimes = [calmonths(6) calyears([1 2 3 4 5 7 10 20 30])]'; ZeroRates = [0.0052 0.0055 0.0061 0.0073 0.0094 0.0119 0.0168 0.0222 0.0293 0.0307]'; ZeroDates = Settle + ZeroTimes; myRC = ratecurve('zero',Settle,ZeroDates,ZeroRates)
myRC =
ratecurve with properties:
Type: "zero"
Compounding: -1
Basis: 0
Dates: [10×1 datetime]
Rates: [10×1 double]
Settle: 15-Sep-2019
InterpMethod: "linear"
ShortExtrapMethod: "next"
LongExtrapMethod: "previous"
Create OvernightIndexedSwap Instrument Object
Use fininstrument to create an OvernightIndexedSwap instrument object.
OvernightIndexedSwap = fininstrument("OvernightIndexedSwap",Maturity=datetime(2022,9,15),LegRate=[0.022 0.019 ],LegType=["float","fixed"],Notional=100,ProjectionCurve=myRC,Name="overnight_swap_instrument")
OvernightIndexedSwap =
OvernightIndexedSwap with properties:
LegRate: [0.0220 0.0190]
LegType: ["float" "fixed"]
Reset: [2 2]
Basis: [0 0]
Notional: 100
HistoricalFixing: [0×0 timetable]
ResetOffset: [0 0]
PaymentDelay: 0
ProjectionCurve: [1×1 ratecurve]
BusinessDayConvention: ["actual" "actual"]
Holidays: NaT
EndMonthRule: [1 1]
DaycountAdjustedCashFlow: [0 0]
StartDate: NaT
Maturity: 15-Sep-2022
Name: "overnight_swap_instrument"
Create Discount Pricer Object
Use finpricer to create a Discount pricer object and use the ratecurve object for the 'DiscountCurve' name-value pair argument.
outPricer = finpricer("Discount",DiscountCurve=myRC)outPricer =
Discount with properties:
DiscountCurve: [1×1 ratecurve]
Price OvernightIndexedSwap Instrument
Use price to compute the price and sensitivities for the OvernightIndexedSwap instrument.
[Price, outPR] = price(outPricer,OvernightIndexedSwap,["all"])Price = 3.0797
outPR =
priceresult with properties:
Results: [1×2 table]
PricerData: []
outPR.Results
ans=1×2 table
Price DV01
______ _________
3.0797 -0.029334
Since R2024a
This example shows the workflow to price an OvernightIndexedSwap instrument when you use a ratecurve object and a Discount pricing method and then use parswaprate to compute the par swap rate.
Create ratecurve Object
Create a ratecurve object using ratecurve for the underlying interest-rate curve for the OvernightIndexedSwap instrument.
Settle = datetime(2019,9,15); Type = 'zero'; ZeroTimes = [calmonths(6) calyears([1 2 3 4 5 7 10 20 30])]'; ZeroRates = [0.0052 0.0055 0.0061 0.0073 0.0094 0.0119 0.0168 0.0222 0.0293 0.0307]'; ZeroDates = Settle + ZeroTimes; myRC = ratecurve('zero',Settle,ZeroDates,ZeroRates)
myRC =
ratecurve with properties:
Type: "zero"
Compounding: -1
Basis: 0
Dates: [10×1 datetime]
Rates: [10×1 double]
Settle: 15-Sep-2019
InterpMethod: "linear"
ShortExtrapMethod: "next"
LongExtrapMethod: "previous"
Create OvernightIndexedSwap Instrument Object
Use fininstrument to create an OvernightIndexedSwap instrument object.
OvernightIndexedSwap = fininstrument("OvernightIndexedSwap",Maturity=datetime(2022,9,15),LegRate=[0.022 0.019 ],LegType=["float","fixed"],Notional=100,ProjectionCurve=myRC,Name="overnight_swap_instrument")
OvernightIndexedSwap =
OvernightIndexedSwap with properties:
LegRate: [0.0220 0.0190]
LegType: ["float" "fixed"]
Reset: [2 2]
Basis: [0 0]
Notional: 100
HistoricalFixing: [0×0 timetable]
ResetOffset: [0 0]
PaymentDelay: 0
ProjectionCurve: [1×1 ratecurve]
BusinessDayConvention: ["actual" "actual"]
Holidays: NaT
EndMonthRule: [1 1]
DaycountAdjustedCashFlow: [0 0]
StartDate: NaT
Maturity: 15-Sep-2022
Name: "overnight_swap_instrument"
Create Discount Pricer Object
Use finpricer to create a Discount pricer object and use the ratecurve object for the 'DiscountCurve' name-value pair argument.
outPricer = finpricer("Discount",DiscountCurve=myRC)outPricer =
Discount with properties:
DiscountCurve: [1×1 ratecurve]
Price OvernightIndexedSwap Instrument
Use price to compute the price and sensitivities for the OvernightIndexedSwap instrument.
[Price, outPR] = price(outPricer,OvernightIndexedSwap,"all")Price = 3.0797
outPR =
priceresult with properties:
Results: [1×2 table]
PricerData: []
outPR.Results
ans=1×2 table
Price DV01
______ _________
3.0797 -0.029334
Compute Par Swap Rate
Use parswaprate to compute the par swap rate for the OvernightIndexedSwap instrument. The par swap rate is the rate that renders a swap value equal to zero.
outRate = parswaprate(OvernightIndexedSwap,myRC)
outRate = 0.0294
This example shows the workflow to price multiple OvernightIndexedSwap instruments when you use a ratecurve object and a Discount pricing method.
Create ratecurve Object
Create a ratecurve object using ratecurve for the underlying interest-rate curve for the OvernightIndexedSwap instrument.
Settle = datetime(2020,9,15); Type = 'zero'; ZeroTimes = [calmonths(6) calyears([1 2 3 4 5 7 10 20 30])]'; ZeroRates = [0.0052 0.0055 0.0061 0.0073 0.0094 0.0119 0.0168 0.0222 0.0293 0.0307]'; ZeroDates = Settle + ZeroTimes; myRC = ratecurve('zero',Settle,ZeroDates,ZeroRates)
myRC =
ratecurve with properties:
Type: "zero"
Compounding: -1
Basis: 0
Dates: [10×1 datetime]
Rates: [10×1 double]
Settle: 15-Sep-2020
InterpMethod: "linear"
ShortExtrapMethod: "next"
LongExtrapMethod: "previous"
Create OvernightIndexedSwap Instrument Object
Use fininstrument to create an OvernightIndexedSwap instrument object for three Overnight Indexed Swap instruments.
OvernightIndexedSwap = fininstrument("OvernightIndexedSwap",Maturity=datetime([2022,9,15 ; 2023,9,15 ; 2024,9,15]),LegRate=[0 0.01],LegType=["float","fixed"],Notional=[100 ; 90; 80],ProjectionCurve=myRC,Name="overnight_swap_instrument")
OvernightIndexedSwap=3×1 OvernightIndexedSwap array with properties:
LegRate
LegType
Reset
Basis
Notional
HistoricalFixing
ResetOffset
PaymentDelay
ProjectionCurve
BusinessDayConvention
Holidays
EndMonthRule
DaycountAdjustedCashFlow
StartDate
Maturity
Name
Create Discount Pricer Object
Use finpricer to create a Discount pricer object and use the ratecurve object for the 'DiscountCurve' name-value pair argument.
outPricer = finpricer("Discount",DiscountCurve=myRC)outPricer =
Discount with properties:
DiscountCurve: [1×1 ratecurve]
Price OvernightIndexedSwap Instruments
Use price to compute the prices for the OvernightIndexedSwap instruments.
Price = price(outPricer,OvernightIndexedSwap)
Price = 3×1
-0.7735
-0.7198
-0.2021
More About
An Overnight Indexed Swap (OIS) is an interest-rate swap where the periodic floating payment is based on a return from a daily compound interest investment.
The OIS involves exchanging the overnight rate for a fixed interest rate. The overnight rate index, such as the federal funds rate, is the underlying rate for the floating leg, while the fixed leg is agreed upon by both parties. Used for short-term interest rate hedging or speculation, an OIS involves a fixed-rate payer and a floating-rate payer who enter a contract specifying the notional amount and maturity. The floating-rate payer's payment, based on the overnight rate index, is calculated daily, while the fixed-rate payer's payment remains constant. Net settlement occurs periodically, typically monthly or quarterly.
To support the LIBOR transition, the OIS instrument supports
the adoption of alternative reference rates (ARR) like SOFR, EONIA, SONIA, SARON,
and TONAR. The ARRs replace the LIBOR benchmark, which underpins many loans,
mortgages, bonds, and interest-rate derivatives. When discussing LIBOR fallback in
the context of an OIS instrument, it refers to the transition
from using LIBOR as the reference rate for the floating leg of interest rate swaps,
including OIS instruments, to using an ARR. Since and
OIS instrument already uses a risk-free overnight rate for
the floating leg, the main concern with LIBOR fallback in an OIS
instrument is related to the fixed leg of the swaps that might have been benchmarked
against LIBOR. For an example, see Compute LIBOR Fallback.
Version History
Introduced in R2021bOvernightIndexedSwap instruments support name-value arguments
for PaymentDelay and
DaycountAdjustedCashFlow.
OvernightIndexedSwap instruments support an object function for
parswaprate.
Although OvernightIndexedSwap supports serial date numbers,
datetime values are recommended instead. The
datetime data type provides flexible date and time
formats, storage out to nanosecond precision, and properties to account for time
zones and daylight saving time.
To convert serial date numbers or text to datetime values, use the datetime function. For example:
t = datetime(738427.656845093,"ConvertFrom","datenum"); y = year(t)
y =
2021
There are no plans to remove support for serial date number inputs.
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Seleccione un país/idioma
Seleccione un país/idioma para obtener contenido traducido, si está disponible, y ver eventos y ofertas de productos y servicios locales. Según su ubicación geográfica, recomendamos que seleccione: .
También puede seleccionar uno de estos países/idiomas:
Cómo obtener el mejor rendimiento
Seleccione China (en idioma chino o inglés) para obtener el mejor rendimiento. Los sitios web de otros países no están optimizados para ser accedidos desde su ubicación geográfica.
América
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)