derivitec.core.client.DerivitecClient.get_discount_factors¶
- DerivitecClient.get_discount_factors(curve, start_mat, end_mats)[source]¶
Get discount factors from a curve. This can be called from the client or it can be called directly from any DiscountFactorCallable derived class instance with discount_curve.DiscountFactor(start_mat, end_mats).
- Parameters:
curve (
derivitec.market_data.types.DiscountCurve) – The discount curve.start_mat (int) – The starting maturity.
end_mats (list of int) – The end maturities.
market_data_environment_name (str) – The market data environment name (optional with default Organisation Level Environment)
- Return type:
derivitec.market_data.response.ApiGetDiscountFactorsResponse
Code
>>> currencies = ["USD"] >>> discount_curves = client.get_discount_curves(currencies, market_dates) >>> curve = discount_curves[0] >>> start_mat = 10 >>> end_mats = [10, 20, 30] >>> client.get_discount_factors(curve, start_mat, end_mats) >>> curve.DiscountFactor(start_mat, end_mats)