Main Content

Deposit

Deposit instrument object

Since R2020a

Description

Create and price a Deposit instrument object for one or more Deposit instruments using this workflow:

  1. Use fininstrument to create a Deposit instrument object for one or more Deposit instruments.

  2. Use ratecurve to specify an interest-rate model for the Deposit instrument object.

  3. Use finpricer to specify a Discount pricing method for one or more Deposit instruments.

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 Deposit instrument, see Choose Instruments, Models, and Pricers.

Creation

Description

DepositObj = fininstrument(InstrumentType,'Maturity',maturity_date,'Rate',rate_value) creates a Deposit object for one or more Deposit instruments by specifying InstrumentType and sets the properties for the required name-value pair arguments Maturity and Rate.

example

DepositObj = fininstrument(___,Name,Value) sets optional properties using additional name-value pairs in addition to the required arguments in the previous syntax. For example, DepositObj = fininstrument("Deposit",'Maturity',datetime(2019,1,30),'Rate',0.027,'Period',2,'Basis',1,'Principal',100,'BusinessDayConvention',"follow",'Name',"deposit_instrument") creates a Deposit instrument with an interest rate of .027 and a maturity of January 30, 2019. You can specify multiple name-value pair arguments.

example

Input Arguments

expand all

Instrument type, specified as a string with the value of "Deposit", a character vector with the value of 'Deposit', an NINST-by-1 string array with values of "Deposit", or an NINST-by-1 cell array of character vectors with values of 'Deposit'.

Data Types: char | 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.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: DepositObj = fininstrument("Deposit",'Maturity',datetime(2019,1,30),'Rate',0.027,'Period',2,'Basis',1,'Principal',100,'BusinessDayConvention',"follow",'Name',"deposit_instrument")

Required Deposit Name-Value Pair Arguments

expand all

Maturity date, specified as the comma-separated pair consisting of 'Maturity' and a scalar or an NINST-by-1 vector using a datetime array, string array, or date character vectors.

To support existing code, Deposit also accepts serial date numbers as inputs, but they are not recommended.

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

Deposit interest rate, specified as the comma-separated pair consisting of 'Rate' and a scalar decimal or an NINST-by-1 vector of decimals.

Data Types: double

Optional Deposit Name-Value Pair Arguments

expand all

Frequency of payments per year, specified as the comma-separated pair consisting of 'Period' and scalar integer or an NINST-by-1 vector of integers. Values for Period are: 0, 1, 2, 3, 4, 6, or 12.

Data Types: double

Day count basis, specified as the comma-separated pair consisting of 'Basis' and a scalar integer or an NINST-by-1 vector of integers using the following values:

  • 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

Principal amount, specified as the comma-separated pair consisting of 'Principal' and a scalar numeric or an NINST-by-1 numeric vector.

Data Types: double

Business day convention, specified as the comma-separated pair consisting of 'BusinessDayConvention' and a string or character vector or an NINST-by-1 cell array of character vectors or string array. 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 the comma-separated pair consisting of '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));
DepositObj = fininstrument("deposit",'Maturity',datetime(2025,12,15),'Rate',0.027,'Holidays',H)

To support existing code, Deposit also accepts serial date numbers as inputs, but they are not recommended.

User-defined name for one of more instruments, specified as the comma-separated pair consisting of '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

Properties

expand all

Maturity date, returned as a scalar datetime or an NINST-by-1 vector of datetimes.

Data Types: datetime

Deposit interest rate, returned as a scalar decimal or an NINST-by-1 vector of decimals.

Data Types: double

Frequency of payments per year, returned as a scalar integer or an NINST-by-1 vector of integers.

Data Types: double

Day count basis, returned as a scalar integer or an NINST-by-1 vector of integers.

Data Types: double

Principal amount, returned as a scalar numeric or an NINST-by-1 numeric vector.

Data Types: double

Business day convention, returned as a scalar string or an NINST-by-1 string array.

Data Types: string

Holidays used in computing business days, returned as 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

cashflowsCompute cash flow for FixedBond, FloatBond, Swap, FRA, STIRFuture, OISFuture, OvernightIndexedSwap, or Deposit instrument

Examples

collapse all

This example shows the workflow to price a Deposit instrument when using a ratecurve and a Discount pricing method.

Create Deposit Instrument Object

Use fininstrument to create a Deposit instrument object.

DepositObj = fininstrument("Deposit",'Maturity',datetime(2019,3,15),'Rate',0.0195,'Period',2,'Basis',1,'Principal',100,'Name',"deposit_instrument")
DepositObj = 
  Deposit with properties:

                     Rate: 0.0195
                   Period: 2
                    Basis: 1
                 Maturity: 15-Mar-2019
                Principal: 100
    BusinessDayConvention: "actual"
                 Holidays: NaT
                     Name: "deposit_instrument"

Create ratecurve Object

Create a ratecurve object using ratecurve.

Settle = datetime(2018,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: [10x1 datetime]
                Rates: [10x1 double]
               Settle: 15-Sep-2018
         InterpMethod: "linear"
    ShortExtrapMethod: "next"
     LongExtrapMethod: "previous"

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: [1x1 ratecurve]

Price Deposit Instrument

Use price to compute the price and sensitivities for the Deposit instrument.

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

       Results: [1x2 table]
    PricerData: []

outPR.Results
ans=1×2 table
     Price        DV01   
    _______    __________

    0.97249    4.8225e-05

This example shows the workflow to price multiple Deposit instruments when using a ratecurve and a Discount pricing method.

Create Deposit Instrument Object

Use fininstrument to create a Deposit instrument object for three Deposit instruments.

DepositObj = fininstrument("Deposit",'Maturity',datetime([2019,3,15 ; 2019,4,15 ; 2019,5,15]),'Rate',0.0195,'Period',2,'Basis',1,'Principal',[1000 ; 2000 ; 3000],'Name',"deposit_instrument")
DepositObj=3×1 Deposit array with properties:
    Rate
    Period
    Basis
    Maturity
    Principal
    BusinessDayConvention
    Holidays
    Name

Create ratecurve Object

Create a ratecurve object using ratecurve.

Settle = datetime(2018,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: [10x1 datetime]
                Rates: [10x1 double]
               Settle: 15-Sep-2018
         InterpMethod: "linear"
    ShortExtrapMethod: "next"
     LongExtrapMethod: "previous"

Create Discount Pricer Object

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

outPricer = finpricer("Discount", 'DiscountCurve',myRC)
outPricer = 
  Discount with properties:

    DiscountCurve: [1x1 ratecurve]

Price Deposit Instruments

Use price to compute the prices and sensitivities for the Deposit instruments.

[Price, outPR] = price(outPricer, DepositObj,["all"])
Price = 3×1

    9.7249
   22.6807
   38.8632

outPR=1×3 priceresult array with properties:
    Results
    PricerData

outPR.Results
ans=1×2 table
    Price        DV01   
    ______    __________

    9.7249    0.00048225

ans=1×2 table
    Price       DV01   
    ______    _________

    22.681    0.0013173

ans=1×2 table
    Price       DV01   
    ______    _________

    38.863    0.0025767

More About

expand all

Version History

Introduced in R2020a

expand all