quantark 0.1.1__tar.gz → 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {quantark-0.1.1 → quantark-0.2.0}/CHANGELOG.md +14 -0
- {quantark-0.1.1 → quantark-0.2.0}/PKG-INFO +71 -9
- {quantark-0.1.1 → quantark-0.2.0}/README.md +69 -8
- {quantark-0.1.1 → quantark-0.2.0}/pyproject.toml +2 -2
- {quantark-0.1.1 → quantark-0.2.0}/quantark/__init__.py +1 -1
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/__init__.py +3 -1
- quantark-0.2.0/quantark/asset/credit/__init__.py +20 -0
- quantark-0.2.0/quantark/asset/credit/conventions.py +29 -0
- quantark-0.2.0/quantark/asset/credit/engine/__init__.py +4 -0
- quantark-0.2.0/quantark/asset/credit/engine/analytical/__init__.py +4 -0
- quantark-0.2.0/quantark/asset/credit/engine/analytical/reduced_form.py +220 -0
- quantark-0.2.0/quantark/asset/credit/engine/base_credit_engine.py +31 -0
- quantark-0.2.0/quantark/asset/credit/engine/mc/__init__.py +4 -0
- quantark-0.2.0/quantark/asset/credit/engine/mc/basket_copula.py +226 -0
- quantark-0.2.0/quantark/asset/credit/engine/schedule.py +147 -0
- quantark-0.2.0/quantark/asset/credit/product/__init__.py +13 -0
- quantark-0.2.0/quantark/asset/credit/product/base_credit_product.py +19 -0
- quantark-0.2.0/quantark/asset/credit/product/basket_cds.py +130 -0
- quantark-0.2.0/quantark/asset/credit/product/cds.py +106 -0
- quantark-0.2.0/quantark/asset/credit/riskmeasures/__init__.py +4 -0
- quantark-0.2.0/quantark/asset/credit/riskmeasures/credit_greeks_calculator.py +107 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/__init__.py +14 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/analytical/__init__.py +4 -0
- quantark-0.2.0/quantark/asset/equity/engine/analytical/accumulator_analytical_engine.py +363 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/analytical/asian_option_analytical_engine.py +139 -73
- quantark-0.2.0/quantark/asset/equity/engine/analytical/heston_analytical_engine.py +79 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/base_engine.py +63 -1
- quantark-0.2.0/quantark/asset/equity/engine/cashflow/__init__.py +23 -0
- quantark-0.2.0/quantark/asset/equity/engine/cashflow/accrual_calculator.py +151 -0
- quantark-0.2.0/quantark/asset/equity/engine/cashflow/total_return_swap_engine.py +566 -0
- quantark-0.2.0/quantark/asset/equity/engine/cashflow/trs_cva_exposure.py +37 -0
- quantark-0.2.0/quantark/asset/equity/engine/cashflow/trs_cva_repricer.py +357 -0
- quantark-0.2.0/quantark/asset/equity/engine/cashflow/trs_valuation.py +177 -0
- quantark-0.2.0/quantark/asset/equity/engine/localvol_greeks.py +68 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/mc/__init__.py +8 -0
- quantark-0.2.0/quantark/asset/equity/engine/mc/accumulator_mc_engine.py +389 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/mc/asian_option_mc_engine.py +55 -33
- quantark-0.2.0/quantark/asset/equity/engine/mc/heston_mc_engine.py +75 -0
- quantark-0.2.0/quantark/asset/equity/engine/mc/heston_slv_mc_engine.py +97 -0
- quantark-0.2.0/quantark/asset/equity/engine/mc/local_vol_mc_engine.py +88 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/pde/__init__.py +6 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/pde/base_pde_solver.py +31 -1
- quantark-0.2.0/quantark/asset/equity/engine/pde/heston_pde_solver.py +110 -0
- quantark-0.2.0/quantark/asset/equity/engine/pde/heston_slv_pde_solver.py +105 -0
- quantark-0.2.0/quantark/asset/equity/engine/pde/local_vol_pde_solver.py +99 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/pde/snowball_pde_solver.py +9 -7
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/pde_engine.py +10 -1
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/quad/ko_reset_snowball_quad_engine.py +23 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/quad/phoenix_quad_engine.py +32 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/quad/snowball_quad_engine.py +79 -6
- quantark-0.2.0/quantark/asset/equity/lifecycle/__init__.py +26 -0
- quantark-0.2.0/quantark/asset/equity/lifecycle/autocallable.py +368 -0
- quantark-0.2.0/quantark/asset/equity/lifecycle/barrier.py +680 -0
- quantark-0.2.0/quantark/asset/equity/lifecycle/events.py +57 -0
- quantark-0.2.0/quantark/asset/equity/lifecycle/manager.py +213 -0
- quantark-0.2.0/quantark/asset/equity/lifecycle/state.py +70 -0
- quantark-0.2.0/quantark/asset/equity/process/bsm/qmc_brownian_bridge.py +10 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/process/bsm/qmc_path_generator.py +3 -1
- quantark-0.2.0/quantark/asset/equity/process/bsm/qmc_rqmc_driver.py +4 -0
- quantark-0.2.0/quantark/asset/equity/process/bsm/qmc_sobol.py +8 -0
- quantark-0.2.0/quantark/asset/equity/process/bsm/qmc_variance_reduction.py +11 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/product/option/__init__.py +3 -0
- quantark-0.2.0/quantark/asset/equity/product/option/accumulator_option.py +442 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/product/option/asian_option.py +138 -18
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/product/option/snowball_helpers.py +17 -1
- quantark-0.2.0/quantark/asset/equity/product/swap/__init__.py +67 -0
- quantark-0.2.0/quantark/asset/equity/product/swap/base_swap.py +34 -0
- quantark-0.2.0/quantark/asset/equity/product/swap/multi_asset_trs.py +262 -0
- quantark-0.2.0/quantark/asset/equity/product/swap/one_asset_trs.py +66 -0
- quantark-0.2.0/quantark/asset/equity/product/swap/one_asset_trs_dual_ccy.py +101 -0
- quantark-0.2.0/quantark/asset/equity/product/swap/trs_event_handler.py +97 -0
- quantark-0.2.0/quantark/asset/equity/product/swap/trs_params.py +199 -0
- quantark-0.2.0/quantark/asset/equity/product/swap/trs_schedule.py +129 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/report/snowball_risk_comparison_report.py +56 -73
- quantark-0.2.0/quantark/asset/equity/riskmeasures/__init__.py +7 -0
- quantark-0.2.0/quantark/asset/equity/riskmeasures/vol_model_risk.py +23 -0
- quantark-0.2.0/quantark/asset/fx/__init__.py +10 -0
- quantark-0.2.0/quantark/asset/fx/engine/__init__.py +31 -0
- quantark-0.2.0/quantark/asset/fx/engine/analytical/__init__.py +42 -0
- quantark-0.2.0/quantark/asset/fx/engine/analytical/fx_deltaone_engine.py +150 -0
- quantark-0.2.0/quantark/asset/fx/engine/analytical/fx_digital_engine.py +263 -0
- quantark-0.2.0/quantark/asset/fx/engine/analytical/fx_foreign_range_accrual_engine.py +113 -0
- quantark-0.2.0/quantark/asset/fx/engine/analytical/fx_heston_analytical_engine.py +78 -0
- quantark-0.2.0/quantark/asset/fx/engine/analytical/fx_quanto_digital_engine.py +89 -0
- quantark-0.2.0/quantark/asset/fx/engine/analytical/fx_quanto_range_accrual_engine.py +120 -0
- quantark-0.2.0/quantark/asset/fx/engine/analytical/fx_quanto_vanilla_engine.py +146 -0
- quantark-0.2.0/quantark/asset/fx/engine/analytical/fx_range_accrual_engine.py +390 -0
- quantark-0.2.0/quantark/asset/fx/engine/analytical/garman_kohlhagen_engine.py +245 -0
- quantark-0.2.0/quantark/asset/fx/engine/analytical/vannavolga/__init__.py +62 -0
- quantark-0.2.0/quantark/asset/fx/engine/analytical/vannavolga/arbitrage.py +67 -0
- quantark-0.2.0/quantark/asset/fx/engine/analytical/vannavolga/attenuation.py +311 -0
- quantark-0.2.0/quantark/asset/fx/engine/analytical/vannavolga/barrier_bs.py +281 -0
- quantark-0.2.0/quantark/asset/fx/engine/analytical/vannavolga/vv_barrier.py +193 -0
- quantark-0.2.0/quantark/asset/fx/engine/analytical/vannavolga/vv_barrier_engine.py +94 -0
- quantark-0.2.0/quantark/asset/fx/engine/analytical/vannavolga/vv_vanilla_barrier.py +208 -0
- quantark-0.2.0/quantark/asset/fx/engine/base_fx_engine.py +299 -0
- quantark-0.2.0/quantark/asset/fx/engine/localvol_common.py +54 -0
- quantark-0.2.0/quantark/asset/fx/engine/localvol_greeks.py +76 -0
- quantark-0.2.0/quantark/asset/fx/engine/mc/__init__.py +28 -0
- quantark-0.2.0/quantark/asset/fx/engine/mc/fx_barrier_mc_engine.py +290 -0
- quantark-0.2.0/quantark/asset/fx/engine/mc/fx_mc_params.py +47 -0
- quantark-0.2.0/quantark/asset/fx/engine/mc/fx_range_accrual_mc_engine.py +343 -0
- quantark-0.2.0/quantark/asset/fx/engine/mc/fx_sharkfin_mc_engine.py +122 -0
- quantark-0.2.0/quantark/asset/fx/engine/mc/fx_tarf_mc_engine.py +180 -0
- quantark-0.2.0/quantark/asset/fx/engine/mc/fx_tarn_note_mc_engine.py +188 -0
- quantark-0.2.0/quantark/asset/fx/engine/mc/heston_mc_engine.py +75 -0
- quantark-0.2.0/quantark/asset/fx/engine/mc/heston_slv_mc_engine.py +87 -0
- quantark-0.2.0/quantark/asset/fx/engine/mc/local_vol_mc_engine.py +77 -0
- quantark-0.2.0/quantark/asset/fx/engine/pde/__init__.py +7 -0
- quantark-0.2.0/quantark/asset/fx/engine/pde/heston_pde_solver.py +111 -0
- quantark-0.2.0/quantark/asset/fx/engine/pde/heston_slv_pde_solver.py +109 -0
- quantark-0.2.0/quantark/asset/fx/engine/pde/local_vol_pde_solver.py +78 -0
- quantark-0.2.0/quantark/asset/fx/process/__init__.py +7 -0
- quantark-0.2.0/quantark/asset/fx/process/fx_gk_path_generator.py +141 -0
- quantark-0.2.0/quantark/asset/fx/process/garman_kohlhagen_process.py +154 -0
- quantark-0.2.0/quantark/asset/fx/product/__init__.py +35 -0
- quantark-0.2.0/quantark/asset/fx/product/base_fx_product.py +163 -0
- quantark-0.2.0/quantark/asset/fx/product/currency_pair.py +43 -0
- quantark-0.2.0/quantark/asset/fx/product/deltaone/__init__.py +9 -0
- quantark-0.2.0/quantark/asset/fx/product/deltaone/base_fx_deltaone.py +60 -0
- quantark-0.2.0/quantark/asset/fx/product/deltaone/fx_forward.py +69 -0
- quantark-0.2.0/quantark/asset/fx/product/deltaone/fx_spot.py +76 -0
- quantark-0.2.0/quantark/asset/fx/product/deltaone/fx_swap.py +105 -0
- quantark-0.2.0/quantark/asset/fx/product/option/__init__.py +36 -0
- quantark-0.2.0/quantark/asset/fx/product/option/fx_barrier_option.py +121 -0
- quantark-0.2.0/quantark/asset/fx/product/option/fx_digital_option.py +112 -0
- quantark-0.2.0/quantark/asset/fx/product/option/fx_foreign_range_accrual_option.py +70 -0
- quantark-0.2.0/quantark/asset/fx/product/option/fx_one_touch_option.py +71 -0
- quantark-0.2.0/quantark/asset/fx/product/option/fx_quanto_digital_option.py +87 -0
- quantark-0.2.0/quantark/asset/fx/product/option/fx_quanto_range_accrual_option.py +99 -0
- quantark-0.2.0/quantark/asset/fx/product/option/fx_quanto_vanilla_option.py +90 -0
- quantark-0.2.0/quantark/asset/fx/product/option/fx_range_accrual_config.py +258 -0
- quantark-0.2.0/quantark/asset/fx/product/option/fx_range_accrual_option.py +318 -0
- quantark-0.2.0/quantark/asset/fx/product/option/fx_sharkfin_option.py +152 -0
- quantark-0.2.0/quantark/asset/fx/product/option/fx_target_redemption_forward.py +145 -0
- quantark-0.2.0/quantark/asset/fx/product/option/fx_target_redemption_note.py +198 -0
- quantark-0.2.0/quantark/asset/fx/product/option/fx_vanilla_option.py +184 -0
- quantark-0.2.0/quantark/asset/fx/report/__init__.py +6 -0
- quantark-0.2.0/quantark/asset/fx/report/fx_report.py +159 -0
- quantark-0.2.0/quantark/asset/fx/riskmeasures/__init__.py +7 -0
- quantark-0.2.0/quantark/asset/fx/riskmeasures/fx_greeks_calculator.py +78 -0
- quantark-0.2.0/quantark/asset/fx/riskmeasures/vol_model_risk.py +23 -0
- quantark-0.2.0/quantark/asset/vol_model_risk.py +608 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/backtest/__init__.py +22 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/backtest/base.py +81 -29
- quantark-0.2.0/quantark/backtest/credit/__init__.py +6 -0
- quantark-0.2.0/quantark/backtest/credit/config.py +64 -0
- quantark-0.2.0/quantark/backtest/credit/engine.py +236 -0
- quantark-0.2.0/quantark/backtest/credit/results.py +61 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/backtest/equity/config.py +6 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/backtest/equity/engine.py +248 -38
- quantark-0.2.0/quantark/backtest/equity/multi_hedge_executor.py +413 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/backtest/equity/results.py +9 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/backtest/equity/state.py +54 -7
- quantark-0.2.0/quantark/backtest/fx/__init__.py +7 -0
- quantark-0.2.0/quantark/backtest/fx/config.py +53 -0
- quantark-0.2.0/quantark/backtest/fx/engine.py +161 -0
- quantark-0.2.0/quantark/backtest/fx/results.py +61 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/backtest/otc/_replay.py +63 -280
- {quantark-0.1.1 → quantark-0.2.0}/quantark/backtest/otc/results.py +54 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/backtest/otc/state.py +2 -48
- quantark-0.2.0/quantark/backtest/strategy/__init__.py +92 -0
- quantark-0.2.0/quantark/backtest/strategy/barrier_trigger_strategy.py +288 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/backtest/strategy/base_strategy.py +50 -0
- quantark-0.2.0/quantark/backtest/strategy/credit_spread_neutral_strategy.py +115 -0
- quantark-0.2.0/quantark/backtest/strategy/fx_delta_neutral_strategy.py +113 -0
- quantark-0.2.0/quantark/backtest/strategy/hedge_instruments.py +293 -0
- quantark-0.2.0/quantark/backtest/strategy/hedge_optimizer.py +220 -0
- quantark-0.2.0/quantark/backtest/strategy/min_variance_delta_strategy.py +234 -0
- quantark-0.2.0/quantark/backtest/strategy/multi_greek_strategy.py +459 -0
- quantark-0.2.0/quantark/backtest/strategy/scenario_hedge_strategy.py +170 -0
- quantark-0.2.0/quantark/backtest/strategy/scenarios.py +187 -0
- quantark-0.2.0/quantark/backtest/strategy/semi_static_strategy.py +201 -0
- quantark-0.2.0/quantark/backtest/strategy/triggered_hedge_strategy.py +295 -0
- quantark-0.2.0/quantark/backtest/strategy/whalley_wilmott_strategy.py +233 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/cashleg/event_distribution.py +9 -5
- {quantark-0.1.1 → quantark-0.2.0}/quantark/dynamicscenario/__init__.py +31 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/dynamicscenario/base.py +16 -2
- {quantark-0.1.1 → quantark-0.2.0}/quantark/dynamicscenario/config.py +8 -1
- quantark-0.2.0/quantark/dynamicscenario/credit/__init__.py +14 -0
- quantark-0.2.0/quantark/dynamicscenario/credit/config.py +38 -0
- quantark-0.2.0/quantark/dynamicscenario/credit/engine.py +238 -0
- quantark-0.2.0/quantark/dynamicscenario/credit/path_library.py +101 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/dynamicscenario/engine.py +41 -7
- quantark-0.2.0/quantark/dynamicscenario/fx/__init__.py +15 -0
- quantark-0.2.0/quantark/dynamicscenario/fx/config.py +47 -0
- quantark-0.2.0/quantark/dynamicscenario/fx/engine.py +181 -0
- quantark-0.2.0/quantark/dynamicscenario/fx/path_library.py +91 -0
- quantark-0.2.0/quantark/dynamicscenario/lifecycle_manager.py +90 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/dynamicscenario/path/day_path.py +5 -1
- {quantark-0.1.1 → quantark-0.2.0}/quantark/dynamicscenario/report/dynamic_report.py +56 -1
- {quantark-0.1.1 → quantark-0.2.0}/quantark/dynamicscenario/results/__init__.py +3 -2
- {quantark-0.1.1 → quantark-0.2.0}/quantark/dynamicscenario/results/dynamic_results.py +100 -4
- {quantark-0.1.1 → quantark-0.2.0}/quantark/dynamicscenario/results/result_exporter.py +16 -0
- quantark-0.2.0/quantark/montecarlo/__init__.py +47 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/param/__init__.py +2 -1
- quantark-0.2.0/quantark/param/credit/__init__.py +10 -0
- quantark-0.2.0/quantark/param/credit/ajd_hazard_curve.py +100 -0
- quantark-0.2.0/quantark/param/credit/hazard_curve.py +157 -0
- quantark-0.2.0/quantark/param/vol/__init__.py +21 -0
- quantark-0.2.0/quantark/param/vol/sabr/__init__.py +29 -0
- quantark-0.2.0/quantark/param/vol/sabr/calibration.py +290 -0
- quantark-0.2.0/quantark/param/vol/sabr/hagan.py +292 -0
- quantark-0.2.0/quantark/param/vol/sabr/sabr_surface.py +179 -0
- quantark-0.2.0/quantark/param/vol/vannavolga/__init__.py +55 -0
- quantark-0.2.0/quantark/param/vol/vannavolga/bs_fx.py +153 -0
- quantark-0.2.0/quantark/param/vol/vannavolga/market_conventions.py +222 -0
- quantark-0.2.0/quantark/param/vol/vannavolga/smile_builder.py +146 -0
- quantark-0.2.0/quantark/param/vol/vannavolga/vv_core.py +142 -0
- quantark-0.2.0/quantark/param/vol/vannavolga/vv_surface.py +177 -0
- quantark-0.2.0/quantark/param/vol/vannavolga/vv_term_structure.py +201 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/param/vol/vol_surface.py +68 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/portfolio/__init__.py +22 -0
- quantark-0.2.0/quantark/portfolio/credit/__init__.py +11 -0
- quantark-0.2.0/quantark/portfolio/credit/portfolio.py +169 -0
- quantark-0.2.0/quantark/portfolio/credit/position.py +207 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/portfolio/equity/__init__.py +2 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/portfolio/equity/portfolio.py +48 -1
- {quantark-0.1.1 → quantark-0.2.0}/quantark/portfolio/equity/position.py +23 -0
- quantark-0.2.0/quantark/portfolio/equity/swap_position.py +366 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/portfolio/fi/position.py +69 -0
- quantark-0.2.0/quantark/portfolio/fx/__init__.py +11 -0
- quantark-0.2.0/quantark/portfolio/fx/portfolio.py +163 -0
- quantark-0.2.0/quantark/portfolio/fx/position.py +182 -0
- quantark-0.2.0/quantark/priceenv/__init__.py +22 -0
- quantark-0.2.0/quantark/priceenv/credit_pricing_environment.py +147 -0
- quantark-0.2.0/quantark/priceenv/fx_pricing_environment.py +209 -0
- quantark-0.2.0/quantark/saccr/__init__.py +46 -0
- quantark-0.2.0/quantark/saccr/calculator.py +144 -0
- quantark-0.2.0/quantark/saccr/dashboard.py +509 -0
- quantark-0.2.0/quantark/saccr/engines/__init__.py +1 -0
- quantark-0.2.0/quantark/saccr/engines/addons/__init__.py +17 -0
- quantark-0.2.0/quantark/saccr/engines/addons/base.py +55 -0
- quantark-0.2.0/quantark/saccr/engines/addons/commodity.py +116 -0
- quantark-0.2.0/quantark/saccr/engines/addons/credit.py +108 -0
- quantark-0.2.0/quantark/saccr/engines/addons/equity.py +97 -0
- quantark-0.2.0/quantark/saccr/engines/addons/fx.py +87 -0
- quantark-0.2.0/quantark/saccr/engines/addons/interest_rate.py +120 -0
- quantark-0.2.0/quantark/saccr/engines/maths.py +188 -0
- quantark-0.2.0/quantark/saccr/engines/pfe.py +38 -0
- quantark-0.2.0/quantark/saccr/engines/replacement_cost.py +26 -0
- quantark-0.2.0/quantark/saccr/models/__init__.py +27 -0
- quantark-0.2.0/quantark/saccr/models/enums.py +113 -0
- quantark-0.2.0/quantark/saccr/models/netting_set.py +115 -0
- quantark-0.2.0/quantark/saccr/models/trade.py +194 -0
- quantark-0.2.0/quantark/saccr/parameters/__init__.py +5 -0
- quantark-0.2.0/quantark/saccr/parameters/supervisory.py +215 -0
- quantark-0.2.0/quantark/saccr/results/__init__.py +5 -0
- quantark-0.2.0/quantark/saccr/results/result.py +50 -0
- quantark-0.2.0/quantark/sacva/__init__.py +45 -0
- quantark-0.2.0/quantark/sacva/calculator.py +80 -0
- quantark-0.2.0/quantark/sacva/cva/__init__.py +5 -0
- quantark-0.2.0/quantark/sacva/cva/engine.py +47 -0
- quantark-0.2.0/quantark/sacva/dashboard.py +129 -0
- quantark-0.2.0/quantark/sacva/engines/__init__.py +0 -0
- quantark-0.2.0/quantark/sacva/engines/base.py +155 -0
- quantark-0.2.0/quantark/sacva/engines/commodity.py +37 -0
- quantark-0.2.0/quantark/sacva/engines/correlations.py +33 -0
- quantark-0.2.0/quantark/sacva/engines/counterparty_credit.py +45 -0
- quantark-0.2.0/quantark/sacva/engines/equity.py +37 -0
- quantark-0.2.0/quantark/sacva/engines/fx.py +36 -0
- quantark-0.2.0/quantark/sacva/engines/interest_rate.py +71 -0
- quantark-0.2.0/quantark/sacva/engines/reference_credit.py +40 -0
- quantark-0.2.0/quantark/sacva/exposure/__init__.py +6 -0
- quantark-0.2.0/quantark/sacva/exposure/asof.py +51 -0
- quantark-0.2.0/quantark/sacva/exposure/correlation.py +42 -0
- quantark-0.2.0/quantark/sacva/exposure/curves.py +85 -0
- quantark-0.2.0/quantark/sacva/exposure/engine.py +160 -0
- quantark-0.2.0/quantark/sacva/exposure/grid.py +54 -0
- quantark-0.2.0/quantark/sacva/exposure/historical/__init__.py +0 -0
- quantark-0.2.0/quantark/sacva/exposure/historical/calibration.py +138 -0
- quantark-0.2.0/quantark/sacva/exposure/historical/engine.py +192 -0
- quantark-0.2.0/quantark/sacva/exposure/historical/path_generator.py +140 -0
- quantark-0.2.0/quantark/sacva/exposure/historical/pfe.py +80 -0
- quantark-0.2.0/quantark/sacva/exposure/historical/resampling.py +96 -0
- quantark-0.2.0/quantark/sacva/exposure/paths.py +141 -0
- quantark-0.2.0/quantark/sacva/exposure/phoenix_surface.py +176 -0
- quantark-0.2.0/quantark/sacva/exposure/repricer.py +198 -0
- quantark-0.2.0/quantark/sacva/exposure/simulator.py +504 -0
- quantark-0.2.0/quantark/sacva/exposure/snowball_surface.py +282 -0
- quantark-0.2.0/quantark/sacva/exposure/statemachine.py +314 -0
- quantark-0.2.0/quantark/sacva/exposure/value_surface.py +111 -0
- quantark-0.2.0/quantark/sacva/models/__init__.py +0 -0
- quantark-0.2.0/quantark/sacva/models/enums.py +31 -0
- quantark-0.2.0/quantark/sacva/models/portfolio.py +27 -0
- quantark-0.2.0/quantark/sacva/models/sensitivity.py +124 -0
- quantark-0.2.0/quantark/sacva/parameters/__init__.py +0 -0
- quantark-0.2.0/quantark/sacva/parameters/supervisory.py +250 -0
- quantark-0.2.0/quantark/sacva/portfolio/__init__.py +14 -0
- quantark-0.2.0/quantark/sacva/portfolio/counterparty.py +38 -0
- quantark-0.2.0/quantark/sacva/portfolio/credit_curve.py +59 -0
- quantark-0.2.0/quantark/sacva/portfolio/netting.py +36 -0
- quantark-0.2.0/quantark/sacva/portfolio/trade.py +66 -0
- quantark-0.2.0/quantark/sacva/portfolio/trade_portfolio.py +29 -0
- quantark-0.2.0/quantark/sacva/results/__init__.py +0 -0
- quantark-0.2.0/quantark/sacva/results/result.py +26 -0
- quantark-0.2.0/quantark/sacva/sacva_engine.py +336 -0
- quantark-0.2.0/quantark/sacva/sensitivities/__init__.py +1 -0
- quantark-0.2.0/quantark/sacva/sensitivities/curve_bump.py +63 -0
- quantark-0.2.0/quantark/sacva/sensitivities/engine.py +53 -0
- quantark-0.2.0/quantark/sacva/sensitivities/shifts.py +46 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/simm/__init__.py +26 -4
- {quantark-0.1.1 → quantark-0.2.0}/quantark/simm/calibration/__init__.py +84 -113
- quantark-0.2.0/quantark/simm/calibration/accessors.py +56 -0
- quantark-0.2.0/quantark/simm/calibration/commodity.py +136 -0
- quantark-0.2.0/quantark/simm/calibration/credit_non_qualifying.py +54 -0
- quantark-0.2.0/quantark/simm/calibration/credit_qualifying.py +101 -0
- quantark-0.2.0/quantark/simm/calibration/equity.py +124 -0
- quantark-0.2.0/quantark/simm/calibration/fx.py +90 -0
- quantark-0.2.0/quantark/simm/calibration/ir.py +118 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/simm/config.py +13 -1
- {quantark-0.1.1 → quantark-0.2.0}/quantark/simm/crif/parser.py +121 -70
- quantark-0.2.0/quantark/simm/dashboard.py +532 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/simm/engines/__init__.py +2 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/simm/engines/aggregation/__init__.py +35 -18
- quantark-0.2.0/quantark/simm/engines/aggregation/bucket_aggregator.py +139 -0
- quantark-0.2.0/quantark/simm/engines/aggregation/concentration.py +264 -0
- quantark-0.2.0/quantark/simm/engines/aggregation/correlations.py +219 -0
- quantark-0.2.0/quantark/simm/engines/aggregation/product_class_aggregator.py +85 -0
- quantark-0.2.0/quantark/simm/engines/aggregation/risk_class_aggregator.py +311 -0
- quantark-0.2.0/quantark/simm/engines/aggregation/simm_calculator.py +495 -0
- quantark-0.2.0/quantark/simm/engines/aggregation/weighted_sensitivity.py +282 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/simm/engines/base.py +10 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/simm/engines/factory.py +9 -32
- {quantark-0.1.1 → quantark-0.2.0}/quantark/simm/engines/portfolio_adapter.py +36 -55
- {quantark-0.1.1 → quantark-0.2.0}/quantark/simm/engines/risk_class/equity_engine.py +31 -20
- {quantark-0.1.1 → quantark-0.2.0}/quantark/simm/engines/risk_class/ir_engine.py +36 -90
- quantark-0.2.0/quantark/simm/engines/risk_class/provider_engine.py +54 -0
- quantark-0.2.0/quantark/simm/market_data.py +57 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/simm/results/simm_result.py +5 -3
- quantark-0.2.0/quantark/simm/sensitivity.py +835 -0
- quantark-0.2.0/quantark/simm/taxonomy.py +574 -0
- quantark-0.2.0/quantark/simm/template/__init__.py +44 -0
- quantark-0.2.0/quantark/simm/template/xlsx_loader.py +338 -0
- quantark-0.2.0/quantark/simm/template/xlsx_template.py +166 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/stresstest/__init__.py +6 -0
- quantark-0.2.0/quantark/stresstest/credit/__init__.py +11 -0
- quantark-0.2.0/quantark/stresstest/credit/config.py +31 -0
- quantark-0.2.0/quantark/stresstest/credit/credit_stress_applicator.py +240 -0
- quantark-0.2.0/quantark/stresstest/credit/engine.py +199 -0
- quantark-0.2.0/quantark/stresstest/fx/__init__.py +12 -0
- quantark-0.2.0/quantark/stresstest/fx/config.py +31 -0
- quantark-0.2.0/quantark/stresstest/fx/engine.py +196 -0
- quantark-0.2.0/quantark/stresstest/fx/fx_stress_applicator.py +167 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/stresstest/stress/stress_applicator.py +2 -2
- {quantark-0.1.1 → quantark-0.2.0}/quantark/util/calendar/business_calendar.py +160 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/util/enum/__init__.py +16 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/util/enum/engine_enums.py +66 -0
- quantark-0.2.0/quantark/util/enum/fx_enums.py +37 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/util/enum/option_enums.py +19 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/util/numerical/__init__.py +8 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/util/numerical/comparison.py +100 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/var/__init__.py +20 -0
- quantark-0.2.0/quantark/var/credit/__init__.py +15 -0
- quantark-0.2.0/quantark/var/credit/config.py +61 -0
- quantark-0.2.0/quantark/var/credit/engine.py +297 -0
- quantark-0.2.0/quantark/var/credit/revaluation.py +58 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/var/engines/historical.py +9 -6
- {quantark-0.1.1 → quantark-0.2.0}/quantark/var/engines/monte_carlo.py +8 -6
- {quantark-0.1.1 → quantark-0.2.0}/quantark/var/engines/parametric.py +51 -71
- quantark-0.2.0/quantark/var/fx/__init__.py +15 -0
- quantark-0.2.0/quantark/var/fx/config.py +18 -0
- quantark-0.2.0/quantark/var/fx/engine.py +315 -0
- quantark-0.2.0/quantark/var/fx/revaluation.py +116 -0
- quantark-0.2.0/quantark/volmodels/__init__.py +7 -0
- quantark-0.2.0/quantark/volmodels/black_scholes.py +87 -0
- quantark-0.2.0/quantark/volmodels/curves.py +61 -0
- quantark-0.2.0/quantark/volmodels/heston/__init__.py +28 -0
- quantark-0.2.0/quantark/volmodels/heston/analytical_kernel.py +184 -0
- quantark-0.2.0/quantark/volmodels/heston/calibration.py +162 -0
- quantark-0.2.0/quantark/volmodels/heston/mc_kernel.py +201 -0
- quantark-0.2.0/quantark/volmodels/heston/params.py +47 -0
- quantark-0.2.0/quantark/volmodels/heston/pde_kernel.py +395 -0
- quantark-0.2.0/quantark/volmodels/localvol/__init__.py +13 -0
- quantark-0.2.0/quantark/volmodels/localvol/dupire.py +181 -0
- quantark-0.2.0/quantark/volmodels/localvol/mc_kernel.py +95 -0
- quantark-0.2.0/quantark/volmodels/localvol/pde_kernel.py +153 -0
- quantark-0.2.0/quantark/volmodels/localvol/surface.py +85 -0
- quantark-0.2.0/quantark/volmodels/risk/__init__.py +40 -0
- quantark-0.2.0/quantark/volmodels/risk/contracts.py +370 -0
- quantark-0.2.0/quantark/volmodels/risk/scenarios.py +141 -0
- quantark-0.2.0/quantark/volmodels/slv/__init__.py +17 -0
- quantark-0.2.0/quantark/volmodels/slv/fokkerplanck/__init__.py +5 -0
- quantark-0.2.0/quantark/volmodels/slv/fokkerplanck/bootstrap.py +68 -0
- quantark-0.2.0/quantark/volmodels/slv/fokkerplanck/calibration.py +107 -0
- quantark-0.2.0/quantark/volmodels/slv/fokkerplanck/config.py +59 -0
- quantark-0.2.0/quantark/volmodels/slv/fokkerplanck/coordinates.py +88 -0
- quantark-0.2.0/quantark/volmodels/slv/fokkerplanck/fp_operators.py +136 -0
- quantark-0.2.0/quantark/volmodels/slv/fokkerplanck/fp_solver.py +108 -0
- quantark-0.2.0/quantark/volmodels/slv/leverage.py +149 -0
- quantark-0.2.0/quantark/volmodels/slv/slv_mc_kernel.py +216 -0
- quantark-0.2.0/quantark/volmodels/slv/slv_pde_kernel.py +281 -0
- quantark-0.1.1/quantark/asset/equity/riskmeasures/__init__.py +0 -7
- quantark-0.1.1/quantark/backtest/strategy/__init__.py +0 -28
- quantark-0.1.1/quantark/param/vol/__init__.py +0 -6
- quantark-0.1.1/quantark/priceenv/__init__.py +0 -7
- quantark-0.1.1/quantark/simm/calibration/accessors.py +0 -439
- quantark-0.1.1/quantark/simm/calibration/commodity.py +0 -156
- quantark-0.1.1/quantark/simm/calibration/credit_non_qualifying.py +0 -79
- quantark-0.1.1/quantark/simm/calibration/credit_qualifying.py +0 -130
- quantark-0.1.1/quantark/simm/calibration/equity.py +0 -125
- quantark-0.1.1/quantark/simm/calibration/fx.py +0 -92
- quantark-0.1.1/quantark/simm/calibration/ir.py +0 -152
- quantark-0.1.1/quantark/simm/engines/aggregation/bucket_aggregator.py +0 -298
- quantark-0.1.1/quantark/simm/engines/aggregation/concentration.py +0 -349
- quantark-0.1.1/quantark/simm/engines/aggregation/product_class_aggregator.py +0 -183
- quantark-0.1.1/quantark/simm/engines/aggregation/risk_class_aggregator.py +0 -403
- quantark-0.1.1/quantark/simm/engines/aggregation/simm_calculator.py +0 -430
- quantark-0.1.1/quantark/simm/engines/aggregation/weighted_sensitivity.py +0 -272
- quantark-0.1.1/quantark/simm/sensitivity.py +0 -533
- quantark-0.1.1/quantark/simm/taxonomy.py +0 -416
- {quantark-0.1.1 → quantark-0.2.0}/.gitignore +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/LICENSE +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/NOTICE +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/_compat.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/bond/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/bond/engine/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/bond/engine/analytical/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/bond/engine/analytical/black_engine.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/bond/engine/analytical/bond_forward_engine.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/bond/engine/analytical/bond_futures_engine.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/bond/engine/convertible/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/bond/engine/convertible/convertible_bond_engine.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/bond/engine/discount/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/bond/engine/discount/bond_discount_engine.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/bond/engine/discount/frn_engine.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/bond/engine/pde/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/bond/engine/pde/convertible/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/bond/engine/pde/convertible/jump_diffusion_engine.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/bond/engine/pde/convertible/pde_params.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/bond/engine/pde/convertible/tf_engine.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/bond/engine/tree/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/bond/engine/tree/convertible/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/bond/engine/tree/convertible/binomial_engine.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/bond/engine/tree/convertible/tree_params.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/bond/engine/tree/convertible/trinomial_engine.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/bond/product/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/bond/product/base_bond_product.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/bond/product/convertible/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/bond/product/convertible/convertible_bond.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/bond/product/couponbond/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/bond/product/couponbond/fixed_bond.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/bond/product/couponbond/frn.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/bond/product/forward/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/bond/product/forward/base_bond_forward.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/bond/product/forward/bond_forward.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/bond/product/futures/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/bond/product/futures/bond_futures.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/bond/product/option/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/bond/product/option/euro_short_term_bond_option.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/bond/riskmeasures/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/bond/riskmeasures/bond_greeks_calculator.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/bond/schedule/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/bond/schedule/cashflow.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/analysis/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/analysis/autocallable_path_analyzer.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/analytical/american_option_engine.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/analytical/barrier_analytical_engine.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/analytical/black_scholes_engine.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/analytical/deltaone_engine.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/analytical/digital_option_engine.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/analytical/double_barrier_option_engine.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/analytical/double_sharkfin_option_analytical_engine.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/analytical/one_touch_analytical_engine.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/analytical/range_accrual_analytical_engine.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/analytical/single_sharkfin_option_analytical_engine.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/event_stats.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/mc/american_option_mc_engine.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/mc/barrier_option_mc_engine.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/mc/digital_option_mc_engine.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/mc/double_sharkfin_option_mc_engine.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/mc/euro_mc_engine.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/mc/phoenix_mc_engine.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/mc/range_accrual_mc_engine.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/mc/single_sharkfin_option_mc_engine.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/mc/snowball_mc_engine.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/pde/american_pde_solver.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/pde/barrier_pde_solver.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/pde/double_barrier_pde_solver.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/pde/double_one_touch_pde_solver.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/pde/european_pde_solver.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/pde/ko_reset_snowball_pde_solver.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/pde/one_touch_pde_solver.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/pde/phoenix_pde_solver.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/pde/spatial_grid.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/pde/time_grid.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/quad/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/quad/discrete_quad_engine.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/quad/european_quad_engine.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/quad/quad_adapters.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/quad/quad_core.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/quad/quad_math.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/validation/script/benchmark_check_american_analytical.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/validation/script/benchmark_check_american_pde.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/validation/script/benchmark_check_asian_analytical.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/validation/script/benchmark_check_barrier_analytical.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/validation/script/benchmark_check_barrier_pde_solver.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/validation/script/benchmark_check_digital_option.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/validation/script/benchmark_check_snowball_pde_solver.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/validation/script/boundary_check_american_analytical.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/validation/script/boundary_check_american_pde.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/validation/script/boundary_check_asian_analytical.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/validation/script/boundary_check_barrier_analytical.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/validation/script/boundary_check_barrier_pde_solver.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/validation/script/boundary_check_digital_option.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/validation/script/boundary_check_snowball_pde_solver.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/validation/script/greeks_check_digital_option.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/validation/script/mc_comparison_barrier_pde.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/validation/script/quick_mc_compare.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/engine/validation/script/validation_stepdown_improved.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/param/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/param/engine_param_profiles.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/param/engine_params.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/process/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/process/bsm/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/process/bsm/bsm_process.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/product/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/product/base_equity_product.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/product/deltaone/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/product/deltaone/base_deltaone_product.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/product/deltaone/futures.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/product/deltaone/spot_instrument.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/product/option/american_option.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/product/option/barrier_option.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/product/option/base_equity_option.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/product/option/digital_option.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/product/option/double_barrier_option.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/product/option/double_one_touch_option.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/product/option/double_sharkfin_option.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/product/option/european_vanilla_option.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/product/option/ko_reset_snowball_option.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/product/option/observation_schedule.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/product/option/one_touch_option.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/product/option/phoenix_config.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/product/option/phoenix_helpers.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/product/option/phoenix_option.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/product/option/range_accrual_config.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/product/option/range_accrual_helpers.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/product/option/range_accrual_option.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/product/option/single_sharkfin_option.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/product/option/snowball_config.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/product/option/snowball_option.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/report/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/report/autocallable_risk_report.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/report/plotting.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/report/surfaces.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/report/term_structure.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/equity/riskmeasures/greeks_calculator.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/rate/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/rate/engine/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/rate/engine/cap_floor_engine.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/rate/engine/fra_engine.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/rate/engine/irs_discount_engine.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/rate/engine/swaption_engine.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/rate/product/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/rate/product/cap_floor.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/rate/product/fra.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/rate/product/irs.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/asset/rate/product/swaption.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/backtest/dashboard.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/backtest/equity/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/backtest/equity/hedge_executor.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/backtest/equity/metrics.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/backtest/examples/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/backtest/examples/advanced_backtest.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/backtest/examples/basic_delta_hedge.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/backtest/examples/fi_dv01_hedge.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/backtest/fi/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/backtest/fi/config.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/backtest/fi/engine.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/backtest/fi/hedge_executor.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/backtest/fi/metrics.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/backtest/fi/results.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/backtest/fi/state.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/backtest/logger.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/backtest/otc/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/backtest/otc/book_engine.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/backtest/otc/config.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/backtest/otc/dashboard.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/backtest/otc/engine.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/backtest/otc/engine_factory.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/backtest/otc/market.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/backtest/report_generator.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/backtest/strategy/convexity_neutral_strategy.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/backtest/strategy/delta_neutral_strategy.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/backtest/strategy/dv01_neutral_strategy.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/backtest/transaction_costs.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/backtest/visualizer.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/cashleg/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/cashleg/accrual_leg.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/cashleg/base.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/cashleg/base_amount.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/cashleg/deterministic_leg.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/cashleg/fixed_payoff_leg.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/cashleg/leg_schedule.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/cashleg/leg_valuator.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/dynamicscenario/equity/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/dynamicscenario/fi/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/dynamicscenario/fi/config.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/dynamicscenario/fi/engine.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/dynamicscenario/fi/results.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/dynamicscenario/path/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/dynamicscenario/path/fi_path_library.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/dynamicscenario/path/path_builder.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/dynamicscenario/path/path_library.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/dynamicscenario/report/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/dynamicscenario/report/visualizer.py +0 -0
- {quantark-0.1.1/quantark/asset/equity/process/bsm → quantark-0.2.0/quantark/montecarlo}/qmc_brownian_bridge.py +0 -0
- {quantark-0.1.1/quantark/asset/equity/process/bsm → quantark-0.2.0/quantark/montecarlo}/qmc_rqmc_driver.py +0 -0
- {quantark-0.1.1/quantark/asset/equity/process/bsm → quantark-0.2.0/quantark/montecarlo}/qmc_sobol.py +0 -0
- {quantark-0.1.1/quantark/asset/equity/process/bsm → quantark-0.2.0/quantark/montecarlo}/qmc_variance_reduction.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/param/basis/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/param/basis/basis_yield.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/param/div/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/param/div/dividend_yield.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/param/index/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/param/index/rate_index.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/param/quote/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/param/quote/spot_quote.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/param/rrf/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/param/rrf/rate_curve.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/portfolio/base.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/portfolio/fi/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/portfolio/fi/portfolio.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/portfolio/portfolio_snapshot.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/portfolio/portfolio_storage.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/priceenv/pricing_environment.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/rfq/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/rfq/builders.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/rfq/models.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/rfq/registry.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/rfq/service.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/simm/calibration/cross_risk.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/simm/calibration/version.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/simm/crif/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/simm/crif/models.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/simm/engines/aggregation/addon.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/simm/engines/classification/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/simm/engines/classification/bucket_mapper.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/simm/engines/result.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/simm/engines/risk_class/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/simm/report/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/simm/report/crif_export.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/simm/report/excel_generator.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/simm/report/html_generator.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/simm/results/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/simm/results/attribution.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/simm/results/whatif.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/stresstest/base.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/stresstest/config.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/stresstest/engine.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/stresstest/equity/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/stresstest/equity/config.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/stresstest/equity/engine.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/stresstest/equity/report/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/stresstest/equity/report/report_generator.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/stresstest/equity/report/visualizer.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/stresstest/equity/results.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/stresstest/fi/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/stresstest/fi/config.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/stresstest/fi/engine.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/stresstest/fi/metrics.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/stresstest/fi/results.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/stresstest/report/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/stresstest/report/report_generator.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/stresstest/report/visualizer.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/stresstest/results/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/stresstest/results/result_aggregator.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/stresstest/results/result_exporter.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/stresstest/results/stress_results.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/stresstest/scenario/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/stresstest/scenario/scenario.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/stresstest/scenario/scenario_builder.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/stresstest/scenario/scenario_library.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/stresstest/scenario/scenario_storage.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/stresstest/stress/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/stresstest/stress/stress_types.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/util/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/util/barrier_shift.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/util/calendar/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/util/calendar/day_counter.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/util/calendar/holidayfile/china.csv +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/util/calendar/holidayfile/china_sse.csv +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/util/enum/bond_enums.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/util/enum/deltaone_enums.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/util/enum/greeks_enums.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/util/exceptions.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/util/marketdata/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/util/marketdata/adapter/base_adapter.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/util/marketdata/adapter/mock_adapter.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/util/marketdata/converter.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/util/marketdata/example_usage.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/util/marketdata/generator/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/util/marketdata/generator/mock_generator.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/util/marketdata/models.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/util/marketdata/storage/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/util/marketdata/storage/parquet_storage.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/util/numerical/constants.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/util/numerical/formatting.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/util/numerical/pnl.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/util/numerical/safe_math.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/util/numerical/validation.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/var/attribution.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/var/backtest/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/var/backtest/var_backtester.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/var/base.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/var/config.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/var/engines/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/var/results/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/var/results/incremental_var_result.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/var/results/var_report.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/var/results/var_result.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/var/risk_factors/__init__.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/var/risk_factors/base.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/var/risk_factors/equity_factors.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark/var/risk_factors/fi_factors.py +0 -0
- {quantark-0.1.1 → quantark-0.2.0}/quantark_compat.pth +0 -0
|
@@ -5,6 +5,20 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
|
5
5
|
and the project adheres to [Semantic Versioning](https://semver.org/).
|
|
6
6
|
During 0.x the public API may still change between minor versions.
|
|
7
7
|
|
|
8
|
+
## [0.1.2] - 2026-06-13
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- Credit dual-measure framework: a recovery convention layer
|
|
12
|
+
(`quantark.asset.credit.conventions`, `STANDARD_RECOVERY=0.40`) that
|
|
13
|
+
separates the canonical shared-curve **hazard01** factor from the
|
|
14
|
+
recovery-converted **CS01** used by products and SIMM. Curve shocks stay
|
|
15
|
+
in hazard space; spread stresses convert through the recovery convention.
|
|
16
|
+
- Single-name CDS **roll-down / as-of pricing** via effective and maturity
|
|
17
|
+
dates (seasoned and forward-start), with `schedule_asof` and a
|
|
18
|
+
total-return coupon cash ledger threaded through the dynamic-scenario and
|
|
19
|
+
backtest engines. SIMM buckets the remaining tenor. (Basket as-of is
|
|
20
|
+
deferred.)
|
|
21
|
+
|
|
8
22
|
## [0.1.1] - 2026-06-11
|
|
9
23
|
|
|
10
24
|
### Added
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: quantark
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: Modular derivatives pricing and risk library: options, autocallables, bonds, VaR, SIMM
|
|
5
5
|
Project-URL: Homepage, https://github.com/deiiiiii93/quantark
|
|
6
6
|
Project-URL: Repository, https://github.com/deiiiiii93/quantark
|
|
@@ -34,6 +34,7 @@ Requires-Dist: pyyaml>=6.0.0
|
|
|
34
34
|
Requires-Dist: scipy>=1.10.0
|
|
35
35
|
Requires-Dist: seaborn>=0.12.0
|
|
36
36
|
Provides-Extra: dev
|
|
37
|
+
Requires-Dist: pytest-xdist>=3.0.0; extra == 'dev'
|
|
37
38
|
Requires-Dist: pytest>=7.0.0; extra == 'dev'
|
|
38
39
|
Description-Content-Type: text/markdown
|
|
39
40
|
|
|
@@ -73,6 +74,13 @@ QuantArk is designed with a clean, modular architecture that separates concerns
|
|
|
73
74
|
- Monte Carlo VaR (simulation-based with stress testing)
|
|
74
75
|
- **Bond Pricing**: Fixed rate bonds, FRNs, and bond options
|
|
75
76
|
- **Interest Rate Swaps**: Pricing and risk metrics (DV01)
|
|
77
|
+
- **FX Derivatives**: Garman-Kohlhagen vanilla, digital, and quanto options;
|
|
78
|
+
spot / forward / swap delta-one products with two-curve discounting
|
|
79
|
+
- **FX Portfolio & Risk**: `FXPortfolio` plus full integration with the
|
|
80
|
+
portfolio risk stack — FX stress testing, Value-at-Risk (parametric /
|
|
81
|
+
historical / Monte Carlo with two-rate factors), multi-day dynamic scenarios,
|
|
82
|
+
delta-neutral backtest hedging, and ISDA SIMM v2.6 initial margin
|
|
83
|
+
(one `FXPosition` feeds all five; see `example/fx_portfolio_risk_demo.py`)
|
|
76
84
|
- **Greeks Calculation**:
|
|
77
85
|
- Analytical Greeks using closed-form formulas
|
|
78
86
|
- Numerical Greeks using finite difference method (FDM)
|
|
@@ -168,6 +176,43 @@ print(f"Rho: {analytical_greeks['rho']:.6f}")
|
|
|
168
176
|
|
|
169
177
|
```
|
|
170
178
|
|
|
179
|
+
### FX Options
|
|
180
|
+
|
|
181
|
+
```python
|
|
182
|
+
from datetime import datetime
|
|
183
|
+
|
|
184
|
+
from quantark.asset.fx.engine.analytical import GarmanKohlhagenEngine
|
|
185
|
+
from quantark.asset.fx.product import CurrencyPair
|
|
186
|
+
from quantark.asset.fx.product.option import FxVanillaOption
|
|
187
|
+
from quantark.param import SpotQuote, FlatVolSurface, FlatRateCurve
|
|
188
|
+
from quantark.priceenv import FxPricingEnvironment
|
|
189
|
+
from quantark.util.enum import OptionType
|
|
190
|
+
|
|
191
|
+
fx_env = FxPricingEnvironment(
|
|
192
|
+
valuation_date=datetime(2026, 6, 12),
|
|
193
|
+
spot_quote=SpotQuote(spot=1.20), # EUR/USD
|
|
194
|
+
domestic_curve=FlatRateCurve(rate=0.05), # USD
|
|
195
|
+
foreign_curve=FlatRateCurve(rate=0.03), # EUR
|
|
196
|
+
vol_surface=FlatVolSurface(volatility=0.10),
|
|
197
|
+
)
|
|
198
|
+
|
|
199
|
+
option = FxVanillaOption(
|
|
200
|
+
currency_pair=CurrencyPair("EUR", "USD"),
|
|
201
|
+
strike=1.25,
|
|
202
|
+
option_type=OptionType.CALL,
|
|
203
|
+
maturity=1.0,
|
|
204
|
+
notional_foreign=1_000_000.0, # 1m EUR
|
|
205
|
+
)
|
|
206
|
+
|
|
207
|
+
engine = GarmanKohlhagenEngine()
|
|
208
|
+
print(f"Price: {engine.price(option, fx_env):,.2f} USD")
|
|
209
|
+
print(f"Delta: {engine.calculate_greeks(option, fx_env)['delta']:,.2f} EUR")
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
See `example/fx_vanilla_option_demo.py`, `example/fx_digital_option_demo.py`,
|
|
213
|
+
`example/fx_quanto_option_demo.py`, and `example/fx_deltaone_demo.py` for
|
|
214
|
+
digitals, quantos, and delta-one products.
|
|
215
|
+
|
|
171
216
|
For portfolio Value-at-Risk (parametric, historical, and Monte Carlo engines
|
|
172
217
|
with risk-factor attribution), see the runnable demos:
|
|
173
218
|
`example/parametric_var_demo.py`, `example/portfolio_var_demo.py`, and
|
|
@@ -217,6 +262,16 @@ The demo showcases:
|
|
|
217
262
|
3. Put-Call Parity verification
|
|
218
263
|
4. Comparison between analytical and numerical Greeks
|
|
219
264
|
|
|
265
|
+
### FX portfolio across the full risk stack
|
|
266
|
+
|
|
267
|
+
```bash
|
|
268
|
+
python example/fx_portfolio_risk_demo.py # one FX book through all four risk modules
|
|
269
|
+
python example/fx_stress_test_demo.py # FX stress testing (spot/vol/two-rate shocks)
|
|
270
|
+
python example/fx_var_demo.py # FX VaR (parametric / historical / Monte Carlo)
|
|
271
|
+
python example/fx_dynamic_scenario_demo.py # multi-day FX path simulation
|
|
272
|
+
python example/fx_backtest_demo.py # FX delta-neutral hedging backtest
|
|
273
|
+
```
|
|
274
|
+
|
|
220
275
|
## Project Structure
|
|
221
276
|
|
|
222
277
|
```
|
|
@@ -241,10 +296,16 @@ QuantArk/
|
|
|
241
296
|
│ │ ├── engine/ # Bond pricing engines
|
|
242
297
|
│ │ ├── product/ # Bond products
|
|
243
298
|
│ │ └── riskmeasures/ # Bond risk measures
|
|
244
|
-
│
|
|
245
|
-
│
|
|
246
|
-
│
|
|
247
|
-
│
|
|
299
|
+
│ ├── rate/ # Interest rate derivatives
|
|
300
|
+
│ │ ├── engine/ # IR pricing engines
|
|
301
|
+
│ │ ├── product/ # IR products
|
|
302
|
+
│ │ └── riskmeasures/ # IR risk measures
|
|
303
|
+
│ └── fx/ # FX derivatives
|
|
304
|
+
│ ├── engine/ # Garman-Kohlhagen, digital, quanto, delta-one
|
|
305
|
+
│ ├── process/ # Garman-Kohlhagen process
|
|
306
|
+
│ ├── product/ # Options (vanilla/digital/quanto) and delta-one
|
|
307
|
+
│ ├── report/ # Formatted pricing reports
|
|
308
|
+
│ └── riskmeasures/ # FX Greeks calculator
|
|
248
309
|
├── param/ # Market data parameters
|
|
249
310
|
│ ├── div/ # Dividend yields
|
|
250
311
|
│ ├── quote/ # Spot quotes
|
|
@@ -265,10 +326,11 @@ QuantArk/
|
|
|
265
326
|
│ └── config.py # VaR configuration
|
|
266
327
|
├── portfolio/ # Portfolio management
|
|
267
328
|
│ ├── equity/ # Equity portfolios
|
|
268
|
-
│
|
|
269
|
-
|
|
270
|
-
├──
|
|
271
|
-
├──
|
|
329
|
+
│ ├── fi/ # Fixed income portfolios
|
|
330
|
+
│ └── fx/ # FX portfolios (FXPortfolio / FXPosition)
|
|
331
|
+
├── backtest/ # Hedging strategy backtesting (equity / fi / fx)
|
|
332
|
+
├── dynamicscenario/ # Multi-day scenario simulation (equity / fi / fx)
|
|
333
|
+
├── stresstest/ # Stress testing framework (equity / fi / fx)
|
|
272
334
|
├── util/ # Utilities
|
|
273
335
|
│ ├── enum/ # Enumerations
|
|
274
336
|
│ └── exceptions.py # Exception hierarchy
|
|
@@ -34,6 +34,13 @@ QuantArk is designed with a clean, modular architecture that separates concerns
|
|
|
34
34
|
- Monte Carlo VaR (simulation-based with stress testing)
|
|
35
35
|
- **Bond Pricing**: Fixed rate bonds, FRNs, and bond options
|
|
36
36
|
- **Interest Rate Swaps**: Pricing and risk metrics (DV01)
|
|
37
|
+
- **FX Derivatives**: Garman-Kohlhagen vanilla, digital, and quanto options;
|
|
38
|
+
spot / forward / swap delta-one products with two-curve discounting
|
|
39
|
+
- **FX Portfolio & Risk**: `FXPortfolio` plus full integration with the
|
|
40
|
+
portfolio risk stack — FX stress testing, Value-at-Risk (parametric /
|
|
41
|
+
historical / Monte Carlo with two-rate factors), multi-day dynamic scenarios,
|
|
42
|
+
delta-neutral backtest hedging, and ISDA SIMM v2.6 initial margin
|
|
43
|
+
(one `FXPosition` feeds all five; see `example/fx_portfolio_risk_demo.py`)
|
|
37
44
|
- **Greeks Calculation**:
|
|
38
45
|
- Analytical Greeks using closed-form formulas
|
|
39
46
|
- Numerical Greeks using finite difference method (FDM)
|
|
@@ -129,6 +136,43 @@ print(f"Rho: {analytical_greeks['rho']:.6f}")
|
|
|
129
136
|
|
|
130
137
|
```
|
|
131
138
|
|
|
139
|
+
### FX Options
|
|
140
|
+
|
|
141
|
+
```python
|
|
142
|
+
from datetime import datetime
|
|
143
|
+
|
|
144
|
+
from quantark.asset.fx.engine.analytical import GarmanKohlhagenEngine
|
|
145
|
+
from quantark.asset.fx.product import CurrencyPair
|
|
146
|
+
from quantark.asset.fx.product.option import FxVanillaOption
|
|
147
|
+
from quantark.param import SpotQuote, FlatVolSurface, FlatRateCurve
|
|
148
|
+
from quantark.priceenv import FxPricingEnvironment
|
|
149
|
+
from quantark.util.enum import OptionType
|
|
150
|
+
|
|
151
|
+
fx_env = FxPricingEnvironment(
|
|
152
|
+
valuation_date=datetime(2026, 6, 12),
|
|
153
|
+
spot_quote=SpotQuote(spot=1.20), # EUR/USD
|
|
154
|
+
domestic_curve=FlatRateCurve(rate=0.05), # USD
|
|
155
|
+
foreign_curve=FlatRateCurve(rate=0.03), # EUR
|
|
156
|
+
vol_surface=FlatVolSurface(volatility=0.10),
|
|
157
|
+
)
|
|
158
|
+
|
|
159
|
+
option = FxVanillaOption(
|
|
160
|
+
currency_pair=CurrencyPair("EUR", "USD"),
|
|
161
|
+
strike=1.25,
|
|
162
|
+
option_type=OptionType.CALL,
|
|
163
|
+
maturity=1.0,
|
|
164
|
+
notional_foreign=1_000_000.0, # 1m EUR
|
|
165
|
+
)
|
|
166
|
+
|
|
167
|
+
engine = GarmanKohlhagenEngine()
|
|
168
|
+
print(f"Price: {engine.price(option, fx_env):,.2f} USD")
|
|
169
|
+
print(f"Delta: {engine.calculate_greeks(option, fx_env)['delta']:,.2f} EUR")
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
See `example/fx_vanilla_option_demo.py`, `example/fx_digital_option_demo.py`,
|
|
173
|
+
`example/fx_quanto_option_demo.py`, and `example/fx_deltaone_demo.py` for
|
|
174
|
+
digitals, quantos, and delta-one products.
|
|
175
|
+
|
|
132
176
|
For portfolio Value-at-Risk (parametric, historical, and Monte Carlo engines
|
|
133
177
|
with risk-factor attribution), see the runnable demos:
|
|
134
178
|
`example/parametric_var_demo.py`, `example/portfolio_var_demo.py`, and
|
|
@@ -178,6 +222,16 @@ The demo showcases:
|
|
|
178
222
|
3. Put-Call Parity verification
|
|
179
223
|
4. Comparison between analytical and numerical Greeks
|
|
180
224
|
|
|
225
|
+
### FX portfolio across the full risk stack
|
|
226
|
+
|
|
227
|
+
```bash
|
|
228
|
+
python example/fx_portfolio_risk_demo.py # one FX book through all four risk modules
|
|
229
|
+
python example/fx_stress_test_demo.py # FX stress testing (spot/vol/two-rate shocks)
|
|
230
|
+
python example/fx_var_demo.py # FX VaR (parametric / historical / Monte Carlo)
|
|
231
|
+
python example/fx_dynamic_scenario_demo.py # multi-day FX path simulation
|
|
232
|
+
python example/fx_backtest_demo.py # FX delta-neutral hedging backtest
|
|
233
|
+
```
|
|
234
|
+
|
|
181
235
|
## Project Structure
|
|
182
236
|
|
|
183
237
|
```
|
|
@@ -202,10 +256,16 @@ QuantArk/
|
|
|
202
256
|
│ │ ├── engine/ # Bond pricing engines
|
|
203
257
|
│ │ ├── product/ # Bond products
|
|
204
258
|
│ │ └── riskmeasures/ # Bond risk measures
|
|
205
|
-
│
|
|
206
|
-
│
|
|
207
|
-
│
|
|
208
|
-
│
|
|
259
|
+
│ ├── rate/ # Interest rate derivatives
|
|
260
|
+
│ │ ├── engine/ # IR pricing engines
|
|
261
|
+
│ │ ├── product/ # IR products
|
|
262
|
+
│ │ └── riskmeasures/ # IR risk measures
|
|
263
|
+
│ └── fx/ # FX derivatives
|
|
264
|
+
│ ├── engine/ # Garman-Kohlhagen, digital, quanto, delta-one
|
|
265
|
+
│ ├── process/ # Garman-Kohlhagen process
|
|
266
|
+
│ ├── product/ # Options (vanilla/digital/quanto) and delta-one
|
|
267
|
+
│ ├── report/ # Formatted pricing reports
|
|
268
|
+
│ └── riskmeasures/ # FX Greeks calculator
|
|
209
269
|
├── param/ # Market data parameters
|
|
210
270
|
│ ├── div/ # Dividend yields
|
|
211
271
|
│ ├── quote/ # Spot quotes
|
|
@@ -226,10 +286,11 @@ QuantArk/
|
|
|
226
286
|
│ └── config.py # VaR configuration
|
|
227
287
|
├── portfolio/ # Portfolio management
|
|
228
288
|
│ ├── equity/ # Equity portfolios
|
|
229
|
-
│
|
|
230
|
-
|
|
231
|
-
├──
|
|
232
|
-
├──
|
|
289
|
+
│ ├── fi/ # Fixed income portfolios
|
|
290
|
+
│ └── fx/ # FX portfolios (FXPortfolio / FXPosition)
|
|
291
|
+
├── backtest/ # Hedging strategy backtesting (equity / fi / fx)
|
|
292
|
+
├── dynamicscenario/ # Multi-day scenario simulation (equity / fi / fx)
|
|
293
|
+
├── stresstest/ # Stress testing framework (equity / fi / fx)
|
|
233
294
|
├── util/ # Utilities
|
|
234
295
|
│ ├── enum/ # Enumerations
|
|
235
296
|
│ └── exceptions.py # Exception hierarchy
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "quantark"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.2.0"
|
|
8
8
|
description = "Modular derivatives pricing and risk library: options, autocallables, bonds, VaR, SIMM"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10"
|
|
@@ -42,7 +42,7 @@ dependencies = [
|
|
|
42
42
|
]
|
|
43
43
|
|
|
44
44
|
[project.optional-dependencies]
|
|
45
|
-
dev = ["pytest>=7.0.0"]
|
|
45
|
+
dev = ["pytest>=7.0.0", "pytest-xdist>=3.0.0"]
|
|
46
46
|
|
|
47
47
|
[project.urls]
|
|
48
48
|
Homepage = "https://github.com/deiiiiii93/quantark"
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"""Credit derivatives asset class (CDS, basket CDS)."""
|
|
2
|
+
from quantark.asset.credit.product import (
|
|
3
|
+
CDS,
|
|
4
|
+
ProtectionSide,
|
|
5
|
+
BasketCDS,
|
|
6
|
+
BasketType,
|
|
7
|
+
CopulaType,
|
|
8
|
+
)
|
|
9
|
+
from quantark.asset.credit.engine.analytical import CDSReducedFormEngine
|
|
10
|
+
from quantark.asset.credit.engine.mc import BasketCDSEngine
|
|
11
|
+
|
|
12
|
+
__all__ = [
|
|
13
|
+
"CDS",
|
|
14
|
+
"ProtectionSide",
|
|
15
|
+
"BasketCDS",
|
|
16
|
+
"BasketType",
|
|
17
|
+
"CopulaType",
|
|
18
|
+
"CDSReducedFormEngine",
|
|
19
|
+
"BasketCDSEngine",
|
|
20
|
+
]
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Market conventions for translating between CDS quoted spreads and hazard
|
|
3
|
+
intensities.
|
|
4
|
+
|
|
5
|
+
Under the credit triangle ``s = lambda (1 - R)`` a quoted-spread move maps to a
|
|
6
|
+
hazard-intensity move only once a recovery rate is fixed. The hazard curve is
|
|
7
|
+
shared across positions that may carry different contractual recoveries, so a
|
|
8
|
+
*curve-level* spread shock is undefined unless a recovery convention is supplied
|
|
9
|
+
explicitly; this module provides the ISDA-standard default and the conversion.
|
|
10
|
+
"""
|
|
11
|
+
from quantark.util.exceptions import ValidationError
|
|
12
|
+
|
|
13
|
+
#: ISDA-standard senior-unsecured recovery, used as the default convention when
|
|
14
|
+
#: a curve-level spread shock must be converted to a hazard shift and no
|
|
15
|
+
#: instrument-specific recovery is supplied.
|
|
16
|
+
STANDARD_RECOVERY = 0.40
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def spread_shift_to_hazard_shift(
|
|
20
|
+
spread_shift: float, recovery: float = STANDARD_RECOVERY
|
|
21
|
+
) -> float:
|
|
22
|
+
"""Absolute spread move -> hazard move: ``Δlambda = Δs / (1 - R)``."""
|
|
23
|
+
lgd = 1.0 - recovery
|
|
24
|
+
if lgd <= 1e-6:
|
|
25
|
+
raise ValidationError(
|
|
26
|
+
"Spread-to-hazard conversion is undefined at full recovery (R=1): "
|
|
27
|
+
"the spread s = lambda (1 - R) is identically zero."
|
|
28
|
+
)
|
|
29
|
+
return spread_shift / lgd
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
"""
|
|
2
|
+
CDS pricing engine for a reduced-form model (hazard read from the curve).
|
|
3
|
+
|
|
4
|
+
The premium and protection legs are valued by numerical integration of the
|
|
5
|
+
survival and discount curves supplied by the
|
|
6
|
+
:class:`~quantark.priceenv.CreditPricingEnvironment`. The hazard curve may be
|
|
7
|
+
flat (constant intensity) or term-structured; this engine reads survival and
|
|
8
|
+
default-density from the curve and so handles both.
|
|
9
|
+
"""
|
|
10
|
+
import math
|
|
11
|
+
from typing import Dict, List, Tuple
|
|
12
|
+
|
|
13
|
+
import numpy as np
|
|
14
|
+
|
|
15
|
+
from quantark.asset.credit.engine.base_credit_engine import BaseCreditEngine
|
|
16
|
+
from quantark.asset.credit.engine.schedule import (
|
|
17
|
+
cds_coupon_schedule,
|
|
18
|
+
cds_coupon_schedule_asof,
|
|
19
|
+
year_fraction_act365,
|
|
20
|
+
)
|
|
21
|
+
from quantark.asset.credit.product.cds import CDS
|
|
22
|
+
from quantark.priceenv import CreditPricingEnvironment
|
|
23
|
+
from quantark.util.exceptions import NumericalError
|
|
24
|
+
|
|
25
|
+
# Daily integration step (years) for the protection leg and premium accrual.
|
|
26
|
+
_DT = 1.0 / 365.0
|
|
27
|
+
# Remaining maturities below this (years) are treated as a matured contract.
|
|
28
|
+
_EPS = 1e-9
|
|
29
|
+
|
|
30
|
+
# Zero result returned for a matured / expired CDS.
|
|
31
|
+
_EXPIRED: Dict[str, float] = {
|
|
32
|
+
"premium_leg": 0.0,
|
|
33
|
+
"protection_leg": 0.0,
|
|
34
|
+
"fair_spread": 0.0,
|
|
35
|
+
"fair_spread_bps": 0.0,
|
|
36
|
+
"present_value": 0.0,
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def _time_grid(start: float, end: float) -> np.ndarray:
|
|
41
|
+
"""Integration grid on ``[start, end]`` ending exactly at ``end``.
|
|
42
|
+
|
|
43
|
+
``start`` is the protection-start offset (years from the valuation date),
|
|
44
|
+
nonzero only for a forward-starting contract whose effective date lies in
|
|
45
|
+
the future; it is zero for a spot or seasoned trade.
|
|
46
|
+
"""
|
|
47
|
+
span = max(end - start, 0.0)
|
|
48
|
+
n_steps = max(1, int(math.ceil(span / _DT)))
|
|
49
|
+
return np.linspace(start, end, n_steps + 1)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
class CDSReducedFormEngine(BaseCreditEngine):
|
|
53
|
+
"""Reduced-form CDS pricing engine valuing premium and protection legs."""
|
|
54
|
+
|
|
55
|
+
def price(self, product: CDS, env: CreditPricingEnvironment) -> float:
|
|
56
|
+
"""Present value to the protection holder per ``product.side``."""
|
|
57
|
+
res = self.calculate(product, env)
|
|
58
|
+
return product.side_sign * res["present_value"]
|
|
59
|
+
|
|
60
|
+
def calculate(self, product: CDS, env: CreditPricingEnvironment) -> Dict[str, float]:
|
|
61
|
+
"""
|
|
62
|
+
Value both legs and the fair spread.
|
|
63
|
+
|
|
64
|
+
Returns a dict with ``premium_leg``, ``protection_leg``,
|
|
65
|
+
``fair_spread``, ``fair_spread_bps`` and ``present_value`` — the last
|
|
66
|
+
always from the protection *buyer*'s perspective
|
|
67
|
+
(``protection_leg - premium_leg``).
|
|
68
|
+
|
|
69
|
+
For a *dated* contract (``product.effective_date`` set) the contract is
|
|
70
|
+
valued as of ``env.valuation_date``: settled coupons are excluded, the
|
|
71
|
+
remaining maturity is measured from the contractual dates, and a matured
|
|
72
|
+
contract values to zero.
|
|
73
|
+
"""
|
|
74
|
+
schedule, prot_start, prot_end, as_of_time = self._as_of_params(product, env)
|
|
75
|
+
if prot_end <= prot_start + _EPS: # matured — nothing left to value
|
|
76
|
+
return dict(_EXPIRED)
|
|
77
|
+
|
|
78
|
+
protection_leg = self._protection_leg(product, env, prot_start, prot_end)
|
|
79
|
+
rpv01 = self._premium_leg(
|
|
80
|
+
product, env, 1.0, schedule, prot_start, prot_end, as_of_time
|
|
81
|
+
)
|
|
82
|
+
if rpv01 <= 0:
|
|
83
|
+
raise NumericalError("CDS risky annuity (RPV01) is non-positive")
|
|
84
|
+
|
|
85
|
+
premium_leg = product.coupon_spread * rpv01
|
|
86
|
+
present_value = protection_leg - premium_leg
|
|
87
|
+
fair_spread = protection_leg / rpv01
|
|
88
|
+
return {
|
|
89
|
+
"premium_leg": premium_leg,
|
|
90
|
+
"protection_leg": protection_leg,
|
|
91
|
+
"fair_spread": fair_spread,
|
|
92
|
+
"fair_spread_bps": fair_spread * 10_000.0,
|
|
93
|
+
"present_value": present_value,
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
def fair_spread(self, product: CDS, env: CreditPricingEnvironment) -> float:
|
|
97
|
+
"""Par (fair) running spread that sets the contract PV to zero."""
|
|
98
|
+
return self.calculate(product, env)["fair_spread"]
|
|
99
|
+
|
|
100
|
+
# ------------------------------------------------------------------ #
|
|
101
|
+
# As-of resolution
|
|
102
|
+
# ------------------------------------------------------------------ #
|
|
103
|
+
@staticmethod
|
|
104
|
+
def _as_of_params(
|
|
105
|
+
product: CDS, env: CreditPricingEnvironment
|
|
106
|
+
) -> Tuple[List[Tuple[float, float]], float, float, float]:
|
|
107
|
+
"""
|
|
108
|
+
Resolve ``(schedule, protection_start, protection_end, as_of_time)`` for
|
|
109
|
+
valuation, with all times measured *from the valuation date* (consistent
|
|
110
|
+
with the as-of-dated discount and survival curves).
|
|
111
|
+
|
|
112
|
+
* ``protection_start`` — years until protection begins. Zero for a spot
|
|
113
|
+
or seasoned trade; positive for a forward-starting contract whose
|
|
114
|
+
effective date is still in the future.
|
|
115
|
+
* ``protection_end`` — years until the contract matures.
|
|
116
|
+
* ``as_of_time`` — *signed* seasoning: years elapsed since the effective
|
|
117
|
+
date (negative before the effective date). Used to anchor the
|
|
118
|
+
accrued-on-default leg to the original coupon calendar.
|
|
119
|
+
|
|
120
|
+
For an un-dated contract this is the legacy tenor-based schedule starting
|
|
121
|
+
immediately (``protection_start = 0``, ``as_of_time = 0``).
|
|
122
|
+
"""
|
|
123
|
+
if not product.is_dated:
|
|
124
|
+
schedule = cds_coupon_schedule(product.maturity, product.payment_freq)
|
|
125
|
+
return schedule, 0.0, product.maturity, 0.0
|
|
126
|
+
|
|
127
|
+
as_of_time = year_fraction_act365(product.effective_date, env.valuation_date)
|
|
128
|
+
total = year_fraction_act365(product.effective_date, product.maturity_date)
|
|
129
|
+
protection_end = total - as_of_time
|
|
130
|
+
protection_start = max(0.0, -as_of_time) # forward-start delay, else 0
|
|
131
|
+
if protection_end <= protection_start + _EPS:
|
|
132
|
+
return [], protection_start, protection_end, as_of_time
|
|
133
|
+
schedule = cds_coupon_schedule_asof(
|
|
134
|
+
product.effective_date,
|
|
135
|
+
product.maturity_date,
|
|
136
|
+
product.payment_freq,
|
|
137
|
+
env.valuation_date,
|
|
138
|
+
)
|
|
139
|
+
return schedule, protection_start, protection_end, as_of_time
|
|
140
|
+
|
|
141
|
+
# ------------------------------------------------------------------ #
|
|
142
|
+
# Legs
|
|
143
|
+
# ------------------------------------------------------------------ #
|
|
144
|
+
def _protection_leg(
|
|
145
|
+
self,
|
|
146
|
+
product: CDS,
|
|
147
|
+
env: CreditPricingEnvironment,
|
|
148
|
+
prot_start: float,
|
|
149
|
+
prot_end: float,
|
|
150
|
+
) -> float:
|
|
151
|
+
"""PV of the default-contingent payment N*(1-R)*E[DF * default density].
|
|
152
|
+
|
|
153
|
+
Integrated only over the live protection window ``[prot_start, prot_end]``
|
|
154
|
+
(times from the valuation date). ``prot_start`` is nonzero only for a
|
|
155
|
+
forward-starting contract, so no protection is credited before the
|
|
156
|
+
effective date.
|
|
157
|
+
"""
|
|
158
|
+
lgd = product.notional * (1.0 - product.recovery_rate)
|
|
159
|
+
grid = _time_grid(prot_start, prot_end)
|
|
160
|
+
pv = 0.0
|
|
161
|
+
for i in range(1, len(grid)):
|
|
162
|
+
t = float(grid[i])
|
|
163
|
+
density = env.get_default_density(t)
|
|
164
|
+
discount = env.get_discount_factor(t)
|
|
165
|
+
pv += lgd * discount * density * (t - float(grid[i - 1]))
|
|
166
|
+
return pv
|
|
167
|
+
|
|
168
|
+
def _premium_leg(
|
|
169
|
+
self,
|
|
170
|
+
product: CDS,
|
|
171
|
+
env: CreditPricingEnvironment,
|
|
172
|
+
spread: float,
|
|
173
|
+
schedule: List[Tuple[float, float]],
|
|
174
|
+
prot_start: float,
|
|
175
|
+
prot_end: float,
|
|
176
|
+
as_of_time: float,
|
|
177
|
+
) -> float:
|
|
178
|
+
"""
|
|
179
|
+
PV of the premium leg for a given running ``spread``.
|
|
180
|
+
|
|
181
|
+
Linear in ``spread``; calling with ``spread=1.0`` yields the risky
|
|
182
|
+
annuity (RPV01). Includes scheduled coupons (survival-weighted) plus
|
|
183
|
+
premium accrued from the last coupon date to the default date. ``schedule``
|
|
184
|
+
already holds only the unsettled coupons with payment times relative to
|
|
185
|
+
the valuation date; ``as_of_time`` is the signed seasoning offset so the
|
|
186
|
+
accrued-on-default leg references the correct contractual coupon dates,
|
|
187
|
+
and accrual is only credited inside the live protection window.
|
|
188
|
+
"""
|
|
189
|
+
notional = product.notional
|
|
190
|
+
payment_interval = 1.0 / product.payment_freq
|
|
191
|
+
|
|
192
|
+
# Scheduled coupon payments, conditional on survival. The schedule
|
|
193
|
+
# includes the final (possibly short) stub coupon ending at maturity,
|
|
194
|
+
# and each coupon's accrual is the actual period since the prior coupon.
|
|
195
|
+
pv_scheduled = 0.0
|
|
196
|
+
for t, accrual in schedule:
|
|
197
|
+
survival = env.get_survival_probability(t)
|
|
198
|
+
discount = env.get_discount_factor(t)
|
|
199
|
+
pv_scheduled += spread * notional * accrual * discount * survival
|
|
200
|
+
|
|
201
|
+
# Premium accrued to the default date (paid on default). The default
|
|
202
|
+
# time ``t`` is measured from valuation; the contractual elapsed time is
|
|
203
|
+
# ``as_of_time + t`` so the last coupon date is found on the original
|
|
204
|
+
# calendar. Accrual is credited only over the live protection window
|
|
205
|
+
# (a forward-starting trade accrues nothing before its effective date).
|
|
206
|
+
grid = _time_grid(prot_start, prot_end)
|
|
207
|
+
pv_accrued = 0.0
|
|
208
|
+
for i in range(1, len(grid)):
|
|
209
|
+
t = float(grid[i])
|
|
210
|
+
contractual_t = as_of_time + t
|
|
211
|
+
last_payment_time = payment_interval * int(contractual_t / payment_interval)
|
|
212
|
+
if last_payment_time >= contractual_t:
|
|
213
|
+
last_payment_time -= payment_interval
|
|
214
|
+
accrual_period = contractual_t - last_payment_time
|
|
215
|
+
density = env.get_default_density(t)
|
|
216
|
+
discount = env.get_discount_factor(t)
|
|
217
|
+
accrued = spread * notional * accrual_period
|
|
218
|
+
pv_accrued += accrued * discount * density * (t - float(grid[i - 1]))
|
|
219
|
+
|
|
220
|
+
return pv_scheduled + pv_accrued
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Base class for credit pricing engines.
|
|
3
|
+
"""
|
|
4
|
+
from abc import ABC, abstractmethod
|
|
5
|
+
from typing import Dict
|
|
6
|
+
|
|
7
|
+
from quantark.asset.credit.product.base_credit_product import BaseCreditProduct
|
|
8
|
+
from quantark.priceenv import CreditPricingEnvironment
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class BaseCreditEngine(ABC):
|
|
12
|
+
"""
|
|
13
|
+
Abstract base class for credit pricing engines.
|
|
14
|
+
|
|
15
|
+
Engines compute present values and risk measures from a product
|
|
16
|
+
specification and a :class:`CreditPricingEnvironment`.
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
@abstractmethod
|
|
20
|
+
def price(
|
|
21
|
+
self, product: BaseCreditProduct, env: CreditPricingEnvironment
|
|
22
|
+
) -> float:
|
|
23
|
+
"""Present value of the product from the position holder's perspective."""
|
|
24
|
+
|
|
25
|
+
def calculate_greeks(
|
|
26
|
+
self, product: BaseCreditProduct, env: CreditPricingEnvironment
|
|
27
|
+
) -> Dict[str, float]:
|
|
28
|
+
"""Risk measures for the product. Default: not implemented per engine."""
|
|
29
|
+
raise NotImplementedError(
|
|
30
|
+
f"{type(self).__name__} does not implement calculate_greeks"
|
|
31
|
+
)
|