Main Content

VarianceSwap

VarianceSwap instrument object

Description

Create and price a VarianceSwap instrument object using this workflow:

  1. Use fininstrument to create a VarianceSwap instrument object.

  2. Use ratecurve to specify a curve model or use finmodel to specify a Heston model.

  3. When using a curve model, use finpricer to specify a ReplicatingVarianceSwap pricing method for the VarianceSwap instrument.

    When using a Heston model, use finpricer to specify a Heston pricing method for the VarianceSwap instrument.

For more information on this workflow, see Get Started with Workflows Using Object-Based Framework for Pricing Financial Instruments.

For more information on the available models and pricing methods for a VarianceSwap instrument, see Choose Instruments, Models, and Pricers.

Creation

Description

example

VarianceSwapInstrument = fininstrument(InstrumentType,'Maturity',maturity_date,'Notional',notional_value) creates a VarianceSwap object by specifying InstrumentType and sets properties using the required name-value pair arguments Maturity and Notional.

The VarianceSwap instrument supports the ReplicatingVarianceSwap and Heston pricing methods. For more information on the VarianceSwap instrument, see More About.

example

VarianceSwapInstrument = fininstrument(___,Name,Value) sets optional properties using additional name-value pair arguments in addition to the required arguments in the previous syntax. For example, VarianceSwapInstrument = fininstrument("VarianceSwap",'Maturity',datetime(2019,1,30),'Notional',100,'StartDate',datetime(2016,1,30),'RealizedVariance',0.02,'Strike',110,'Name',"varianceswap_instrument") creates a VarianceSwap option with a maturity date of January 30, 2019. You can specify multiple name-value pair arguments.

Input Arguments

expand all

Instrument type, specified as a string with the value of "VarianceSwap" or a character vector with the value of 'VarianceSwap'.

Data Types: char | string

VarianceSwap Name-Value Pair Arguments

Specify required and optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: VarianceSwapInstrument = fininstrument("VarianceSwap",'Maturity',datetime(2019,1,30),'Notional',100,'StartDate',datetime(2016,1,30),'RealizedVariance',0.02,'Strike',110,'Name',"varianceswap_instrument")
Required VarianceSwap Name-Value Pair Arguments

expand all

Variance swap maturity date, specified as the comma-separated pair consisting of 'Maturity' and a scalar datetime, serial date number, date character vector, or date string.

If you use a date character vector or date string, the format must be recognizable by datetime because the Maturity property is stored as a datetime.

Data Types: char | double | string | datetime

Notional amount, specified as the comma-separated pair consisting of 'Notional' and a scalar numeric.

Data Types: double

Optional VarianceSwap Name-Value Pair Arguments

expand all

Start date, specified as the comma-separated pair consisting of 'StartDate' and a scalar datetime, serial date number, date character vector, or date string.

If you use a date character vector or date string, the format must be recognizable by datetime because the ExerciseDate property is stored as a datetime.

Data Types: double | char | string | datetime

Realized variance, specified as the comma-separated pair consisting of 'RealizedVariance' and a scalar decimal.

Data Types: double

Strike variance, specified as the comma-separated pair consisting of 'Strike' and a scalar decimal.

Data Types: double

User-defined name for the instrument, specified as the comma-separated pair consisting of 'Name' and a scalar string or character vector.

Data Types: char | string

Properties

expand all

Maturity date, returned as a datetime.

Data Types: datetime

Notional amount, returned as a scalar numeric.

Data Types: double

Start date, returned as a datetime.

Data Types: double | char | string | datetime

Realized variance, returned as a scalar decimal.

Data Types: double

Strike variance, returned as a scalar decimal.

Data Types: double

User-defined name for the instrument, returned as a string.

Data Types: string

Object Functions

Examples

collapse all

This example shows the workflow to price a VarianceSwap instrument when you use a Heston model and a Heston pricing method.

Create VarianceSwap Instrument Object

Use fininstrument to create a VarianceSwap instrument object.

VarianceSwapInst = fininstrument("VarianceSwap",'Maturity',datetime(2020,9,15),'Notional',100,'StartDate',datetime(2020,6,15),'RealizedVariance',0.02,'Strike',0.05,'Name',"variance_swap_instrument")
VarianceSwapInst = 
  VarianceSwap with properties:

            Notional: 100
    RealizedVariance: 0.0200
              Strike: 0.0500
           StartDate: 15-Jun-2020
            Maturity: 15-Sep-2020
                Name: "variance_swap_instrument"

Create Heston Model Object

Use finmodel to create a Heston model object.

HestonModel = finmodel("Heston",'V0',0.06,'ThetaV',0.1,'Kappa',0.9,'SigmaV',0.7,'RhoSV',-.3)
HestonModel = 
  Heston with properties:

        V0: 0.0600
    ThetaV: 0.1000
     Kappa: 0.9000
    SigmaV: 0.7000
     RhoSV: -0.3000

Create ratecurve Object

Create a flat ratecurve object using ratecurve.

Settle = datetime(2020, 1, 1);
ZeroTimes = calmonths(3);
ZeroRates = 0.05;
ZeroDates = Settle + ZeroTimes;
Basis = 1;
ZeroCurve = ratecurve("zero",Settle,ZeroDates,ZeroRates,'Basis',Basis)
ZeroCurve = 
  ratecurve with properties:

                 Type: "zero"
          Compounding: -1
                Basis: 1
                Dates: 01-Apr-2020
                Rates: 0.0500
               Settle: 01-Jan-2020
         InterpMethod: "linear"
    ShortExtrapMethod: "next"
     LongExtrapMethod: "previous"

Create Heston Pricer Object

Use finpricer to create a Heston pricer object and use the ratecurve object for the 'DiscountCurve' name-value pair argument.

outPricer = finpricer("Analytic",'DiscountCurve',ZeroCurve,'Model',HestonModel)
outPricer = 
  Heston with properties:

    DiscountCurve: [1x1 ratecurve]
            Model: [1x1 finmodel.Heston]

Price VarianceSwap Instrument

Use price to compute the price and fair variance for the VarianceSwap instrument.

[Price, outPR] = price(outPricer,VarianceSwapInst,["all"])
Price = 10.8321
outPR = 
  priceresult with properties:

       Results: [1x2 table]
    PricerData: []

outPR.Results
ans=1×2 table
    Price     FairVariance
    ______    ____________

    10.832      0.07039   

This example shows the workflow to price a VarianceSwap instrument when you use a ratecurve object and a ReplicatingVarianceSwap pricing method.

Create VarianceSwap Instrument Object

Use fininstrument to create a VarianceSwap instrument object.

VarianceSwapInst = fininstrument("VarianceSwap",'Maturity',datetime(2021,5,1),'Notional',150,'StartDate',datetime(2020,5,1),'RealizedVariance',0.05,'Strike',0.1,'Name',"variance_swap_instrument")
VarianceSwapInst = 
  VarianceSwap with properties:

            Notional: 150
    RealizedVariance: 0.0500
              Strike: 0.1000
           StartDate: 01-May-2020
            Maturity: 01-May-2021
                Name: "variance_swap_instrument"

Create ratecurve Object

Create a flat ratecurve object using ratecurve.

Settle = datetime(2020, 9, 15);
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;
Basis = 1;
ZeroCurve = ratecurve("zero",Settle,ZeroDates,ZeroRates,'Basis',Basis)
ZeroCurve = 
  ratecurve with properties:

                 Type: "zero"
          Compounding: -1
                Basis: 1
                Dates: [10x1 datetime]
                Rates: [10x1 double]
               Settle: 15-Sep-2020
         InterpMethod: "linear"
    ShortExtrapMethod: "next"
     LongExtrapMethod: "previous"

Create ReplicatingVarianceSwap Pricer Object

Use finpricer to create a ReplicatingVarianceSwap pricer object and use the ratecurve object for the 'DiscountCurve' name-value pair argument.

Strike = (50:5:135)';
Volatility = [.49;.45;.42;.38;.34;.31;.28;.25;.23;.21;.2;.21;.21;.22;.23;.24;.25;.26];
VolatilitySmile = table(Strike, Volatility);
SpotPrice = 100;
CallPutBoundary = 100;

outPricer =  finpricer("ReplicatingVarianceSwap",'DiscountCurve', ZeroCurve, 'VolatilitySmile', VolatilitySmile, ...
'SpotPrice', SpotPrice, 'CallPutBoundary', CallPutBoundary)
outPricer = 
  ReplicatingVarianceSwap with properties:

      DiscountCurve: [1x1 ratecurve]
       InterpMethod: "linear"
    VolatilitySmile: [18x2 table]
          SpotPrice: 100
    CallPutBoundary: 100

Price VarianceSwap Instrument

Use price to compute the price and fair variance for the VarianceSwap instrument.

[Price, outPR] = price(outPricer,VarianceSwapInst,["all"])
Price = 8.1997
outPR = 
  priceresult with properties:

       Results: [1x2 table]
    PricerData: [1x1 struct]

outPR.Results
ans=1×2 table
    Price     FairVariance
    ______    ____________

    8.1997      0.21701   

More About

expand all

Introduced in R2020b