BooleanRelevant for most cash flow generating instruments, i.e., bond, floater, swap, swaption, callable_bond
If true, interest is calculated on adjusted coupon periods, i.e., from start and end of each accrual period after adjustment according to bdc and calendar attributes. Refer cash flow generation for details.
StringJSON Risk recognizes unadjusted, following, modified following, preceding. For convenience, JSON Risk interprets only the first letter and ignores case. For example, for m and M, JSON Risk assumes the modified folling business day convention.
Relevant for most cash flow generating instruments, i.e., bond, floater, swap, swaption, callable_bond
This field determines how dates generated within schedule generation are adjusted, dependent on the field calendar. Refer to cash flow generation for details.
StringContains the string target, case insensitive, or the identifier of any calendar previously registered using the library.add_calendar functionality.
Relevant for most cash flow generating instruments, i.e., bond, floater, swap, swaption, callable_bond
Reference to the calendar used to adjust dates generated within cash flow generation.
NaturalAny positive integer.
Relevant for callable_bond
The exercise dates for the instrument type callable_bond are determined by the attribute first_exercise_date which represents the first date the bond can be called, and the attribute call_tenor.
If call_tenoris not zero, the bond is callable on the date represented by first_exercise_date and every call_tenor months after that date. If call_tenoris zero, the bond is callable on the date represented by first_exercise_date only.
This field has no meaning in the current implementation but is reserved for representing a cap rate or cap rate schedule on the interest rate of floating rate instruments.
Date vectorAny array of dates or date strings representing the dates when conditions change.
Relevant for many cash flow generating instruments, i.e., bond, floater, callable_bond.
Specified the dates when conditions, e.g., fixed_rate, float_spread or interest_capitalization, change within a cashflow stream. Refer to cash flow generation for details.
StringDetermines the main currency of an instrument, that is, the currency in which present value of an instrument is expressed. For leg instruments, if a leg has a currency that is different from the instruments main currency, it is converted into the main currency. If the parameters object defines a main currency that is different from the instrument main currency, another conversion is done. Conversions require that a conversion rate can be found in the parameters object.
Any string representing any currency the conversion rate was previously registered in the parameters object.
JSON Risk supports the day count conventions
For convenience, JSON Risk ignores case.
Relevant for most cash flow generating instruments, i.e., bond, floater, swap, swaption, callable_bond, cds
Determines how interest amounts are calculated for each accrual period generated within schedule generation.
StringAny string representing any curve previously registered in the parameters object for vector pricing.
The curve referenced by this field is applied for discounting cash flows. For the instruments bond, floater and callable_bond, discounting is additionally affected by spread_curve as well as residual_spread.
DateRelevant for most cash flow generating instruments, i.e., bond, floater, swap, swaption, callable_bond
Start date for schedule generation.
BooleanRelevant for callable_bond
If true, the value method returns only the embedded option price. Defaults to false.
DateRelevant for most cash flow generating instruments, i.e., bond, floater, swap, swaption, callable_bond
Used fo specifying an explicit initial stub for the interest schedule. Marks the end date of the initial interest rate period within schedule generation.
DateRelevant for swaption and callable_bond.
For swaption instruments, this is the expiry date, i.e., the date when the swaption is exercised. The exercise dates for the instrument type callable_bond are determined by the attribute first_exercise_date which represents the first date the bond can be called, and the attribute call_tenor.
Number or Number vectorRelevant for most cash flow generating instruments, i.e., bond, floater, swap, swaption, callable_bond
Represents the fixed rate paid on a bond instrument, a callable_bond instrument or the fixed leg of a swap or swaption instrument. For a floater instrument, this must be left empty, otherwise the floater is treated as a fixed rate bond.
When the field conditions_valid_until is populated with a vector of dates, fixed_rate may contain a vector of numbers of the same length and each entry in fixed_rate is considered the valid interest rate until the corresponding entry in conditions_valid_until.
DateRelevant for all instruments of type floater.
Used fo specifying an explicit initial stub for the fixing schedule. Marks the end date of the initial fixing period within schedule generation.
DateRelevant for all instruments of type floater.
Used fo specifying an explicit final stub for the fixing schedule. Marks the start date of the final fixing period within schedule generation.
BooleanRelevant for all instruments of type floater.
Used fo specifying an implicit final stub for the fixing schedule. A value of true causes the fixing schedule to be rolled out forward within schedule generation. Ignored when fixing_next_to_last_date is populated.
BooleanRelevant for all instruments of type floater.
If start and end dates within fixing schedule generation are not aligned with fixing_tenor, a value of true specifies a long stub to be generated instead of a short stub.
StringJSON Risk recognizes unadjusted, following, modified following, preceding. For convenience, JSON Risk interprets only the first letter and ignores case. That is, for m and M, JSON Risk assumes the modified folling business day convention.
Relevant for swap and swaption
Relevant for the floating rate leg only. This field determines how dates generated within schedule generation are adjusted, dependent on the field calendar. Refer cash flow generation for details.
NumberRelevant for floater, swap and swaption
This field specifies the interest rate to be used on floating rate legs for fixing periods starting in the past.
StringJSON Risk recognizes Act/360, Act/365, 30/360 and Act/Act. For convenience, JSON Risk ignores case and accepts the string a instead of act. The conventions a/360and a/365 have the usual meaning, a/a refers to the Act/Act (ICMA) day count convention and 30/360 refers to the 30/360 European convention.
Relevant for swap and swaption
Relevant for the floating rate leg only. Determines how interest amounts are calculated for each accrual period generated within schedule generation.
Number or Number vectorRelevant for floater, swap and swaption
Relevant for the floating rate leg only. Represents a spread over the floating rate.
When the field conditions_valid_until is populated with a vector of dates, float_spread may contain a vector of numbers of the same length and each entry in float_spread is considered the valid spread over float until the corresponding entry in conditions_valid_until.
NaturalMust be zero or positive.
Relevant for swap and swaption
Only relevant for the floating rate leg. A value of zero indicates interest is paid at maturity. Any other positive value is used within schedule generation for rolling out monthly dates.
NumberThis field has no meaning in the current implementation but is reserved for representing a cap rate or cap rate schedule on the interest rate of floating rate instruments.
StringRelevant for instruments with float rate payments or instruments that involve calibration to swaptions, e.g., callable_bond.
Any string representing any curve previously registered in the parameters object for vector pricing.
Boolean or Boolean vectorRelevant for bond, floater, callable_bond
If true, a notional payment is generated at each interest payment date within cash flow generation. The amount of the generated notional payment is calculated by changing the sign of the interest payment.
When the field conditions_valid_until is populated with a vector of dates, interest_capitalization may contain a vector of booleans of the same length and each entry in interest_capitalization is considered valid until the corresponding entry in conditions_valid_until.
BooleanRelevant for swap, swaption
A value of true marks a swap instrument as a payer swap and marks a swaption instrument as a payer swaption. Defaults to false, implying a receiver swap or, respecitvely, a receiver swaption.
BooleanRelevant for bond, floater, callable_bond
If true, the field repay_amount is overriden and the repayment amount is calculated by dividing the notional by the number of repayments implied by the repayment schedule.
This field has no meaning in the current implementation but is reserved for representing the market value or, respectively, the dirty price of a position.
DateRelevant for all cash flow generating instruments, i.e., bond, floater, swap, swaption, callable_bond, fxterm
The date when all remaining notionals are paid back. In case of fxterm instruments, this is the date when notional is paid, as opposed to notional_2 which is paid at maturity_2.
For all instruments except fxterm, the final payment date is subject to the business day convention in bdc, whereas the unadjusted maturity is used for schedule generation.
DateOnly relevant for fxterm
The date when notional_2 is paid, as opposed to notional which is paid at maturity.
DateRelevant for most cash flow generating instruments, i.e., bond, floater, swap, swaption, callable_bond
Used fo specifying an explicit final stub for the interest schedule. Marks the start date of the final interest accrual period within schedule generation.
NumberRelevant for all cash flow generating instruments, i.e., bond, floater, swap, swaption, callable_bond, fxterm
The notional of an instrument. In case of amortizing instruments, this is the initial notional. In case of fxterm instruments, this is the near leg notional, i.e., the notional paid at maturity as opposed to maturity_2
NumberOnly relevant for fxterm
Corresponds to the far leg notional of an fxterm instrument, i.e., the notional paid at maturity_2.
NumberFor all instruments, specifies the quantity of the position. Present values calculated are multiplied with this number. Examples:
bond with notional 100 and quantity 1 has the same value as the same bond with a notional of 1 and a quantity of 100.NumberZero, positive and negative valued accepted.
Relevant for bond, floater, callable_bond
The amount repaid at each date implied by the repayment schedule. If notional is positive, a positive value marks cash inflows. If notional is negative, a positive value marks cash outflows. A zero value switches off amortization.
When the field conditions_valid_until is populated with a vector of dates, repay_amount may contain a vector of numbers of the same length and each entry in repay_amount is considered valid until the corresponding entry in conditions_valid_until.
DateRelevant for bond, floater, callable_bond
Used fo specifying an explicit initial stub for the repayment schedule. Marks first date when repayments occur within schedule generation.
DateRelevant for bond, floater, callable_bond
Used fo specifying an explicit final stub for the repayment schedule. Marks the last date before maturity where repayment occors within schedule generation.
BooleanRelevant for bond, floater, callable_bond
Used fo specifying an implicit final stub for the repayment schedule. A value of true causes the repayment schedule to be rolled out forward within schedule generation. Ignored when repay_next_to_last_date is populated.
BooleanRelevant for bond, floater, callable_bond
If start and end dates within repayment schedule generation are not aligned with repay_tenor, a value of true specifies a long stub to be generated instead of a short stub.
NaturalMust be zero or positive.
Relevant for bond, floater, callable_bond
A value of zero indicates a bullet instrument, i.e., all notional is paid back at maturity. Any other positive value is used within repayment schedule generation for rolling out monthly dates.
NumberRelevant for bond, floater, callable_bond
Within discounted cash flow valuation, this number is interpreted as an additional spread with day count convention act/365 and annual compounding that is added on top of the discount curve and the spread curve.
NaturalMust be zero or positive
Relevant for bond, floater, callable_bond
Within discounted cash flow valuation, this specifies a number of business days where payments are not included in the present value.
StringRelevant for bond, floater, callable_bond
Any string representing any curve previously registered in the parameters object for vector pricing.
The curve referenced by this field is applied for discounting cash flows, in addition to the curve specified under disc_curve as well as the residual_spread.
BooleanRelevant for most cash flow generating instruments, i.e., bond, floater, swap, swaption, callable_bond
Used fo specifying an implicit final stub for the interest schedule. A value of true causes the interest schedule to be rolled out forward within schedule generation. Ignored when next_to_last_date is populated.
BooleanRelevant for most cash flow generating instruments, i.e., bond, floater, swap, swaption, callable_bond
If start and end dates within interest schedule generation are not aligned with tenor, a value of true specifies a long stub to be generated instead of a short stub.
StringRelevant for swaption and callable_bond instruments.
Any string representing any surface previously registered in the parameters object for vector pricing.
Bachelier volatility curve object used for valuation.
NaturalMust be zero or positive.
Relevant for most cash flow generating instruments, i.e., bond, floater, swap, swaption, callable_bond
A value of zero indicates interest is paid at maturity. Any other positive value is used within schedule generation for rolling out monthly dates.
StringSee table below, string is case-insensitive and underscores are ignored, so e.g. C-Style equity_future and C++-Style EquityFuture are both supported.
The make_instrument function and the simulation and vector_pricer functions use this identifier to determine which class to instantiate for an instrument JSON object. These are the supported types with their classes:
| type | class | category/superclass |
|---|---|---|
bond |
Bond | LegInstrument |
floater |
Floater | LegInstrument |
swap |
Swap | LegInstrument |
swaption |
Swaption | LegInstrument |
fxterm |
FxTerm | LegInstrument |
callable_bond |
CallableBond | LegInstrument |
leg_instrument |
LegInstrument | LegInstrument |
equity |
Equity | Equity |
equity_future |
EquityFuture | Equity |
equity_forward |
EquityForward | Equity |
equity_option |
EquityOption | Equity |
cds |
CreditDefaultSwap | LegInstrument |
JSON risk is published under the MIT License.
This project is maintained by