bondOutrightRepoPricer

First introduced in version 3.00.6

Syntax

bondOutrightRepoPricer(instrument, pricingDate, discountCurve)

Details

Prices bond outright repos.

Parameters

instrument is an INSTRUMENT scalar or vector that specifies the bond repo to price. For field requirements, see the product field description.

pricingDate is a DATE scalar or vector that specifies the pricing date.

discountCurve is a MKTDATA scalar or vector that specifies the spot curve (IrYieldCurve) used to calculate discount factors.

Returns

DOUBLE scalar or vector, indicating the net present value (NPV) of the repo.

Examples

This example constructs a repo contract based on a fixed-rate bond and prices its cash flows by discounting them using the specified yield curve, ultimately obtaining the trade's theoretical value on the valuation date.

// =====================================================
// 1. Construct the underlying bond
// =====================================================
bond = {
    "productType": "Cash",
    "assetType": "Bond",
    "bondType": "FixedRateBond",
    "instrumentId": "220010.IB",
 // Interest accrual start date
    "start": 2022.06.16,
 // Maturity date
    "maturity": 2032.06.16,
    "issuePrice": 100.0,
    "coupon": 0.0276,
    "frequency": "Semiannual",
    "dayCountConvention": "Actual360"
}
// =====================================================
// 2. Construct the bond outright repo
// =====================================================
bondOutrightRepo =  {
    "productType": "Cash",
    "assetType": "Repo",
    "repoType":"BondOutrightRepo",
    "notionalCurrency": "CNY",
    "notionalAmount": 1E6,
    "start": 2025.05.15,
    "maturity": 2025.08.15,
    "rate": 0.02,
    "dayCountConvention": "Actual360",
    "payReceive": "Receive",
    "underlying":bond
}
// =====================================================
// 3. Parse into the outright repo instrument
// =====================================================
instrument = parseInstrument(bondOutrightRepo)
// =====================================================
// 4. Set the pricing date
// =====================================================
pricingDate = 2025.06.10
// =====================================================
// 5. Construct the discounted zero-coupon discount curve
// =====================================================
curve_dict = {
    "mktDataType": "Curve",
    "curveType": "IrYieldCurve",
    "referenceDate": pricingDate,
    "currency": "CNY",
    "dayCountConvention": "Actual365",
    "compounding": "Continuous", 
    "interpMethod": "Linear",
    "extrapMethod": "Flat",
    "frequency": "Annual",
    // Curve tenor node dates
    "dates":[
        2025.06.25,
        2025.07.25,
        2025.09.25,
        2025.12.25,
        2026.06.25,
        2027.06.25,
        2030.06.25
    ],
    // Continuously compounded zero rates at each tenor node on the curve
    "values":[
        0.0136,
        0.0138,
        0.0142,
        0.0148,
        0.0154,
        0.0167,
        0.0182
    ]
}
// =====================================================
// 6. Parse into the discount curve
// =====================================================
discountCurve = parseMktData(curve_dict)
// =====================================================
// 7. Call the bond outright repo pricer
// =====================================================
price = bondOutrightRepoPricer(
    instrument,
    2025.06.10,
    discountCurve
)
// =====================================================
// 8. Output pricing results
// =====================================================
print(price)

Related functions: parseInstrument and parseMktData

Product Field Description

Field Name Type Description Required
productType STRING Must be "Cash". Yes
assetType STRING Must be "Repo". Yes
repoType STRING Must be "BondOutrightRepo". Yes
notionalAmount DOUBLE Notional amount Yes
notionalCurrency STRING Notional currency, defaults to "CNY" No
instrumentId STRING User-defined unique identifier, such as "repo000002" No
start DATE Interest start date Yes
maturity DATE Maturity date Yes
rate DOUBLE Repo rate Yes
payReceive STRING Payment/receipt indicator; "Pay" indicates the repo side, and "Receive" indicates the reverse repo side Yes
underlying DICT/INSTRUMENT Basic information about the pledged bonds Yes
dayCountConvention STRING Day count convention. Valid values are "ActualActualISDA", "ActualActualISMA", "Actual365", and "Actual360". Yes
discountCurve STRING Name of the discount curve used as a pricing reference; for CNY deposits, the default is "CNY_FR_007". No