@insiderfinance/totalfinance 0.1.0
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.
- package/LICENSE +201 -0
- package/README.md +339 -0
- package/STABILITY.md +23 -0
- package/modules/backtest/dist/artifacts.d.ts +23 -0
- package/modules/backtest/dist/artifacts.d.ts.map +1 -0
- package/modules/backtest/dist/artifacts.js +22 -0
- package/modules/backtest/dist/artifacts.js.map +1 -0
- package/modules/backtest/dist/broker.d.ts +265 -0
- package/modules/backtest/dist/broker.d.ts.map +1 -0
- package/modules/backtest/dist/broker.js +1228 -0
- package/modules/backtest/dist/broker.js.map +1 -0
- package/modules/backtest/dist/costs.d.ts +67 -0
- package/modules/backtest/dist/costs.d.ts.map +1 -0
- package/modules/backtest/dist/costs.js +171 -0
- package/modules/backtest/dist/costs.js.map +1 -0
- package/modules/backtest/dist/cross-sectional/engine.d.ts +21 -0
- package/modules/backtest/dist/cross-sectional/engine.d.ts.map +1 -0
- package/modules/backtest/dist/cross-sectional/engine.js +1399 -0
- package/modules/backtest/dist/cross-sectional/engine.js.map +1 -0
- package/modules/backtest/dist/cross-sectional/folds.d.ts +134 -0
- package/modules/backtest/dist/cross-sectional/folds.d.ts.map +1 -0
- package/modules/backtest/dist/cross-sectional/folds.js +375 -0
- package/modules/backtest/dist/cross-sectional/folds.js.map +1 -0
- package/modules/backtest/dist/cross-sectional/grid.d.ts +142 -0
- package/modules/backtest/dist/cross-sectional/grid.d.ts.map +1 -0
- package/modules/backtest/dist/cross-sectional/grid.js +394 -0
- package/modules/backtest/dist/cross-sectional/grid.js.map +1 -0
- package/modules/backtest/dist/cross-sectional/index.d.ts +18 -0
- package/modules/backtest/dist/cross-sectional/index.d.ts.map +1 -0
- package/modules/backtest/dist/cross-sectional/index.js +15 -0
- package/modules/backtest/dist/cross-sectional/index.js.map +1 -0
- package/modules/backtest/dist/cross-sectional/types.d.ts +331 -0
- package/modules/backtest/dist/cross-sectional/types.d.ts.map +1 -0
- package/modules/backtest/dist/cross-sectional/types.js +12 -0
- package/modules/backtest/dist/cross-sectional/types.js.map +1 -0
- package/modules/backtest/dist/cross-sectional/validate.d.ts +22 -0
- package/modules/backtest/dist/cross-sectional/validate.d.ts.map +1 -0
- package/modules/backtest/dist/cross-sectional/validate.js +489 -0
- package/modules/backtest/dist/cross-sectional/validate.js.map +1 -0
- package/modules/backtest/dist/diagnostics.d.ts +16 -0
- package/modules/backtest/dist/diagnostics.d.ts.map +1 -0
- package/modules/backtest/dist/diagnostics.js +63 -0
- package/modules/backtest/dist/diagnostics.js.map +1 -0
- package/modules/backtest/dist/environment/bench.d.ts +34 -0
- package/modules/backtest/dist/environment/bench.d.ts.map +1 -0
- package/modules/backtest/dist/environment/bench.js +724 -0
- package/modules/backtest/dist/environment/bench.js.map +1 -0
- package/modules/backtest/dist/environment/environment.d.ts +5 -0
- package/modules/backtest/dist/environment/environment.d.ts.map +1 -0
- package/modules/backtest/dist/environment/environment.js +618 -0
- package/modules/backtest/dist/environment/environment.js.map +1 -0
- package/modules/backtest/dist/environment/episode.d.ts +4 -0
- package/modules/backtest/dist/environment/episode.d.ts.map +1 -0
- package/modules/backtest/dist/environment/episode.js +121 -0
- package/modules/backtest/dist/environment/episode.js.map +1 -0
- package/modules/backtest/dist/environment/episodes.d.ts +14 -0
- package/modules/backtest/dist/environment/episodes.d.ts.map +1 -0
- package/modules/backtest/dist/environment/episodes.js +644 -0
- package/modules/backtest/dist/environment/episodes.js.map +1 -0
- package/modules/backtest/dist/environment/features.d.ts +31 -0
- package/modules/backtest/dist/environment/features.d.ts.map +1 -0
- package/modules/backtest/dist/environment/features.js +157 -0
- package/modules/backtest/dist/environment/features.js.map +1 -0
- package/modules/backtest/dist/environment/index.d.ts +14 -0
- package/modules/backtest/dist/environment/index.d.ts.map +1 -0
- package/modules/backtest/dist/environment/index.js +12 -0
- package/modules/backtest/dist/environment/index.js.map +1 -0
- package/modules/backtest/dist/environment/limits.d.ts +63 -0
- package/modules/backtest/dist/environment/limits.d.ts.map +1 -0
- package/modules/backtest/dist/environment/limits.js +253 -0
- package/modules/backtest/dist/environment/limits.js.map +1 -0
- package/modules/backtest/dist/environment/reward.d.ts +5 -0
- package/modules/backtest/dist/environment/reward.d.ts.map +1 -0
- package/modules/backtest/dist/environment/reward.js +80 -0
- package/modules/backtest/dist/environment/reward.js.map +1 -0
- package/modules/backtest/dist/environment/types.d.ts +540 -0
- package/modules/backtest/dist/environment/types.d.ts.map +1 -0
- package/modules/backtest/dist/environment/types.js +2 -0
- package/modules/backtest/dist/environment/types.js.map +1 -0
- package/modules/backtest/dist/environment/validate.d.ts +23 -0
- package/modules/backtest/dist/environment/validate.d.ts.map +1 -0
- package/modules/backtest/dist/environment/validate.js +264 -0
- package/modules/backtest/dist/environment/validate.js.map +1 -0
- package/modules/backtest/dist/event-driven.d.ts +111 -0
- package/modules/backtest/dist/event-driven.d.ts.map +1 -0
- package/modules/backtest/dist/event-driven.js +325 -0
- package/modules/backtest/dist/event-driven.js.map +1 -0
- package/modules/backtest/dist/execution/conformance.d.ts +33 -0
- package/modules/backtest/dist/execution/conformance.d.ts.map +1 -0
- package/modules/backtest/dist/execution/conformance.js +269 -0
- package/modules/backtest/dist/execution/conformance.js.map +1 -0
- package/modules/backtest/dist/execution/fill-models.d.ts +35 -0
- package/modules/backtest/dist/execution/fill-models.d.ts.map +1 -0
- package/modules/backtest/dist/execution/fill-models.js +375 -0
- package/modules/backtest/dist/execution/fill-models.js.map +1 -0
- package/modules/backtest/dist/execution/fill-order.d.ts +55 -0
- package/modules/backtest/dist/execution/fill-order.d.ts.map +1 -0
- package/modules/backtest/dist/execution/fill-order.js +156 -0
- package/modules/backtest/dist/execution/fill-order.js.map +1 -0
- package/modules/backtest/dist/execution/index.d.ts +33 -0
- package/modules/backtest/dist/execution/index.d.ts.map +1 -0
- package/modules/backtest/dist/execution/index.js +27 -0
- package/modules/backtest/dist/execution/index.js.map +1 -0
- package/modules/backtest/dist/execution/intrabar.d.ts +46 -0
- package/modules/backtest/dist/execution/intrabar.d.ts.map +1 -0
- package/modules/backtest/dist/execution/intrabar.js +130 -0
- package/modules/backtest/dist/execution/intrabar.js.map +1 -0
- package/modules/backtest/dist/execution/normalized.d.ts +56 -0
- package/modules/backtest/dist/execution/normalized.d.ts.map +1 -0
- package/modules/backtest/dist/execution/normalized.js +154 -0
- package/modules/backtest/dist/execution/normalized.js.map +1 -0
- package/modules/backtest/dist/execution/policy.d.ts +84 -0
- package/modules/backtest/dist/execution/policy.d.ts.map +1 -0
- package/modules/backtest/dist/execution/policy.js +341 -0
- package/modules/backtest/dist/execution/policy.js.map +1 -0
- package/modules/backtest/dist/execution/types.d.ts +217 -0
- package/modules/backtest/dist/execution/types.d.ts.map +1 -0
- package/modules/backtest/dist/execution/types.js +8 -0
- package/modules/backtest/dist/execution/types.js.map +1 -0
- package/modules/backtest/dist/execution/validate.d.ts +35 -0
- package/modules/backtest/dist/execution/validate.d.ts.map +1 -0
- package/modules/backtest/dist/execution/validate.js +666 -0
- package/modules/backtest/dist/execution/validate.js.map +1 -0
- package/modules/backtest/dist/generated/validation-specs.d.ts +12 -0
- package/modules/backtest/dist/generated/validation-specs.d.ts.map +1 -0
- package/modules/backtest/dist/generated/validation-specs.js +1129 -0
- package/modules/backtest/dist/generated/validation-specs.js.map +1 -0
- package/modules/backtest/dist/index.d.ts +33 -0
- package/modules/backtest/dist/index.d.ts.map +1 -0
- package/modules/backtest/dist/index.js +28 -0
- package/modules/backtest/dist/index.js.map +1 -0
- package/modules/backtest/dist/options/chain.d.ts +68 -0
- package/modules/backtest/dist/options/chain.d.ts.map +1 -0
- package/modules/backtest/dist/options/chain.js +303 -0
- package/modules/backtest/dist/options/chain.js.map +1 -0
- package/modules/backtest/dist/options/engine.d.ts +28 -0
- package/modules/backtest/dist/options/engine.d.ts.map +1 -0
- package/modules/backtest/dist/options/engine.js +1859 -0
- package/modules/backtest/dist/options/engine.js.map +1 -0
- package/modules/backtest/dist/options/index.d.ts +23 -0
- package/modules/backtest/dist/options/index.d.ts.map +1 -0
- package/modules/backtest/dist/options/index.js +21 -0
- package/modules/backtest/dist/options/index.js.map +1 -0
- package/modules/backtest/dist/options/tearsheet.d.ts +77 -0
- package/modules/backtest/dist/options/tearsheet.d.ts.map +1 -0
- package/modules/backtest/dist/options/tearsheet.js +205 -0
- package/modules/backtest/dist/options/tearsheet.js.map +1 -0
- package/modules/backtest/dist/options/types.d.ts +571 -0
- package/modules/backtest/dist/options/types.d.ts.map +1 -0
- package/modules/backtest/dist/options/types.js +19 -0
- package/modules/backtest/dist/options/types.js.map +1 -0
- package/modules/backtest/dist/paper/index.d.ts +13 -0
- package/modules/backtest/dist/paper/index.d.ts.map +1 -0
- package/modules/backtest/dist/paper/index.js +12 -0
- package/modules/backtest/dist/paper/index.js.map +1 -0
- package/modules/backtest/dist/paper/paper.d.ts +8 -0
- package/modules/backtest/dist/paper/paper.d.ts.map +1 -0
- package/modules/backtest/dist/paper/paper.js +950 -0
- package/modules/backtest/dist/paper/paper.js.map +1 -0
- package/modules/backtest/dist/paper/types.d.ts +190 -0
- package/modules/backtest/dist/paper/types.d.ts.map +1 -0
- package/modules/backtest/dist/paper/types.js +3 -0
- package/modules/backtest/dist/paper/types.js.map +1 -0
- package/modules/backtest/dist/paper/validate.d.ts +9 -0
- package/modules/backtest/dist/paper/validate.d.ts.map +1 -0
- package/modules/backtest/dist/paper/validate.js +112 -0
- package/modules/backtest/dist/paper/validate.js.map +1 -0
- package/modules/backtest/dist/portfolio/adapters.d.ts +37 -0
- package/modules/backtest/dist/portfolio/adapters.d.ts.map +1 -0
- package/modules/backtest/dist/portfolio/adapters.js +555 -0
- package/modules/backtest/dist/portfolio/adapters.js.map +1 -0
- package/modules/backtest/dist/portfolio/engine.d.ts +35 -0
- package/modules/backtest/dist/portfolio/engine.d.ts.map +1 -0
- package/modules/backtest/dist/portfolio/engine.js +1300 -0
- package/modules/backtest/dist/portfolio/engine.js.map +1 -0
- package/modules/backtest/dist/portfolio/index.d.ts +12 -0
- package/modules/backtest/dist/portfolio/index.d.ts.map +1 -0
- package/modules/backtest/dist/portfolio/index.js +11 -0
- package/modules/backtest/dist/portfolio/index.js.map +1 -0
- package/modules/backtest/dist/portfolio/types.d.ts +418 -0
- package/modules/backtest/dist/portfolio/types.d.ts.map +1 -0
- package/modules/backtest/dist/portfolio/types.js +8 -0
- package/modules/backtest/dist/portfolio/types.js.map +1 -0
- package/modules/backtest/dist/portfolio/validate.d.ts +26 -0
- package/modules/backtest/dist/portfolio/validate.d.ts.map +1 -0
- package/modules/backtest/dist/portfolio/validate.js +556 -0
- package/modules/backtest/dist/portfolio/validate.js.map +1 -0
- package/modules/backtest/dist/run-artifacts.d.ts +425 -0
- package/modules/backtest/dist/run-artifacts.d.ts.map +1 -0
- package/modules/backtest/dist/run-artifacts.js +1843 -0
- package/modules/backtest/dist/run-artifacts.js.map +1 -0
- package/modules/backtest/dist/signals.d.ts +110 -0
- package/modules/backtest/dist/signals.d.ts.map +1 -0
- package/modules/backtest/dist/signals.js +207 -0
- package/modules/backtest/dist/signals.js.map +1 -0
- package/modules/backtest/dist/tearsheet.d.ts +126 -0
- package/modules/backtest/dist/tearsheet.d.ts.map +1 -0
- package/modules/backtest/dist/tearsheet.js +266 -0
- package/modules/backtest/dist/tearsheet.js.map +1 -0
- package/modules/backtest/dist/types.d.ts +175 -0
- package/modules/backtest/dist/types.d.ts.map +1 -0
- package/modules/backtest/dist/types.js +29 -0
- package/modules/backtest/dist/types.js.map +1 -0
- package/modules/backtest/dist/validate.d.ts +13 -0
- package/modules/backtest/dist/validate.d.ts.map +1 -0
- package/modules/backtest/dist/validate.js +37 -0
- package/modules/backtest/dist/validate.js.map +1 -0
- package/modules/backtest/dist/vectorized.d.ts +53 -0
- package/modules/backtest/dist/vectorized.d.ts.map +1 -0
- package/modules/backtest/dist/vectorized.js +383 -0
- package/modules/backtest/dist/vectorized.js.map +1 -0
- package/modules/backtest/dist/walk-forward.d.ts +57 -0
- package/modules/backtest/dist/walk-forward.d.ts.map +1 -0
- package/modules/backtest/dist/walk-forward.js +125 -0
- package/modules/backtest/dist/walk-forward.js.map +1 -0
- package/modules/backtest/etc/backtest.api.md +139 -0
- package/modules/backtest/src/artifacts.ts +54 -0
- package/modules/backtest/src/broker.ts +1529 -0
- package/modules/backtest/src/costs.ts +225 -0
- package/modules/backtest/src/cross-sectional/engine.ts +1608 -0
- package/modules/backtest/src/cross-sectional/folds.ts +718 -0
- package/modules/backtest/src/cross-sectional/grid.ts +646 -0
- package/modules/backtest/src/cross-sectional/index.ts +76 -0
- package/modules/backtest/src/cross-sectional/types.ts +363 -0
- package/modules/backtest/src/cross-sectional/validate.ts +906 -0
- package/modules/backtest/src/diagnostics.ts +66 -0
- package/modules/backtest/src/environment/bench.ts +1022 -0
- package/modules/backtest/src/environment/environment.ts +766 -0
- package/modules/backtest/src/environment/episode.ts +146 -0
- package/modules/backtest/src/environment/episodes.ts +786 -0
- package/modules/backtest/src/environment/features.ts +184 -0
- package/modules/backtest/src/environment/index.ts +79 -0
- package/modules/backtest/src/environment/limits.ts +383 -0
- package/modules/backtest/src/environment/reward.ts +98 -0
- package/modules/backtest/src/environment/types.ts +595 -0
- package/modules/backtest/src/environment/validate.ts +415 -0
- package/modules/backtest/src/event-driven.ts +528 -0
- package/modules/backtest/src/execution/conformance.ts +346 -0
- package/modules/backtest/src/execution/fill-models.ts +410 -0
- package/modules/backtest/src/execution/fill-order.ts +261 -0
- package/modules/backtest/src/execution/index.ts +91 -0
- package/modules/backtest/src/execution/intrabar.ts +185 -0
- package/modules/backtest/src/execution/normalized.ts +216 -0
- package/modules/backtest/src/execution/policy.ts +447 -0
- package/modules/backtest/src/execution/types.ts +239 -0
- package/modules/backtest/src/execution/validate.ts +889 -0
- package/modules/backtest/src/generated/validation-specs.ts +1132 -0
- package/modules/backtest/src/index.ts +157 -0
- package/modules/backtest/src/options/chain.ts +410 -0
- package/modules/backtest/src/options/engine.ts +2240 -0
- package/modules/backtest/src/options/index.ts +68 -0
- package/modules/backtest/src/options/tearsheet.ts +327 -0
- package/modules/backtest/src/options/types.ts +573 -0
- package/modules/backtest/src/paper/index.ts +27 -0
- package/modules/backtest/src/paper/paper.ts +1288 -0
- package/modules/backtest/src/paper/types.ts +221 -0
- package/modules/backtest/src/paper/validate.ts +168 -0
- package/modules/backtest/src/portfolio/adapters.ts +651 -0
- package/modules/backtest/src/portfolio/engine.ts +1518 -0
- package/modules/backtest/src/portfolio/index.ts +64 -0
- package/modules/backtest/src/portfolio/types.ts +456 -0
- package/modules/backtest/src/portfolio/validate.ts +861 -0
- package/modules/backtest/src/run-artifacts.ts +2873 -0
- package/modules/backtest/src/signals.ts +267 -0
- package/modules/backtest/src/tearsheet.ts +425 -0
- package/modules/backtest/src/types.ts +200 -0
- package/modules/backtest/src/validate.ts +43 -0
- package/modules/backtest/src/vectorized.ts +541 -0
- package/modules/backtest/src/walk-forward.ts +215 -0
- package/modules/calendars/dist/cboe.d.ts +15 -0
- package/modules/calendars/dist/cboe.d.ts.map +1 -0
- package/modules/calendars/dist/cboe.js +16 -0
- package/modules/calendars/dist/cboe.js.map +1 -0
- package/modules/calendars/dist/crypto.d.ts +15 -0
- package/modules/calendars/dist/crypto.d.ts.map +1 -0
- package/modules/calendars/dist/crypto.js +16 -0
- package/modules/calendars/dist/crypto.js.map +1 -0
- package/modules/calendars/dist/expirations.d.ts +35 -0
- package/modules/calendars/dist/expirations.d.ts.map +1 -0
- package/modules/calendars/dist/expirations.js +158 -0
- package/modules/calendars/dist/expirations.js.map +1 -0
- package/modules/calendars/dist/index.d.ts +16 -0
- package/modules/calendars/dist/index.d.ts.map +1 -0
- package/modules/calendars/dist/index.js +13 -0
- package/modules/calendars/dist/index.js.map +1 -0
- package/modules/calendars/dist/nyse.d.ts +11 -0
- package/modules/calendars/dist/nyse.d.ts.map +1 -0
- package/modules/calendars/dist/nyse.js +12 -0
- package/modules/calendars/dist/nyse.js.map +1 -0
- package/modules/calendars/dist/trading-calendar.d.ts +32 -0
- package/modules/calendars/dist/trading-calendar.d.ts.map +1 -0
- package/modules/calendars/dist/trading-calendar.js +67 -0
- package/modules/calendars/dist/trading-calendar.js.map +1 -0
- package/modules/calendars/dist/us-market.d.ts +29 -0
- package/modules/calendars/dist/us-market.d.ts.map +1 -0
- package/modules/calendars/dist/us-market.js +72 -0
- package/modules/calendars/dist/us-market.js.map +1 -0
- package/modules/calendars/etc/calendars.api.md +22 -0
- package/modules/calendars/src/cboe.ts +17 -0
- package/modules/calendars/src/crypto.ts +17 -0
- package/modules/calendars/src/expirations.ts +200 -0
- package/modules/calendars/src/index.ts +23 -0
- package/modules/calendars/src/nyse.ts +13 -0
- package/modules/calendars/src/trading-calendar.ts +85 -0
- package/modules/calendars/src/us-market.ts +86 -0
- package/modules/cli/dist/bin.d.ts +9 -0
- package/modules/cli/dist/bin.d.ts.map +1 -0
- package/modules/cli/dist/bin.js +458 -0
- package/modules/cli/dist/bin.js.map +1 -0
- package/modules/cli/dist/commands.d.ts +7 -0
- package/modules/cli/dist/commands.d.ts.map +1 -0
- package/modules/cli/dist/commands.js +17 -0
- package/modules/cli/dist/commands.js.map +1 -0
- package/modules/cli/dist/exit-codes.d.ts +20 -0
- package/modules/cli/dist/exit-codes.d.ts.map +1 -0
- package/modules/cli/dist/exit-codes.js +19 -0
- package/modules/cli/dist/exit-codes.js.map +1 -0
- package/modules/cli/dist/index.d.ts +13 -0
- package/modules/cli/dist/index.d.ts.map +1 -0
- package/modules/cli/dist/index.js +10 -0
- package/modules/cli/dist/index.js.map +1 -0
- package/modules/cli/etc/cli.api.md +25 -0
- package/modules/cli/src/bin.ts +530 -0
- package/modules/cli/src/commands.ts +19 -0
- package/modules/cli/src/exit-codes.ts +21 -0
- package/modules/cli/src/index.ts +29 -0
- package/modules/commodities/dist/forwards.d.ts +274 -0
- package/modules/commodities/dist/forwards.d.ts.map +1 -0
- package/modules/commodities/dist/forwards.js +359 -0
- package/modules/commodities/dist/forwards.js.map +1 -0
- package/modules/commodities/dist/index.d.ts +10 -0
- package/modules/commodities/dist/index.d.ts.map +1 -0
- package/modules/commodities/dist/index.js +10 -0
- package/modules/commodities/dist/index.js.map +1 -0
- package/modules/commodities/dist/internal.d.ts +6 -0
- package/modules/commodities/dist/internal.d.ts.map +1 -0
- package/modules/commodities/dist/internal.js +6 -0
- package/modules/commodities/dist/internal.js.map +1 -0
- package/modules/commodities/dist/term-structure.d.ts +327 -0
- package/modules/commodities/dist/term-structure.d.ts.map +1 -0
- package/modules/commodities/dist/term-structure.js +416 -0
- package/modules/commodities/dist/term-structure.js.map +1 -0
- package/modules/commodities/etc/commodities.api.md +53 -0
- package/modules/commodities/src/forwards.ts +791 -0
- package/modules/commodities/src/index.ts +10 -0
- package/modules/commodities/src/internal.ts +6 -0
- package/modules/commodities/src/term-structure.ts +828 -0
- package/modules/core/dist/artifacts/analysis-artifact.d.ts +140 -0
- package/modules/core/dist/artifacts/analysis-artifact.d.ts.map +1 -0
- package/modules/core/dist/artifacts/analysis-artifact.js +356 -0
- package/modules/core/dist/artifacts/analysis-artifact.js.map +1 -0
- package/modules/core/dist/artifacts/calculation-comparison.d.ts +125 -0
- package/modules/core/dist/artifacts/calculation-comparison.d.ts.map +1 -0
- package/modules/core/dist/artifacts/calculation-comparison.js +444 -0
- package/modules/core/dist/artifacts/calculation-comparison.js.map +1 -0
- package/modules/core/dist/artifacts/canonical-scan.d.ts +58 -0
- package/modules/core/dist/artifacts/canonical-scan.d.ts.map +1 -0
- package/modules/core/dist/artifacts/canonical-scan.js +250 -0
- package/modules/core/dist/artifacts/canonical-scan.js.map +1 -0
- package/modules/core/dist/artifacts/comparison.d.ts +179 -0
- package/modules/core/dist/artifacts/comparison.d.ts.map +1 -0
- package/modules/core/dist/artifacts/comparison.js +383 -0
- package/modules/core/dist/artifacts/comparison.js.map +1 -0
- package/modules/core/dist/artifacts/content-hash.d.ts +38 -0
- package/modules/core/dist/artifacts/content-hash.d.ts.map +1 -0
- package/modules/core/dist/artifacts/content-hash.js +170 -0
- package/modules/core/dist/artifacts/content-hash.js.map +1 -0
- package/modules/core/dist/artifacts/deep-freeze.d.ts +8 -0
- package/modules/core/dist/artifacts/deep-freeze.d.ts.map +1 -0
- package/modules/core/dist/artifacts/deep-freeze.js +16 -0
- package/modules/core/dist/artifacts/deep-freeze.js.map +1 -0
- package/modules/core/dist/artifacts/fitted-model-kit.d.ts +123 -0
- package/modules/core/dist/artifacts/fitted-model-kit.d.ts.map +1 -0
- package/modules/core/dist/artifacts/fitted-model-kit.js +281 -0
- package/modules/core/dist/artifacts/fitted-model-kit.js.map +1 -0
- package/modules/core/dist/artifacts/fitted-model-summary.d.ts +73 -0
- package/modules/core/dist/artifacts/fitted-model-summary.d.ts.map +1 -0
- package/modules/core/dist/artifacts/fitted-model-summary.js +254 -0
- package/modules/core/dist/artifacts/fitted-model-summary.js.map +1 -0
- package/modules/core/dist/artifacts/index.d.ts +52 -0
- package/modules/core/dist/artifacts/index.d.ts.map +1 -0
- package/modules/core/dist/artifacts/index.js +47 -0
- package/modules/core/dist/artifacts/index.js.map +1 -0
- package/modules/core/dist/artifacts/market-snapshot.d.ts +189 -0
- package/modules/core/dist/artifacts/market-snapshot.d.ts.map +1 -0
- package/modules/core/dist/artifacts/market-snapshot.js +517 -0
- package/modules/core/dist/artifacts/market-snapshot.js.map +1 -0
- package/modules/core/dist/artifacts/migration.d.ts +60 -0
- package/modules/core/dist/artifacts/migration.d.ts.map +1 -0
- package/modules/core/dist/artifacts/migration.js +106 -0
- package/modules/core/dist/artifacts/migration.js.map +1 -0
- package/modules/core/dist/artifacts/numeric-comparison.d.ts +12 -0
- package/modules/core/dist/artifacts/numeric-comparison.d.ts.map +1 -0
- package/modules/core/dist/artifacts/numeric-comparison.js +53 -0
- package/modules/core/dist/artifacts/numeric-comparison.js.map +1 -0
- package/modules/core/dist/artifacts/scenario-set.d.ts +97 -0
- package/modules/core/dist/artifacts/scenario-set.d.ts.map +1 -0
- package/modules/core/dist/artifacts/scenario-set.js +249 -0
- package/modules/core/dist/artifacts/scenario-set.js.map +1 -0
- package/modules/core/dist/artifacts/table-handle.d.ts +96 -0
- package/modules/core/dist/artifacts/table-handle.d.ts.map +1 -0
- package/modules/core/dist/artifacts/table-handle.js +253 -0
- package/modules/core/dist/artifacts/table-handle.js.map +1 -0
- package/modules/core/dist/assumptions.d.ts +52 -0
- package/modules/core/dist/assumptions.d.ts.map +1 -0
- package/modules/core/dist/assumptions.js +13 -0
- package/modules/core/dist/assumptions.js.map +1 -0
- package/modules/core/dist/calendar.d.ts +98 -0
- package/modules/core/dist/calendar.d.ts.map +1 -0
- package/modules/core/dist/calendar.js +301 -0
- package/modules/core/dist/calendar.js.map +1 -0
- package/modules/core/dist/canonical-json.d.ts +63 -0
- package/modules/core/dist/canonical-json.d.ts.map +1 -0
- package/modules/core/dist/canonical-json.js +241 -0
- package/modules/core/dist/canonical-json.js.map +1 -0
- package/modules/core/dist/computed.d.ts +31 -0
- package/modules/core/dist/computed.d.ts.map +1 -0
- package/modules/core/dist/computed.js +40 -0
- package/modules/core/dist/computed.js.map +1 -0
- package/modules/core/dist/contracts.d.ts +59 -0
- package/modules/core/dist/contracts.d.ts.map +1 -0
- package/modules/core/dist/contracts.js +9 -0
- package/modules/core/dist/contracts.js.map +1 -0
- package/modules/core/dist/dates.d.ts +31 -0
- package/modules/core/dist/dates.d.ts.map +1 -0
- package/modules/core/dist/dates.js +126 -0
- package/modules/core/dist/dates.js.map +1 -0
- package/modules/core/dist/diagnostics.d.ts +278 -0
- package/modules/core/dist/diagnostics.d.ts.map +1 -0
- package/modules/core/dist/diagnostics.js +287 -0
- package/modules/core/dist/diagnostics.js.map +1 -0
- package/modules/core/dist/errors.d.ts +324 -0
- package/modules/core/dist/errors.d.ts.map +1 -0
- package/modules/core/dist/errors.js +363 -0
- package/modules/core/dist/errors.js.map +1 -0
- package/modules/core/dist/facade.d.ts +97 -0
- package/modules/core/dist/facade.d.ts.map +1 -0
- package/modules/core/dist/facade.js +354 -0
- package/modules/core/dist/facade.js.map +1 -0
- package/modules/core/dist/index.d.ts +45 -0
- package/modules/core/dist/index.d.ts.map +1 -0
- package/modules/core/dist/index.js +23 -0
- package/modules/core/dist/index.js.map +1 -0
- package/modules/core/dist/invariants.d.ts +112 -0
- package/modules/core/dist/invariants.d.ts.map +1 -0
- package/modules/core/dist/invariants.js +240 -0
- package/modules/core/dist/invariants.js.map +1 -0
- package/modules/core/dist/market-data.d.ts +219 -0
- package/modules/core/dist/market-data.d.ts.map +1 -0
- package/modules/core/dist/market-data.js +183 -0
- package/modules/core/dist/market-data.js.map +1 -0
- package/modules/core/dist/numeric.d.ts +46 -0
- package/modules/core/dist/numeric.d.ts.map +1 -0
- package/modules/core/dist/numeric.js +145 -0
- package/modules/core/dist/numeric.js.map +1 -0
- package/modules/core/dist/orders.d.ts +28 -0
- package/modules/core/dist/orders.d.ts.map +1 -0
- package/modules/core/dist/orders.js +49 -0
- package/modules/core/dist/orders.js.map +1 -0
- package/modules/core/dist/pricing.d.ts +418 -0
- package/modules/core/dist/pricing.d.ts.map +1 -0
- package/modules/core/dist/pricing.js +987 -0
- package/modules/core/dist/pricing.js.map +1 -0
- package/modules/core/dist/provenance.d.ts +25 -0
- package/modules/core/dist/provenance.d.ts.map +1 -0
- package/modules/core/dist/provenance.js +75 -0
- package/modules/core/dist/provenance.js.map +1 -0
- package/modules/core/dist/schema/index.d.ts +14 -0
- package/modules/core/dist/schema/index.d.ts.map +1 -0
- package/modules/core/dist/schema/index.js +12 -0
- package/modules/core/dist/schema/index.js.map +1 -0
- package/modules/core/dist/schema/json-schema-guard.d.ts +21 -0
- package/modules/core/dist/schema/json-schema-guard.d.ts.map +1 -0
- package/modules/core/dist/schema/json-schema-guard.js +114 -0
- package/modules/core/dist/schema/json-schema-guard.js.map +1 -0
- package/modules/core/dist/schema/json-schema.d.ts +33 -0
- package/modules/core/dist/schema/json-schema.d.ts.map +1 -0
- package/modules/core/dist/schema/json-schema.js +3 -0
- package/modules/core/dist/schema/json-schema.js.map +1 -0
- package/modules/core/dist/schema/payloads.d.ts +429 -0
- package/modules/core/dist/schema/payloads.d.ts.map +1 -0
- package/modules/core/dist/schema/payloads.js +323 -0
- package/modules/core/dist/schema/payloads.js.map +1 -0
- package/modules/core/dist/schema/schema.d.ts +282 -0
- package/modules/core/dist/schema/schema.d.ts.map +1 -0
- package/modules/core/dist/schema/schema.js +780 -0
- package/modules/core/dist/schema/schema.js.map +1 -0
- package/modules/core/dist/schema/standard.d.ts +32 -0
- package/modules/core/dist/schema/standard.d.ts.map +1 -0
- package/modules/core/dist/schema/standard.js +8 -0
- package/modules/core/dist/schema/standard.js.map +1 -0
- package/modules/core/dist/symbology.d.ts +30 -0
- package/modules/core/dist/symbology.d.ts.map +1 -0
- package/modules/core/dist/symbology.js +126 -0
- package/modules/core/dist/symbology.js.map +1 -0
- package/modules/core/dist/time.d.ts +122 -0
- package/modules/core/dist/time.d.ts.map +1 -0
- package/modules/core/dist/time.js +349 -0
- package/modules/core/dist/time.js.map +1 -0
- package/modules/core/dist/validation-codes.d.ts +24 -0
- package/modules/core/dist/validation-codes.d.ts.map +1 -0
- package/modules/core/dist/validation-codes.js +24 -0
- package/modules/core/dist/validation-codes.js.map +1 -0
- package/modules/core/dist/validation.d.ts +117 -0
- package/modules/core/dist/validation.d.ts.map +1 -0
- package/modules/core/dist/validation.js +415 -0
- package/modules/core/dist/validation.js.map +1 -0
- package/modules/core/etc/core.api.md +157 -0
- package/modules/core/src/artifacts/analysis-artifact.ts +515 -0
- package/modules/core/src/artifacts/calculation-comparison.ts +641 -0
- package/modules/core/src/artifacts/canonical-scan.ts +358 -0
- package/modules/core/src/artifacts/comparison.ts +586 -0
- package/modules/core/src/artifacts/content-hash.ts +183 -0
- package/modules/core/src/artifacts/deep-freeze.ts +15 -0
- package/modules/core/src/artifacts/fitted-model-kit.ts +402 -0
- package/modules/core/src/artifacts/fitted-model-summary.ts +478 -0
- package/modules/core/src/artifacts/index.ts +155 -0
- package/modules/core/src/artifacts/market-snapshot.ts +787 -0
- package/modules/core/src/artifacts/migration.ts +195 -0
- package/modules/core/src/artifacts/numeric-comparison.ts +71 -0
- package/modules/core/src/artifacts/scenario-set.ts +383 -0
- package/modules/core/src/artifacts/table-handle.ts +329 -0
- package/modules/core/src/assumptions.ts +62 -0
- package/modules/core/src/calendar.ts +407 -0
- package/modules/core/src/canonical-json.ts +289 -0
- package/modules/core/src/computed.ts +55 -0
- package/modules/core/src/contracts.ts +63 -0
- package/modules/core/src/dates.ts +163 -0
- package/modules/core/src/diagnostics.ts +397 -0
- package/modules/core/src/errors.ts +404 -0
- package/modules/core/src/facade.ts +436 -0
- package/modules/core/src/index.ts +185 -0
- package/modules/core/src/invariants.ts +339 -0
- package/modules/core/src/market-data.ts +481 -0
- package/modules/core/src/numeric.ts +205 -0
- package/modules/core/src/orders.ts +71 -0
- package/modules/core/src/pricing.ts +1647 -0
- package/modules/core/src/provenance.ts +121 -0
- package/modules/core/src/schema/index.ts +61 -0
- package/modules/core/src/schema/json-schema-guard.ts +172 -0
- package/modules/core/src/schema/json-schema.ts +52 -0
- package/modules/core/src/schema/payloads.ts +364 -0
- package/modules/core/src/schema/schema.ts +986 -0
- package/modules/core/src/schema/standard.ts +40 -0
- package/modules/core/src/symbology.ts +170 -0
- package/modules/core/src/time.ts +458 -0
- package/modules/core/src/validation-codes.ts +23 -0
- package/modules/core/src/validation.ts +607 -0
- package/modules/crypto/dist/carry.d.ts +176 -0
- package/modules/crypto/dist/carry.d.ts.map +1 -0
- package/modules/crypto/dist/carry.js +349 -0
- package/modules/crypto/dist/carry.js.map +1 -0
- package/modules/crypto/dist/curve.d.ts +69 -0
- package/modules/crypto/dist/curve.d.ts.map +1 -0
- package/modules/crypto/dist/curve.js +180 -0
- package/modules/crypto/dist/curve.js.map +1 -0
- package/modules/crypto/dist/index.d.ts +20 -0
- package/modules/crypto/dist/index.d.ts.map +1 -0
- package/modules/crypto/dist/index.js +16 -0
- package/modules/crypto/dist/index.js.map +1 -0
- package/modules/crypto/dist/inverse.d.ts +61 -0
- package/modules/crypto/dist/inverse.d.ts.map +1 -0
- package/modules/crypto/dist/inverse.js +89 -0
- package/modules/crypto/dist/inverse.js.map +1 -0
- package/modules/crypto/dist/liquidation.d.ts +67 -0
- package/modules/crypto/dist/liquidation.d.ts.map +1 -0
- package/modules/crypto/dist/liquidation.js +103 -0
- package/modules/crypto/dist/liquidation.js.map +1 -0
- package/modules/crypto/etc/crypto.api.md +45 -0
- package/modules/crypto/src/carry.ts +656 -0
- package/modules/crypto/src/curve.ts +273 -0
- package/modules/crypto/src/index.ts +62 -0
- package/modules/crypto/src/inverse.ts +172 -0
- package/modules/crypto/src/liquidation.ts +174 -0
- package/modules/fixed-income/dist/artifacts.d.ts +24 -0
- package/modules/fixed-income/dist/artifacts.d.ts.map +1 -0
- package/modules/fixed-income/dist/artifacts.js +21 -0
- package/modules/fixed-income/dist/artifacts.js.map +1 -0
- package/modules/fixed-income/dist/bonds.d.ts +298 -0
- package/modules/fixed-income/dist/bonds.d.ts.map +1 -0
- package/modules/fixed-income/dist/bonds.js +951 -0
- package/modules/fixed-income/dist/bonds.js.map +1 -0
- package/modules/fixed-income/dist/conventions.d.ts +77 -0
- package/modules/fixed-income/dist/conventions.d.ts.map +1 -0
- package/modules/fixed-income/dist/conventions.js +266 -0
- package/modules/fixed-income/dist/conventions.js.map +1 -0
- package/modules/fixed-income/dist/convertible.d.ts +76 -0
- package/modules/fixed-income/dist/convertible.d.ts.map +1 -0
- package/modules/fixed-income/dist/convertible.js +182 -0
- package/modules/fixed-income/dist/convertible.js.map +1 -0
- package/modules/fixed-income/dist/credit.d.ts +227 -0
- package/modules/fixed-income/dist/credit.d.ts.map +1 -0
- package/modules/fixed-income/dist/credit.js +653 -0
- package/modules/fixed-income/dist/credit.js.map +1 -0
- package/modules/fixed-income/dist/cross-currency.d.ts +82 -0
- package/modules/fixed-income/dist/cross-currency.d.ts.map +1 -0
- package/modules/fixed-income/dist/cross-currency.js +93 -0
- package/modules/fixed-income/dist/cross-currency.js.map +1 -0
- package/modules/fixed-income/dist/curve-data.d.ts +70 -0
- package/modules/fixed-income/dist/curve-data.d.ts.map +1 -0
- package/modules/fixed-income/dist/curve-data.js +254 -0
- package/modules/fixed-income/dist/curve-data.js.map +1 -0
- package/modules/fixed-income/dist/curve-mappers.d.ts +57 -0
- package/modules/fixed-income/dist/curve-mappers.d.ts.map +1 -0
- package/modules/fixed-income/dist/curve-mappers.js +131 -0
- package/modules/fixed-income/dist/curve-mappers.js.map +1 -0
- package/modules/fixed-income/dist/curve-state.d.ts +47 -0
- package/modules/fixed-income/dist/curve-state.d.ts.map +1 -0
- package/modules/fixed-income/dist/curve-state.js +33 -0
- package/modules/fixed-income/dist/curve-state.js.map +1 -0
- package/modules/fixed-income/dist/curves.d.ts +198 -0
- package/modules/fixed-income/dist/curves.d.ts.map +1 -0
- package/modules/fixed-income/dist/curves.js +803 -0
- package/modules/fixed-income/dist/curves.js.map +1 -0
- package/modules/fixed-income/dist/fitted-model-artifacts.d.ts +277 -0
- package/modules/fixed-income/dist/fitted-model-artifacts.d.ts.map +1 -0
- package/modules/fixed-income/dist/fitted-model-artifacts.js +839 -0
- package/modules/fixed-income/dist/fitted-model-artifacts.js.map +1 -0
- package/modules/fixed-income/dist/fitted-model-families.d.ts +170 -0
- package/modules/fixed-income/dist/fitted-model-families.d.ts.map +1 -0
- package/modules/fixed-income/dist/fitted-model-families.js +461 -0
- package/modules/fixed-income/dist/fitted-model-families.js.map +1 -0
- package/modules/fixed-income/dist/futures.d.ts +264 -0
- package/modules/fixed-income/dist/futures.d.ts.map +1 -0
- package/modules/fixed-income/dist/futures.js +630 -0
- package/modules/fixed-income/dist/futures.js.map +1 -0
- package/modules/fixed-income/dist/generated/validation-specs.d.ts +12 -0
- package/modules/fixed-income/dist/generated/validation-specs.d.ts.map +1 -0
- package/modules/fixed-income/dist/generated/validation-specs.js +556 -0
- package/modules/fixed-income/dist/generated/validation-specs.js.map +1 -0
- package/modules/fixed-income/dist/index.d.ts +36 -0
- package/modules/fixed-income/dist/index.d.ts.map +1 -0
- package/modules/fixed-income/dist/index.js +37 -0
- package/modules/fixed-income/dist/index.js.map +1 -0
- package/modules/fixed-income/dist/inflation.d.ts +174 -0
- package/modules/fixed-income/dist/inflation.d.ts.map +1 -0
- package/modules/fixed-income/dist/inflation.js +335 -0
- package/modules/fixed-income/dist/inflation.js.map +1 -0
- package/modules/fixed-income/dist/lattice.d.ts +156 -0
- package/modules/fixed-income/dist/lattice.d.ts.map +1 -0
- package/modules/fixed-income/dist/lattice.js +433 -0
- package/modules/fixed-income/dist/lattice.js.map +1 -0
- package/modules/fixed-income/dist/models.d.ts +187 -0
- package/modules/fixed-income/dist/models.d.ts.map +1 -0
- package/modules/fixed-income/dist/models.js +580 -0
- package/modules/fixed-income/dist/models.js.map +1 -0
- package/modules/fixed-income/dist/pricer.d.ts +48 -0
- package/modules/fixed-income/dist/pricer.d.ts.map +1 -0
- package/modules/fixed-income/dist/pricer.js +445 -0
- package/modules/fixed-income/dist/pricer.js.map +1 -0
- package/modules/fixed-income/dist/rates.d.ts +305 -0
- package/modules/fixed-income/dist/rates.d.ts.map +1 -0
- package/modules/fixed-income/dist/rates.js +686 -0
- package/modules/fixed-income/dist/rates.js.map +1 -0
- package/modules/fixed-income/dist/validate.d.ts +28 -0
- package/modules/fixed-income/dist/validate.d.ts.map +1 -0
- package/modules/fixed-income/dist/validate.js +123 -0
- package/modules/fixed-income/dist/validate.js.map +1 -0
- package/modules/fixed-income/dist/xva.d.ts +88 -0
- package/modules/fixed-income/dist/xva.d.ts.map +1 -0
- package/modules/fixed-income/dist/xva.js +316 -0
- package/modules/fixed-income/dist/xva.js.map +1 -0
- package/modules/fixed-income/etc/fixed-income.api.md +195 -0
- package/modules/fixed-income/src/artifacts.ts +60 -0
- package/modules/fixed-income/src/bonds.ts +1514 -0
- package/modules/fixed-income/src/conventions.ts +387 -0
- package/modules/fixed-income/src/convertible.ts +286 -0
- package/modules/fixed-income/src/credit.ts +1065 -0
- package/modules/fixed-income/src/cross-currency.ts +176 -0
- package/modules/fixed-income/src/curve-data.ts +381 -0
- package/modules/fixed-income/src/curve-mappers.ts +170 -0
- package/modules/fixed-income/src/curve-state.ts +70 -0
- package/modules/fixed-income/src/curves.ts +1169 -0
- package/modules/fixed-income/src/fitted-model-artifacts.ts +1414 -0
- package/modules/fixed-income/src/fitted-model-families.ts +834 -0
- package/modules/fixed-income/src/futures.ts +1018 -0
- package/modules/fixed-income/src/generated/validation-specs.ts +559 -0
- package/modules/fixed-income/src/index.ts +241 -0
- package/modules/fixed-income/src/inflation.ts +554 -0
- package/modules/fixed-income/src/lattice.ts +675 -0
- package/modules/fixed-income/src/models.ts +897 -0
- package/modules/fixed-income/src/pricer.ts +624 -0
- package/modules/fixed-income/src/rates.ts +1086 -0
- package/modules/fixed-income/src/validate.ts +169 -0
- package/modules/fixed-income/src/xva.ts +466 -0
- package/modules/foreign-exchange/dist/exposure.d.ts +140 -0
- package/modules/foreign-exchange/dist/exposure.d.ts.map +1 -0
- package/modules/foreign-exchange/dist/exposure.js +253 -0
- package/modules/foreign-exchange/dist/exposure.js.map +1 -0
- package/modules/foreign-exchange/dist/forwards.d.ts +159 -0
- package/modules/foreign-exchange/dist/forwards.d.ts.map +1 -0
- package/modules/foreign-exchange/dist/forwards.js +310 -0
- package/modules/foreign-exchange/dist/forwards.js.map +1 -0
- package/modules/foreign-exchange/dist/index.d.ts +11 -0
- package/modules/foreign-exchange/dist/index.d.ts.map +1 -0
- package/modules/foreign-exchange/dist/index.js +11 -0
- package/modules/foreign-exchange/dist/index.js.map +1 -0
- package/modules/foreign-exchange/dist/internal.d.ts +6 -0
- package/modules/foreign-exchange/dist/internal.d.ts.map +1 -0
- package/modules/foreign-exchange/dist/internal.js +6 -0
- package/modules/foreign-exchange/dist/internal.js.map +1 -0
- package/modules/foreign-exchange/dist/spot.d.ts +150 -0
- package/modules/foreign-exchange/dist/spot.d.ts.map +1 -0
- package/modules/foreign-exchange/dist/spot.js +289 -0
- package/modules/foreign-exchange/dist/spot.js.map +1 -0
- package/modules/foreign-exchange/etc/foreign-exchange.api.md +52 -0
- package/modules/foreign-exchange/src/exposure.ts +485 -0
- package/modules/foreign-exchange/src/forwards.ts +595 -0
- package/modules/foreign-exchange/src/index.ts +11 -0
- package/modules/foreign-exchange/src/internal.ts +6 -0
- package/modules/foreign-exchange/src/spot.ts +530 -0
- package/modules/fundamentals/dist/analyze.d.ts +90 -0
- package/modules/fundamentals/dist/analyze.d.ts.map +1 -0
- package/modules/fundamentals/dist/analyze.js +293 -0
- package/modules/fundamentals/dist/analyze.js.map +1 -0
- package/modules/fundamentals/dist/index.d.ts +17 -0
- package/modules/fundamentals/dist/index.d.ts.map +1 -0
- package/modules/fundamentals/dist/index.js +15 -0
- package/modules/fundamentals/dist/index.js.map +1 -0
- package/modules/fundamentals/dist/periods.d.ts +47 -0
- package/modules/fundamentals/dist/periods.d.ts.map +1 -0
- package/modules/fundamentals/dist/periods.js +106 -0
- package/modules/fundamentals/dist/periods.js.map +1 -0
- package/modules/fundamentals/dist/ratio-heads.d.ts +47 -0
- package/modules/fundamentals/dist/ratio-heads.d.ts.map +1 -0
- package/modules/fundamentals/dist/ratio-heads.js +766 -0
- package/modules/fundamentals/dist/ratio-heads.js.map +1 -0
- package/modules/fundamentals/dist/ratio-internals.d.ts +187 -0
- package/modules/fundamentals/dist/ratio-internals.d.ts.map +1 -0
- package/modules/fundamentals/dist/ratio-internals.js +299 -0
- package/modules/fundamentals/dist/ratio-internals.js.map +1 -0
- package/modules/fundamentals/dist/ratios.d.ts +9 -0
- package/modules/fundamentals/dist/ratios.d.ts.map +1 -0
- package/modules/fundamentals/dist/ratios.js +8 -0
- package/modules/fundamentals/dist/ratios.js.map +1 -0
- package/modules/fundamentals/dist/score-heads.d.ts +130 -0
- package/modules/fundamentals/dist/score-heads.d.ts.map +1 -0
- package/modules/fundamentals/dist/score-heads.js +364 -0
- package/modules/fundamentals/dist/score-heads.js.map +1 -0
- package/modules/fundamentals/dist/scores.d.ts +6 -0
- package/modules/fundamentals/dist/scores.d.ts.map +1 -0
- package/modules/fundamentals/dist/scores.js +6 -0
- package/modules/fundamentals/dist/scores.js.map +1 -0
- package/modules/fundamentals/dist/statement-contracts.d.ts +170 -0
- package/modules/fundamentals/dist/statement-contracts.d.ts.map +1 -0
- package/modules/fundamentals/dist/statement-contracts.js +207 -0
- package/modules/fundamentals/dist/statement-contracts.js.map +1 -0
- package/modules/fundamentals/dist/statement-utilities.d.ts +190 -0
- package/modules/fundamentals/dist/statement-utilities.d.ts.map +1 -0
- package/modules/fundamentals/dist/statement-utilities.js +501 -0
- package/modules/fundamentals/dist/statement-utilities.js.map +1 -0
- package/modules/fundamentals/dist/statements.d.ts +8 -0
- package/modules/fundamentals/dist/statements.d.ts.map +1 -0
- package/modules/fundamentals/dist/statements.js +7 -0
- package/modules/fundamentals/dist/statements.js.map +1 -0
- package/modules/fundamentals/etc/fundamentals.api.md +110 -0
- package/modules/fundamentals/src/analyze.ts +401 -0
- package/modules/fundamentals/src/index.ts +24 -0
- package/modules/fundamentals/src/periods.ts +197 -0
- package/modules/fundamentals/src/ratio-heads.ts +945 -0
- package/modules/fundamentals/src/ratio-internals.ts +562 -0
- package/modules/fundamentals/src/ratios.ts +23 -0
- package/modules/fundamentals/src/score-heads.ts +651 -0
- package/modules/fundamentals/src/scores.ts +6 -0
- package/modules/fundamentals/src/statement-contracts.ts +393 -0
- package/modules/fundamentals/src/statement-utilities.ts +833 -0
- package/modules/fundamentals/src/statements.ts +22 -0
- package/modules/http/dist/bin.d.ts +7 -0
- package/modules/http/dist/bin.d.ts.map +1 -0
- package/modules/http/dist/bin.js +167 -0
- package/modules/http/dist/bin.js.map +1 -0
- package/modules/http/dist/index.d.ts +10 -0
- package/modules/http/dist/index.d.ts.map +1 -0
- package/modules/http/dist/index.js +8 -0
- package/modules/http/dist/index.js.map +1 -0
- package/modules/http/dist/openapi.d.ts +38 -0
- package/modules/http/dist/openapi.d.ts.map +1 -0
- package/modules/http/dist/openapi.js +431 -0
- package/modules/http/dist/openapi.js.map +1 -0
- package/modules/http/dist/security.d.ts +21 -0
- package/modules/http/dist/security.d.ts.map +1 -0
- package/modules/http/dist/security.js +116 -0
- package/modules/http/dist/security.js.map +1 -0
- package/modules/http/dist/server.d.ts +63 -0
- package/modules/http/dist/server.d.ts.map +1 -0
- package/modules/http/dist/server.js +544 -0
- package/modules/http/dist/server.js.map +1 -0
- package/modules/http/etc/http.api.md +15 -0
- package/modules/http/etc/openapi.json +51958 -0
- package/modules/http/src/bin.ts +190 -0
- package/modules/http/src/index.ts +10 -0
- package/modules/http/src/openapi.ts +488 -0
- package/modules/http/src/security.ts +158 -0
- package/modules/http/src/server.ts +941 -0
- package/modules/math/dist/bivariate.d.ts +17 -0
- package/modules/math/dist/bivariate.d.ts.map +1 -0
- package/modules/math/dist/bivariate.js +123 -0
- package/modules/math/dist/bivariate.js.map +1 -0
- package/modules/math/dist/distributions.d.ts +66 -0
- package/modules/math/dist/distributions.d.ts.map +1 -0
- package/modules/math/dist/distributions.js +465 -0
- package/modules/math/dist/distributions.js.map +1 -0
- package/modules/math/dist/filters.d.ts +96 -0
- package/modules/math/dist/filters.d.ts.map +1 -0
- package/modules/math/dist/filters.js +347 -0
- package/modules/math/dist/filters.js.map +1 -0
- package/modules/math/dist/index.d.ts +34 -0
- package/modules/math/dist/index.d.ts.map +1 -0
- package/modules/math/dist/index.js +23 -0
- package/modules/math/dist/index.js.map +1 -0
- package/modules/math/dist/integration.d.ts +58 -0
- package/modules/math/dist/integration.d.ts.map +1 -0
- package/modules/math/dist/integration.js +176 -0
- package/modules/math/dist/integration.js.map +1 -0
- package/modules/math/dist/interpolation.d.ts +57 -0
- package/modules/math/dist/interpolation.d.ts.map +1 -0
- package/modules/math/dist/interpolation.js +464 -0
- package/modules/math/dist/interpolation.js.map +1 -0
- package/modules/math/dist/linalg.d.ts +251 -0
- package/modules/math/dist/linalg.d.ts.map +1 -0
- package/modules/math/dist/linalg.js +1503 -0
- package/modules/math/dist/linalg.js.map +1 -0
- package/modules/math/dist/lowdiscrepancy.d.ts +21 -0
- package/modules/math/dist/lowdiscrepancy.d.ts.map +1 -0
- package/modules/math/dist/lowdiscrepancy.js +200 -0
- package/modules/math/dist/lowdiscrepancy.js.map +1 -0
- package/modules/math/dist/montecarlo.d.ts +58 -0
- package/modules/math/dist/montecarlo.d.ts.map +1 -0
- package/modules/math/dist/montecarlo.js +248 -0
- package/modules/math/dist/montecarlo.js.map +1 -0
- package/modules/math/dist/normal.d.ts +40 -0
- package/modules/math/dist/normal.d.ts.map +1 -0
- package/modules/math/dist/normal.js +157 -0
- package/modules/math/dist/normal.js.map +1 -0
- package/modules/math/dist/optimize.d.ts +83 -0
- package/modules/math/dist/optimize.d.ts.map +1 -0
- package/modules/math/dist/optimize.js +784 -0
- package/modules/math/dist/optimize.js.map +1 -0
- package/modules/math/dist/random.d.ts +76 -0
- package/modules/math/dist/random.d.ts.map +1 -0
- package/modules/math/dist/random.js +261 -0
- package/modules/math/dist/random.js.map +1 -0
- package/modules/math/dist/regression.d.ts +58 -0
- package/modules/math/dist/regression.d.ts.map +1 -0
- package/modules/math/dist/regression.js +283 -0
- package/modules/math/dist/regression.js.map +1 -0
- package/modules/math/dist/resource-validation.d.ts +18 -0
- package/modules/math/dist/resource-validation.d.ts.map +1 -0
- package/modules/math/dist/resource-validation.js +60 -0
- package/modules/math/dist/resource-validation.js.map +1 -0
- package/modules/math/dist/sobol-data.d.ts +36 -0
- package/modules/math/dist/sobol-data.d.ts.map +1 -0
- package/modules/math/dist/sobol-data.js +172 -0
- package/modules/math/dist/sobol-data.js.map +1 -0
- package/modules/math/dist/solvers.d.ts +90 -0
- package/modules/math/dist/solvers.d.ts.map +1 -0
- package/modules/math/dist/solvers.js +663 -0
- package/modules/math/dist/solvers.js.map +1 -0
- package/modules/math/dist/statistics-internal.d.ts +73 -0
- package/modules/math/dist/statistics-internal.d.ts.map +1 -0
- package/modules/math/dist/statistics-internal.js +217 -0
- package/modules/math/dist/statistics-internal.js.map +1 -0
- package/modules/math/dist/statistics.d.ts +113 -0
- package/modules/math/dist/statistics.d.ts.map +1 -0
- package/modules/math/dist/statistics.js +545 -0
- package/modules/math/dist/statistics.js.map +1 -0
- package/modules/math/dist/timeseries.d.ts +131 -0
- package/modules/math/dist/timeseries.d.ts.map +1 -0
- package/modules/math/dist/timeseries.js +502 -0
- package/modules/math/dist/timeseries.js.map +1 -0
- package/modules/math/etc/math.api.md +178 -0
- package/modules/math/src/bivariate.ts +124 -0
- package/modules/math/src/distributions.ts +481 -0
- package/modules/math/src/filters.ts +452 -0
- package/modules/math/src/index.ts +223 -0
- package/modules/math/src/integration.ts +259 -0
- package/modules/math/src/interpolation.ts +588 -0
- package/modules/math/src/linalg.ts +1892 -0
- package/modules/math/src/lowdiscrepancy.ts +241 -0
- package/modules/math/src/montecarlo.ts +326 -0
- package/modules/math/src/normal.ts +161 -0
- package/modules/math/src/optimize.ts +943 -0
- package/modules/math/src/random.ts +372 -0
- package/modules/math/src/regression.ts +340 -0
- package/modules/math/src/resource-validation.ts +79 -0
- package/modules/math/src/sobol-data.ts +187 -0
- package/modules/math/src/solvers.ts +859 -0
- package/modules/math/src/statistics-internal.ts +256 -0
- package/modules/math/src/statistics.ts +636 -0
- package/modules/math/src/timeseries.ts +611 -0
- package/modules/options/dist/american-iv.d.ts +116 -0
- package/modules/options/dist/american-iv.d.ts.map +1 -0
- package/modules/options/dist/american-iv.js +385 -0
- package/modules/options/dist/american-iv.js.map +1 -0
- package/modules/options/dist/arbitrage.d.ts +42 -0
- package/modules/options/dist/arbitrage.d.ts.map +1 -0
- package/modules/options/dist/arbitrage.js +79 -0
- package/modules/options/dist/arbitrage.js.map +1 -0
- package/modules/options/dist/bachelier.d.ts +68 -0
- package/modules/options/dist/bachelier.d.ts.map +1 -0
- package/modules/options/dist/bachelier.js +348 -0
- package/modules/options/dist/bachelier.js.map +1 -0
- package/modules/options/dist/batch.d.ts +82 -0
- package/modules/options/dist/batch.d.ts.map +1 -0
- package/modules/options/dist/batch.js +346 -0
- package/modules/options/dist/batch.js.map +1 -0
- package/modules/options/dist/black-scholes.d.ts +42 -0
- package/modules/options/dist/black-scholes.d.ts.map +1 -0
- package/modules/options/dist/black-scholes.js +334 -0
- package/modules/options/dist/black-scholes.js.map +1 -0
- package/modules/options/dist/black76.d.ts +77 -0
- package/modules/options/dist/black76.d.ts.map +1 -0
- package/modules/options/dist/black76.js +400 -0
- package/modules/options/dist/black76.js.map +1 -0
- package/modules/options/dist/bsm.d.ts +120 -0
- package/modules/options/dist/bsm.d.ts.map +1 -0
- package/modules/options/dist/bsm.js +414 -0
- package/modules/options/dist/bsm.js.map +1 -0
- package/modules/options/dist/chain-greeks.d.ts +69 -0
- package/modules/options/dist/chain-greeks.d.ts.map +1 -0
- package/modules/options/dist/chain-greeks.js +154 -0
- package/modules/options/dist/chain-greeks.js.map +1 -0
- package/modules/options/dist/chain-health.d.ts +254 -0
- package/modules/options/dist/chain-health.d.ts.map +1 -0
- package/modules/options/dist/chain-health.js +746 -0
- package/modules/options/dist/chain-health.js.map +1 -0
- package/modules/options/dist/contract.d.ts +73 -0
- package/modules/options/dist/contract.d.ts.map +1 -0
- package/modules/options/dist/contract.js +226 -0
- package/modules/options/dist/contract.js.map +1 -0
- package/modules/options/dist/dividend-term-structure.d.ts +76 -0
- package/modules/options/dist/dividend-term-structure.d.ts.map +1 -0
- package/modules/options/dist/dividend-term-structure.js +180 -0
- package/modules/options/dist/dividend-term-structure.js.map +1 -0
- package/modules/options/dist/dividends.d.ts +34 -0
- package/modules/options/dist/dividends.d.ts.map +1 -0
- package/modules/options/dist/dividends.js +51 -0
- package/modules/options/dist/dividends.js.map +1 -0
- package/modules/options/dist/engine-bsm.d.ts +22 -0
- package/modules/options/dist/engine-bsm.d.ts.map +1 -0
- package/modules/options/dist/engine-bsm.js +236 -0
- package/modules/options/dist/engine-bsm.js.map +1 -0
- package/modules/options/dist/engines/american-approx.d.ts +29 -0
- package/modules/options/dist/engines/american-approx.d.ts.map +1 -0
- package/modules/options/dist/engines/american-approx.js +483 -0
- package/modules/options/dist/engines/american-approx.js.map +1 -0
- package/modules/options/dist/engines/bounds.d.ts +49 -0
- package/modules/options/dist/engines/bounds.d.ts.map +1 -0
- package/modules/options/dist/engines/bounds.js +58 -0
- package/modules/options/dist/engines/bounds.js.map +1 -0
- package/modules/options/dist/engines/engine-factory.d.ts +92 -0
- package/modules/options/dist/engines/engine-factory.d.ts.map +1 -0
- package/modules/options/dist/engines/engine-factory.js +372 -0
- package/modules/options/dist/engines/engine-factory.js.map +1 -0
- package/modules/options/dist/engines/fd-greeks.d.ts +84 -0
- package/modules/options/dist/engines/fd-greeks.d.ts.map +1 -0
- package/modules/options/dist/engines/fd-greeks.js +343 -0
- package/modules/options/dist/engines/fd-greeks.js.map +1 -0
- package/modules/options/dist/engines/fdm.d.ts +78 -0
- package/modules/options/dist/engines/fdm.d.ts.map +1 -0
- package/modules/options/dist/engines/fdm.js +218 -0
- package/modules/options/dist/engines/fdm.js.map +1 -0
- package/modules/options/dist/engines/scalar-pricing.d.ts +24 -0
- package/modules/options/dist/engines/scalar-pricing.d.ts.map +1 -0
- package/modules/options/dist/engines/scalar-pricing.js +2 -0
- package/modules/options/dist/engines/scalar-pricing.js.map +1 -0
- package/modules/options/dist/engines/tree.d.ts +78 -0
- package/modules/options/dist/engines/tree.d.ts.map +1 -0
- package/modules/options/dist/engines/tree.js +247 -0
- package/modules/options/dist/engines/tree.js.map +1 -0
- package/modules/options/dist/engines.d.ts +272 -0
- package/modules/options/dist/engines.d.ts.map +1 -0
- package/modules/options/dist/engines.js +1309 -0
- package/modules/options/dist/engines.js.map +1 -0
- package/modules/options/dist/equity-lattice.d.ts +58 -0
- package/modules/options/dist/equity-lattice.d.ts.map +1 -0
- package/modules/options/dist/equity-lattice.js +139 -0
- package/modules/options/dist/equity-lattice.js.map +1 -0
- package/modules/options/dist/exercise.d.ts +80 -0
- package/modules/options/dist/exercise.d.ts.map +1 -0
- package/modules/options/dist/exercise.js +266 -0
- package/modules/options/dist/exercise.js.map +1 -0
- package/modules/options/dist/exotics.d.ts +640 -0
- package/modules/options/dist/exotics.d.ts.map +1 -0
- package/modules/options/dist/exotics.js +2880 -0
- package/modules/options/dist/exotics.js.map +1 -0
- package/modules/options/dist/facade-util.d.ts +51 -0
- package/modules/options/dist/facade-util.d.ts.map +1 -0
- package/modules/options/dist/facade-util.js +93 -0
- package/modules/options/dist/facade-util.js.map +1 -0
- package/modules/options/dist/generated/validation-specs.d.ts +12 -0
- package/modules/options/dist/generated/validation-specs.d.ts.map +1 -0
- package/modules/options/dist/generated/validation-specs.js +2616 -0
- package/modules/options/dist/generated/validation-specs.js.map +1 -0
- package/modules/options/dist/heston.d.ts +160 -0
- package/modules/options/dist/heston.d.ts.map +1 -0
- package/modules/options/dist/heston.js +983 -0
- package/modules/options/dist/heston.js.map +1 -0
- package/modules/options/dist/index.d.ts +65 -0
- package/modules/options/dist/index.d.ts.map +1 -0
- package/modules/options/dist/index.js +58 -0
- package/modules/options/dist/index.js.map +1 -0
- package/modules/options/dist/iv.d.ts +85 -0
- package/modules/options/dist/iv.d.ts.map +1 -0
- package/modules/options/dist/iv.js +424 -0
- package/modules/options/dist/iv.js.map +1 -0
- package/modules/options/dist/lattice.d.ts +7 -0
- package/modules/options/dist/lattice.d.ts.map +1 -0
- package/modules/options/dist/lattice.js +7 -0
- package/modules/options/dist/lattice.js.map +1 -0
- package/modules/options/dist/local-volatility.d.ts +128 -0
- package/modules/options/dist/local-volatility.d.ts.map +1 -0
- package/modules/options/dist/local-volatility.js +333 -0
- package/modules/options/dist/local-volatility.js.map +1 -0
- package/modules/options/dist/market.d.ts +19 -0
- package/modules/options/dist/market.d.ts.map +1 -0
- package/modules/options/dist/market.js +58 -0
- package/modules/options/dist/market.js.map +1 -0
- package/modules/options/dist/mc/complex.d.ts +23 -0
- package/modules/options/dist/mc/complex.d.ts.map +1 -0
- package/modules/options/dist/mc/complex.js +42 -0
- package/modules/options/dist/mc/complex.js.map +1 -0
- package/modules/options/dist/mc/core.d.ts +151 -0
- package/modules/options/dist/mc/core.d.ts.map +1 -0
- package/modules/options/dist/mc/core.js +319 -0
- package/modules/options/dist/mc/core.js.map +1 -0
- package/modules/options/dist/monte-carlo.d.ts +66 -0
- package/modules/options/dist/monte-carlo.d.ts.map +1 -0
- package/modules/options/dist/monte-carlo.js +388 -0
- package/modules/options/dist/monte-carlo.js.map +1 -0
- package/modules/options/dist/parity.d.ts +191 -0
- package/modules/options/dist/parity.d.ts.map +1 -0
- package/modules/options/dist/parity.js +566 -0
- package/modules/options/dist/parity.js.map +1 -0
- package/modules/options/dist/payoff-kernel.d.ts +33 -0
- package/modules/options/dist/payoff-kernel.d.ts.map +1 -0
- package/modules/options/dist/payoff-kernel.js +27 -0
- package/modules/options/dist/payoff-kernel.js.map +1 -0
- package/modules/options/dist/payoff.d.ts +34 -0
- package/modules/options/dist/payoff.d.ts.map +1 -0
- package/modules/options/dist/payoff.js +60 -0
- package/modules/options/dist/payoff.js.map +1 -0
- package/modules/options/dist/pricer.d.ts +44 -0
- package/modules/options/dist/pricer.d.ts.map +1 -0
- package/modules/options/dist/pricer.js +179 -0
- package/modules/options/dist/pricer.js.map +1 -0
- package/modules/options/dist/pro.d.ts +82 -0
- package/modules/options/dist/pro.d.ts.map +1 -0
- package/modules/options/dist/pro.js +177 -0
- package/modules/options/dist/pro.js.map +1 -0
- package/modules/options/dist/quote.d.ts +18 -0
- package/modules/options/dist/quote.d.ts.map +1 -0
- package/modules/options/dist/quote.js +26 -0
- package/modules/options/dist/quote.js.map +1 -0
- package/modules/options/dist/resource-validation-internal.d.ts +8 -0
- package/modules/options/dist/resource-validation-internal.d.ts.map +1 -0
- package/modules/options/dist/resource-validation-internal.js +23 -0
- package/modules/options/dist/resource-validation-internal.js.map +1 -0
- package/modules/options/dist/sabr.d.ts +153 -0
- package/modules/options/dist/sabr.d.ts.map +1 -0
- package/modules/options/dist/sabr.js +515 -0
- package/modules/options/dist/sabr.js.map +1 -0
- package/modules/options/dist/schema.d.ts +120 -0
- package/modules/options/dist/schema.d.ts.map +1 -0
- package/modules/options/dist/schema.js +62 -0
- package/modules/options/dist/schema.js.map +1 -0
- package/modules/options/dist/time.d.ts +44 -0
- package/modules/options/dist/time.d.ts.map +1 -0
- package/modules/options/dist/time.js +76 -0
- package/modules/options/dist/time.js.map +1 -0
- package/modules/options/dist/types.d.ts +115 -0
- package/modules/options/dist/types.d.ts.map +1 -0
- package/modules/options/dist/types.js +3 -0
- package/modules/options/dist/types.js.map +1 -0
- package/modules/options/etc/options.api.md +230 -0
- package/modules/options/src/american-iv.ts +547 -0
- package/modules/options/src/arbitrage.ts +134 -0
- package/modules/options/src/bachelier.ts +515 -0
- package/modules/options/src/batch.ts +496 -0
- package/modules/options/src/black-scholes.ts +501 -0
- package/modules/options/src/black76.ts +573 -0
- package/modules/options/src/bsm.ts +575 -0
- package/modules/options/src/chain-greeks.ts +242 -0
- package/modules/options/src/chain-health.ts +1083 -0
- package/modules/options/src/contract.ts +329 -0
- package/modules/options/src/dividend-term-structure.ts +303 -0
- package/modules/options/src/dividends.ts +75 -0
- package/modules/options/src/engine-bsm.ts +306 -0
- package/modules/options/src/engines/american-approx.ts +669 -0
- package/modules/options/src/engines/bounds.ts +106 -0
- package/modules/options/src/engines/engine-factory.ts +502 -0
- package/modules/options/src/engines/fd-greeks.ts +426 -0
- package/modules/options/src/engines/fdm.ts +302 -0
- package/modules/options/src/engines/scalar-pricing.ts +27 -0
- package/modules/options/src/engines/tree.ts +350 -0
- package/modules/options/src/engines.ts +1845 -0
- package/modules/options/src/equity-lattice.ts +224 -0
- package/modules/options/src/exercise.ts +422 -0
- package/modules/options/src/exotics.ts +3966 -0
- package/modules/options/src/facade-util.ts +137 -0
- package/modules/options/src/generated/validation-specs.ts +2621 -0
- package/modules/options/src/heston.ts +1348 -0
- package/modules/options/src/index.ts +325 -0
- package/modules/options/src/iv.ts +591 -0
- package/modules/options/src/lattice.ts +6 -0
- package/modules/options/src/local-volatility.ts +493 -0
- package/modules/options/src/market.ts +74 -0
- package/modules/options/src/mc/complex.ts +55 -0
- package/modules/options/src/mc/core.ts +538 -0
- package/modules/options/src/monte-carlo.ts +567 -0
- package/modules/options/src/parity.ts +928 -0
- package/modules/options/src/payoff-kernel.ts +39 -0
- package/modules/options/src/payoff.ts +81 -0
- package/modules/options/src/pricer.ts +217 -0
- package/modules/options/src/pro.ts +272 -0
- package/modules/options/src/quote.ts +34 -0
- package/modules/options/src/resource-validation-internal.ts +31 -0
- package/modules/options/src/sabr.ts +716 -0
- package/modules/options/src/schema.ts +73 -0
- package/modules/options/src/time.ts +104 -0
- package/modules/options/src/types.ts +124 -0
- package/modules/performance/dist/activity.d.ts +24 -0
- package/modules/performance/dist/activity.d.ts.map +1 -0
- package/modules/performance/dist/activity.js +137 -0
- package/modules/performance/dist/activity.js.map +1 -0
- package/modules/performance/dist/analyze.d.ts +85 -0
- package/modules/performance/dist/analyze.d.ts.map +1 -0
- package/modules/performance/dist/analyze.js +203 -0
- package/modules/performance/dist/analyze.js.map +1 -0
- package/modules/performance/dist/annualization-internal.d.ts +21 -0
- package/modules/performance/dist/annualization-internal.d.ts.map +1 -0
- package/modules/performance/dist/annualization-internal.js +34 -0
- package/modules/performance/dist/annualization-internal.js.map +1 -0
- package/modules/performance/dist/drawdown.d.ts +34 -0
- package/modules/performance/dist/drawdown.d.ts.map +1 -0
- package/modules/performance/dist/drawdown.js +99 -0
- package/modules/performance/dist/drawdown.js.map +1 -0
- package/modules/performance/dist/flow-aware.d.ts +388 -0
- package/modules/performance/dist/flow-aware.d.ts.map +1 -0
- package/modules/performance/dist/flow-aware.js +888 -0
- package/modules/performance/dist/flow-aware.js.map +1 -0
- package/modules/performance/dist/index.d.ts +26 -0
- package/modules/performance/dist/index.d.ts.map +1 -0
- package/modules/performance/dist/index.js +25 -0
- package/modules/performance/dist/index.js.map +1 -0
- package/modules/performance/dist/metrics.d.ts +13 -0
- package/modules/performance/dist/metrics.d.ts.map +1 -0
- package/modules/performance/dist/metrics.js +87 -0
- package/modules/performance/dist/metrics.js.map +1 -0
- package/modules/performance/dist/ratios.d.ts +55 -0
- package/modules/performance/dist/ratios.d.ts.map +1 -0
- package/modules/performance/dist/ratios.js +168 -0
- package/modules/performance/dist/ratios.js.map +1 -0
- package/modules/performance/dist/relative.d.ts +33 -0
- package/modules/performance/dist/relative.d.ts.map +1 -0
- package/modules/performance/dist/relative.js +150 -0
- package/modules/performance/dist/relative.js.map +1 -0
- package/modules/performance/dist/returns.d.ts +18 -0
- package/modules/performance/dist/returns.d.ts.map +1 -0
- package/modules/performance/dist/returns.js +70 -0
- package/modules/performance/dist/returns.js.map +1 -0
- package/modules/performance/dist/rolling.d.ts +36 -0
- package/modules/performance/dist/rolling.d.ts.map +1 -0
- package/modules/performance/dist/rolling.js +102 -0
- package/modules/performance/dist/rolling.js.map +1 -0
- package/modules/performance/dist/sector-performance-internal.d.ts +61 -0
- package/modules/performance/dist/sector-performance-internal.d.ts.map +1 -0
- package/modules/performance/dist/sector-performance-internal.js +216 -0
- package/modules/performance/dist/sector-performance-internal.js.map +1 -0
- package/modules/performance/dist/sector-performance.d.ts +288 -0
- package/modules/performance/dist/sector-performance.d.ts.map +1 -0
- package/modules/performance/dist/sector-performance.js +690 -0
- package/modules/performance/dist/sector-performance.js.map +1 -0
- package/modules/performance/dist/sharpe.d.ts +74 -0
- package/modules/performance/dist/sharpe.d.ts.map +1 -0
- package/modules/performance/dist/sharpe.js +157 -0
- package/modules/performance/dist/sharpe.js.map +1 -0
- package/modules/performance/etc/performance.api.md +109 -0
- package/modules/performance/src/activity.ts +182 -0
- package/modules/performance/src/analyze.ts +305 -0
- package/modules/performance/src/annualization-internal.ts +43 -0
- package/modules/performance/src/drawdown.ts +132 -0
- package/modules/performance/src/flow-aware.ts +1518 -0
- package/modules/performance/src/index.ts +89 -0
- package/modules/performance/src/metrics.ts +150 -0
- package/modules/performance/src/ratios.ts +243 -0
- package/modules/performance/src/relative.ts +278 -0
- package/modules/performance/src/returns.ts +80 -0
- package/modules/performance/src/rolling.ts +155 -0
- package/modules/performance/src/sector-performance-internal.ts +293 -0
- package/modules/performance/src/sector-performance.ts +1263 -0
- package/modules/performance/src/sharpe.ts +256 -0
- package/modules/portfolio/dist/allocation.d.ts +227 -0
- package/modules/portfolio/dist/allocation.d.ts.map +1 -0
- package/modules/portfolio/dist/allocation.js +545 -0
- package/modules/portfolio/dist/allocation.js.map +1 -0
- package/modules/portfolio/dist/events.d.ts +502 -0
- package/modules/portfolio/dist/events.d.ts.map +1 -0
- package/modules/portfolio/dist/events.js +1061 -0
- package/modules/portfolio/dist/events.js.map +1 -0
- package/modules/portfolio/dist/index.d.ts +47 -0
- package/modules/portfolio/dist/index.d.ts.map +1 -0
- package/modules/portfolio/dist/index.js +34 -0
- package/modules/portfolio/dist/index.js.map +1 -0
- package/modules/portfolio/dist/internal.d.ts +101 -0
- package/modules/portfolio/dist/internal.d.ts.map +1 -0
- package/modules/portfolio/dist/internal.js +356 -0
- package/modules/portfolio/dist/internal.js.map +1 -0
- package/modules/portfolio/dist/ledger.d.ts +129 -0
- package/modules/portfolio/dist/ledger.d.ts.map +1 -0
- package/modules/portfolio/dist/ledger.js +271 -0
- package/modules/portfolio/dist/ledger.js.map +1 -0
- package/modules/portfolio/dist/lifecycle-corporate.d.ts +49 -0
- package/modules/portfolio/dist/lifecycle-corporate.d.ts.map +1 -0
- package/modules/portfolio/dist/lifecycle-corporate.js +462 -0
- package/modules/portfolio/dist/lifecycle-corporate.js.map +1 -0
- package/modules/portfolio/dist/lifecycle-derivatives.d.ts +59 -0
- package/modules/portfolio/dist/lifecycle-derivatives.d.ts.map +1 -0
- package/modules/portfolio/dist/lifecycle-derivatives.js +422 -0
- package/modules/portfolio/dist/lifecycle-derivatives.js.map +1 -0
- package/modules/portfolio/dist/marks.d.ts +44 -0
- package/modules/portfolio/dist/marks.d.ts.map +1 -0
- package/modules/portfolio/dist/marks.js +81 -0
- package/modules/portfolio/dist/marks.js.map +1 -0
- package/modules/portfolio/dist/monitor.d.ts +222 -0
- package/modules/portfolio/dist/monitor.d.ts.map +1 -0
- package/modules/portfolio/dist/monitor.js +1806 -0
- package/modules/portfolio/dist/monitor.js.map +1 -0
- package/modules/portfolio/dist/performance.d.ts +78 -0
- package/modules/portfolio/dist/performance.d.ts.map +1 -0
- package/modules/portfolio/dist/performance.js +146 -0
- package/modules/portfolio/dist/performance.js.map +1 -0
- package/modules/portfolio/dist/pnl.d.ts +154 -0
- package/modules/portfolio/dist/pnl.d.ts.map +1 -0
- package/modules/portfolio/dist/pnl.js +548 -0
- package/modules/portfolio/dist/pnl.js.map +1 -0
- package/modules/portfolio/dist/policy-grammar.d.ts +358 -0
- package/modules/portfolio/dist/policy-grammar.d.ts.map +1 -0
- package/modules/portfolio/dist/policy-grammar.js +1198 -0
- package/modules/portfolio/dist/policy-grammar.js.map +1 -0
- package/modules/portfolio/dist/policy.d.ts +24 -0
- package/modules/portfolio/dist/policy.d.ts.map +1 -0
- package/modules/portfolio/dist/policy.js +20 -0
- package/modules/portfolio/dist/policy.js.map +1 -0
- package/modules/portfolio/dist/rebalance.d.ts +281 -0
- package/modules/portfolio/dist/rebalance.d.ts.map +1 -0
- package/modules/portfolio/dist/rebalance.js +1236 -0
- package/modules/portfolio/dist/rebalance.js.map +1 -0
- package/modules/portfolio/dist/reconciliation.d.ts +150 -0
- package/modules/portfolio/dist/reconciliation.d.ts.map +1 -0
- package/modules/portfolio/dist/reconciliation.js +392 -0
- package/modules/portfolio/dist/reconciliation.js.map +1 -0
- package/modules/portfolio/dist/reducer-kernel.d.ts +92 -0
- package/modules/portfolio/dist/reducer-kernel.d.ts.map +1 -0
- package/modules/portfolio/dist/reducer-kernel.js +320 -0
- package/modules/portfolio/dist/reducer-kernel.js.map +1 -0
- package/modules/portfolio/dist/snapshot.d.ts +128 -0
- package/modules/portfolio/dist/snapshot.d.ts.map +1 -0
- package/modules/portfolio/dist/snapshot.js +205 -0
- package/modules/portfolio/dist/snapshot.js.map +1 -0
- package/modules/portfolio/dist/state.d.ts +196 -0
- package/modules/portfolio/dist/state.d.ts.map +1 -0
- package/modules/portfolio/dist/state.js +1093 -0
- package/modules/portfolio/dist/state.js.map +1 -0
- package/modules/portfolio/dist/timeline.d.ts +107 -0
- package/modules/portfolio/dist/timeline.d.ts.map +1 -0
- package/modules/portfolio/dist/timeline.js +220 -0
- package/modules/portfolio/dist/timeline.js.map +1 -0
- package/modules/portfolio/dist/trade/grant.d.ts +21 -0
- package/modules/portfolio/dist/trade/grant.d.ts.map +1 -0
- package/modules/portfolio/dist/trade/grant.js +411 -0
- package/modules/portfolio/dist/trade/grant.js.map +1 -0
- package/modules/portfolio/dist/trade/index.d.ts +20 -0
- package/modules/portfolio/dist/trade/index.d.ts.map +1 -0
- package/modules/portfolio/dist/trade/index.js +17 -0
- package/modules/portfolio/dist/trade/index.js.map +1 -0
- package/modules/portfolio/dist/trade/journal.d.ts +23 -0
- package/modules/portfolio/dist/trade/journal.d.ts.map +1 -0
- package/modules/portfolio/dist/trade/journal.js +352 -0
- package/modules/portfolio/dist/trade/journal.js.map +1 -0
- package/modules/portfolio/dist/trade/plan.d.ts +25 -0
- package/modules/portfolio/dist/trade/plan.d.ts.map +1 -0
- package/modules/portfolio/dist/trade/plan.js +285 -0
- package/modules/portfolio/dist/trade/plan.js.map +1 -0
- package/modules/portfolio/dist/trade/policy.d.ts +5 -0
- package/modules/portfolio/dist/trade/policy.d.ts.map +1 -0
- package/modules/portfolio/dist/trade/policy.js +133 -0
- package/modules/portfolio/dist/trade/policy.js.map +1 -0
- package/modules/portfolio/dist/trade/preflight.d.ts +3 -0
- package/modules/portfolio/dist/trade/preflight.d.ts.map +1 -0
- package/modules/portfolio/dist/trade/preflight.js +381 -0
- package/modules/portfolio/dist/trade/preflight.js.map +1 -0
- package/modules/portfolio/dist/trade/reconcile.d.ts +8 -0
- package/modules/portfolio/dist/trade/reconcile.d.ts.map +1 -0
- package/modules/portfolio/dist/trade/reconcile.js +240 -0
- package/modules/portfolio/dist/trade/reconcile.js.map +1 -0
- package/modules/portfolio/dist/trade/types.d.ts +559 -0
- package/modules/portfolio/dist/trade/types.d.ts.map +1 -0
- package/modules/portfolio/dist/trade/types.js +36 -0
- package/modules/portfolio/dist/trade/types.js.map +1 -0
- package/modules/portfolio/dist/trade/validate.d.ts +36 -0
- package/modules/portfolio/dist/trade/validate.d.ts.map +1 -0
- package/modules/portfolio/dist/trade/validate.js +776 -0
- package/modules/portfolio/dist/trade/validate.js.map +1 -0
- package/modules/portfolio/etc/portfolio.api.md +236 -0
- package/modules/portfolio/src/allocation.ts +844 -0
- package/modules/portfolio/src/events.ts +1968 -0
- package/modules/portfolio/src/index.ts +295 -0
- package/modules/portfolio/src/internal.ts +523 -0
- package/modules/portfolio/src/ledger.ts +420 -0
- package/modules/portfolio/src/lifecycle-corporate.ts +888 -0
- package/modules/portfolio/src/lifecycle-derivatives.ts +735 -0
- package/modules/portfolio/src/marks.ts +140 -0
- package/modules/portfolio/src/monitor.ts +2421 -0
- package/modules/portfolio/src/performance.ts +237 -0
- package/modules/portfolio/src/pnl.ts +840 -0
- package/modules/portfolio/src/policy-grammar.ts +1891 -0
- package/modules/portfolio/src/policy.ts +119 -0
- package/modules/portfolio/src/rebalance.ts +1742 -0
- package/modules/portfolio/src/reconciliation.ts +621 -0
- package/modules/portfolio/src/reducer-kernel.ts +512 -0
- package/modules/portfolio/src/snapshot.ts +372 -0
- package/modules/portfolio/src/state.ts +1776 -0
- package/modules/portfolio/src/timeline.ts +359 -0
- package/modules/portfolio/src/trade/grant.ts +514 -0
- package/modules/portfolio/src/trade/index.ts +96 -0
- package/modules/portfolio/src/trade/journal.ts +432 -0
- package/modules/portfolio/src/trade/plan.ts +424 -0
- package/modules/portfolio/src/trade/policy.ts +153 -0
- package/modules/portfolio/src/trade/preflight.ts +605 -0
- package/modules/portfolio/src/trade/reconcile.ts +276 -0
- package/modules/portfolio/src/trade/types.ts +637 -0
- package/modules/portfolio/src/trade/validate.ts +1213 -0
- package/modules/research/dist/artifacts.d.ts +25 -0
- package/modules/research/dist/artifacts.d.ts.map +1 -0
- package/modules/research/dist/artifacts.js +22 -0
- package/modules/research/dist/artifacts.js.map +1 -0
- package/modules/research/dist/events.d.ts +238 -0
- package/modules/research/dist/events.d.ts.map +1 -0
- package/modules/research/dist/events.js +844 -0
- package/modules/research/dist/events.js.map +1 -0
- package/modules/research/dist/factors.d.ts +330 -0
- package/modules/research/dist/factors.d.ts.map +1 -0
- package/modules/research/dist/factors.js +891 -0
- package/modules/research/dist/factors.js.map +1 -0
- package/modules/research/dist/index.d.ts +11 -0
- package/modules/research/dist/index.d.ts.map +1 -0
- package/modules/research/dist/index.js +13 -0
- package/modules/research/dist/index.js.map +1 -0
- package/modules/research/dist/observations.d.ts +77 -0
- package/modules/research/dist/observations.d.ts.map +1 -0
- package/modules/research/dist/observations.js +201 -0
- package/modules/research/dist/observations.js.map +1 -0
- package/modules/research/dist/point-in-time.d.ts +17 -0
- package/modules/research/dist/point-in-time.d.ts.map +1 -0
- package/modules/research/dist/point-in-time.js +34 -0
- package/modules/research/dist/point-in-time.js.map +1 -0
- package/modules/research/dist/research-hygiene.d.ts +126 -0
- package/modules/research/dist/research-hygiene.d.ts.map +1 -0
- package/modules/research/dist/research-hygiene.js +290 -0
- package/modules/research/dist/research-hygiene.js.map +1 -0
- package/modules/research/dist/research-run-artifacts.d.ts +315 -0
- package/modules/research/dist/research-run-artifacts.d.ts.map +1 -0
- package/modules/research/dist/research-run-artifacts.js +766 -0
- package/modules/research/dist/research-run-artifacts.js.map +1 -0
- package/modules/research/dist/research-run-kinds.d.ts +135 -0
- package/modules/research/dist/research-run-kinds.d.ts.map +1 -0
- package/modules/research/dist/research-run-kinds.js +470 -0
- package/modules/research/dist/research-run-kinds.js.map +1 -0
- package/modules/research/dist/screening.d.ts +215 -0
- package/modules/research/dist/screening.d.ts.map +1 -0
- package/modules/research/dist/screening.js +616 -0
- package/modules/research/dist/screening.js.map +1 -0
- package/modules/research/dist/universe.d.ts +131 -0
- package/modules/research/dist/universe.d.ts.map +1 -0
- package/modules/research/dist/universe.js +294 -0
- package/modules/research/dist/universe.js.map +1 -0
- package/modules/research/etc/research.api.md +109 -0
- package/modules/research/src/artifacts.ts +68 -0
- package/modules/research/src/events.ts +1358 -0
- package/modules/research/src/factors.ts +1322 -0
- package/modules/research/src/index.ts +28 -0
- package/modules/research/src/observations.ts +360 -0
- package/modules/research/src/point-in-time.ts +44 -0
- package/modules/research/src/research-hygiene.ts +544 -0
- package/modules/research/src/research-run-artifacts.ts +1464 -0
- package/modules/research/src/research-run-kinds.ts +723 -0
- package/modules/research/src/screening.ts +957 -0
- package/modules/research/src/universe.ts +494 -0
- package/modules/risk/dist/attribution.d.ts +166 -0
- package/modules/risk/dist/attribution.d.ts.map +1 -0
- package/modules/risk/dist/attribution.js +278 -0
- package/modules/risk/dist/attribution.js.map +1 -0
- package/modules/risk/dist/book-var.d.ts +113 -0
- package/modules/risk/dist/book-var.d.ts.map +1 -0
- package/modules/risk/dist/book-var.js +487 -0
- package/modules/risk/dist/book-var.js.map +1 -0
- package/modules/risk/dist/book.d.ts +95 -0
- package/modules/risk/dist/book.d.ts.map +1 -0
- package/modules/risk/dist/book.js +201 -0
- package/modules/risk/dist/book.js.map +1 -0
- package/modules/risk/dist/covariance.d.ts +96 -0
- package/modules/risk/dist/covariance.d.ts.map +1 -0
- package/modules/risk/dist/covariance.js +183 -0
- package/modules/risk/dist/covariance.js.map +1 -0
- package/modules/risk/dist/evt.d.ts +188 -0
- package/modules/risk/dist/evt.d.ts.map +1 -0
- package/modules/risk/dist/evt.js +625 -0
- package/modules/risk/dist/evt.js.map +1 -0
- package/modules/risk/dist/expected-returns.d.ts +139 -0
- package/modules/risk/dist/expected-returns.d.ts.map +1 -0
- package/modules/risk/dist/expected-returns.js +350 -0
- package/modules/risk/dist/expected-returns.js.map +1 -0
- package/modules/risk/dist/factor.d.ts +66 -0
- package/modules/risk/dist/factor.d.ts.map +1 -0
- package/modules/risk/dist/factor.js +133 -0
- package/modules/risk/dist/factor.js.map +1 -0
- package/modules/risk/dist/frontier.d.ts +158 -0
- package/modules/risk/dist/frontier.d.ts.map +1 -0
- package/modules/risk/dist/frontier.js +1183 -0
- package/modules/risk/dist/frontier.js.map +1 -0
- package/modules/risk/dist/index.d.ts +47 -0
- package/modules/risk/dist/index.d.ts.map +1 -0
- package/modules/risk/dist/index.js +43 -0
- package/modules/risk/dist/index.js.map +1 -0
- package/modules/risk/dist/input-description.d.ts +3 -0
- package/modules/risk/dist/input-description.d.ts.map +1 -0
- package/modules/risk/dist/input-description.js +24 -0
- package/modules/risk/dist/input-description.js.map +1 -0
- package/modules/risk/dist/kelly.d.ts +217 -0
- package/modules/risk/dist/kelly.d.ts.map +1 -0
- package/modules/risk/dist/kelly.js +731 -0
- package/modules/risk/dist/kelly.js.map +1 -0
- package/modules/risk/dist/linalg.d.ts +27 -0
- package/modules/risk/dist/linalg.d.ts.map +1 -0
- package/modules/risk/dist/linalg.js +89 -0
- package/modules/risk/dist/linalg.js.map +1 -0
- package/modules/risk/dist/numeric-vector.d.ts +9 -0
- package/modules/risk/dist/numeric-vector.d.ts.map +1 -0
- package/modules/risk/dist/numeric-vector.js +112 -0
- package/modules/risk/dist/numeric-vector.js.map +1 -0
- package/modules/risk/dist/optimize.d.ts +231 -0
- package/modules/risk/dist/optimize.d.ts.map +1 -0
- package/modules/risk/dist/optimize.js +1258 -0
- package/modules/risk/dist/optimize.js.map +1 -0
- package/modules/risk/dist/optimizer-validation.d.ts +26 -0
- package/modules/risk/dist/optimizer-validation.d.ts.map +1 -0
- package/modules/risk/dist/optimizer-validation.js +306 -0
- package/modules/risk/dist/optimizer-validation.js.map +1 -0
- package/modules/risk/dist/options-internal.d.ts +18 -0
- package/modules/risk/dist/options-internal.d.ts.map +1 -0
- package/modules/risk/dist/options-internal.js +49 -0
- package/modules/risk/dist/options-internal.js.map +1 -0
- package/modules/risk/dist/pnl-explain.d.ts +169 -0
- package/modules/risk/dist/pnl-explain.d.ts.map +1 -0
- package/modules/risk/dist/pnl-explain.js +327 -0
- package/modules/risk/dist/pnl-explain.js.map +1 -0
- package/modules/risk/dist/portfolio.d.ts +322 -0
- package/modules/risk/dist/portfolio.d.ts.map +1 -0
- package/modules/risk/dist/portfolio.js +547 -0
- package/modules/risk/dist/portfolio.js.map +1 -0
- package/modules/risk/dist/research-protocol.d.ts +74 -0
- package/modules/risk/dist/research-protocol.d.ts.map +1 -0
- package/modules/risk/dist/research-protocol.js +193 -0
- package/modules/risk/dist/research-protocol.js.map +1 -0
- package/modules/risk/dist/research.d.ts +255 -0
- package/modules/risk/dist/research.d.ts.map +1 -0
- package/modules/risk/dist/research.js +752 -0
- package/modules/risk/dist/research.js.map +1 -0
- package/modules/risk/dist/scenario.d.ts +279 -0
- package/modules/risk/dist/scenario.d.ts.map +1 -0
- package/modules/risk/dist/scenario.js +458 -0
- package/modules/risk/dist/scenario.js.map +1 -0
- package/modules/risk/dist/sizing.d.ts +14 -0
- package/modules/risk/dist/sizing.d.ts.map +1 -0
- package/modules/risk/dist/sizing.js +12 -0
- package/modules/risk/dist/sizing.js.map +1 -0
- package/modules/risk/dist/strategy-shape.d.ts +84 -0
- package/modules/risk/dist/strategy-shape.d.ts.map +1 -0
- package/modules/risk/dist/strategy-shape.js +17 -0
- package/modules/risk/dist/strategy-shape.js.map +1 -0
- package/modules/risk/dist/value-at-risk.d.ts +240 -0
- package/modules/risk/dist/value-at-risk.d.ts.map +1 -0
- package/modules/risk/dist/value-at-risk.js +743 -0
- package/modules/risk/dist/value-at-risk.js.map +1 -0
- package/modules/risk/etc/risk.api.md +228 -0
- package/modules/risk/src/attribution.ts +480 -0
- package/modules/risk/src/book-var.ts +717 -0
- package/modules/risk/src/book.ts +327 -0
- package/modules/risk/src/covariance.ts +293 -0
- package/modules/risk/src/evt.ts +899 -0
- package/modules/risk/src/expected-returns.ts +572 -0
- package/modules/risk/src/factor.ts +199 -0
- package/modules/risk/src/frontier.ts +1570 -0
- package/modules/risk/src/index.ts +281 -0
- package/modules/risk/src/input-description.ts +15 -0
- package/modules/risk/src/kelly.ts +1119 -0
- package/modules/risk/src/linalg.ts +100 -0
- package/modules/risk/src/numeric-vector.ts +153 -0
- package/modules/risk/src/optimize.ts +1769 -0
- package/modules/risk/src/optimizer-validation.ts +467 -0
- package/modules/risk/src/options-internal.ts +73 -0
- package/modules/risk/src/pnl-explain.ts +544 -0
- package/modules/risk/src/portfolio.ts +911 -0
- package/modules/risk/src/research-protocol.ts +277 -0
- package/modules/risk/src/research.ts +1076 -0
- package/modules/risk/src/scenario.ts +728 -0
- package/modules/risk/src/sizing.ts +15 -0
- package/modules/risk/src/strategy-shape.ts +90 -0
- package/modules/risk/src/value-at-risk.ts +1102 -0
- package/modules/scenarios/dist/aggregates.d.ts +27 -0
- package/modules/scenarios/dist/aggregates.d.ts.map +1 -0
- package/modules/scenarios/dist/aggregates.js +262 -0
- package/modules/scenarios/dist/aggregates.js.map +1 -0
- package/modules/scenarios/dist/fx.d.ts +69 -0
- package/modules/scenarios/dist/fx.d.ts.map +1 -0
- package/modules/scenarios/dist/fx.js +349 -0
- package/modules/scenarios/dist/fx.js.map +1 -0
- package/modules/scenarios/dist/index.d.ts +6 -0
- package/modules/scenarios/dist/index.d.ts.map +1 -0
- package/modules/scenarios/dist/index.js +6 -0
- package/modules/scenarios/dist/index.js.map +1 -0
- package/modules/scenarios/dist/internal/behaviors.d.ts +28 -0
- package/modules/scenarios/dist/internal/behaviors.d.ts.map +1 -0
- package/modules/scenarios/dist/internal/behaviors.js +169 -0
- package/modules/scenarios/dist/internal/behaviors.js.map +1 -0
- package/modules/scenarios/dist/internal/data.d.ts +35 -0
- package/modules/scenarios/dist/internal/data.d.ts.map +1 -0
- package/modules/scenarios/dist/internal/data.js +194 -0
- package/modules/scenarios/dist/internal/data.js.map +1 -0
- package/modules/scenarios/dist/internal/failures.d.ts +18 -0
- package/modules/scenarios/dist/internal/failures.d.ts.map +1 -0
- package/modules/scenarios/dist/internal/failures.js +184 -0
- package/modules/scenarios/dist/internal/failures.js.map +1 -0
- package/modules/scenarios/dist/internal/results.d.ts +18 -0
- package/modules/scenarios/dist/internal/results.d.ts.map +1 -0
- package/modules/scenarios/dist/internal/results.js +100 -0
- package/modules/scenarios/dist/internal/results.js.map +1 -0
- package/modules/scenarios/dist/market-resolution.d.ts +32 -0
- package/modules/scenarios/dist/market-resolution.d.ts.map +1 -0
- package/modules/scenarios/dist/market-resolution.js +296 -0
- package/modules/scenarios/dist/market-resolution.js.map +1 -0
- package/modules/scenarios/dist/portfolio.d.ts +11 -0
- package/modules/scenarios/dist/portfolio.d.ts.map +1 -0
- package/modules/scenarios/dist/portfolio.js +419 -0
- package/modules/scenarios/dist/portfolio.js.map +1 -0
- package/modules/scenarios/dist/run.d.ts +4 -0
- package/modules/scenarios/dist/run.d.ts.map +1 -0
- package/modules/scenarios/dist/run.js +933 -0
- package/modules/scenarios/dist/run.js.map +1 -0
- package/modules/scenarios/dist/spot-pricer.d.ts +21 -0
- package/modules/scenarios/dist/spot-pricer.d.ts.map +1 -0
- package/modules/scenarios/dist/spot-pricer.js +97 -0
- package/modules/scenarios/dist/spot-pricer.js.map +1 -0
- package/modules/scenarios/dist/targets.d.ts +18 -0
- package/modules/scenarios/dist/targets.d.ts.map +1 -0
- package/modules/scenarios/dist/targets.js +507 -0
- package/modules/scenarios/dist/targets.js.map +1 -0
- package/modules/scenarios/dist/taylor.d.ts +23 -0
- package/modules/scenarios/dist/taylor.d.ts.map +1 -0
- package/modules/scenarios/dist/taylor.js +209 -0
- package/modules/scenarios/dist/taylor.js.map +1 -0
- package/modules/scenarios/dist/transform.d.ts +31 -0
- package/modules/scenarios/dist/transform.d.ts.map +1 -0
- package/modules/scenarios/dist/transform.js +318 -0
- package/modules/scenarios/dist/transform.js.map +1 -0
- package/modules/scenarios/dist/types.d.ts +591 -0
- package/modules/scenarios/dist/types.d.ts.map +1 -0
- package/modules/scenarios/dist/types.js +2 -0
- package/modules/scenarios/dist/types.js.map +1 -0
- package/modules/scenarios/dist/work.d.ts +85 -0
- package/modules/scenarios/dist/work.d.ts.map +1 -0
- package/modules/scenarios/dist/work.js +629 -0
- package/modules/scenarios/dist/work.js.map +1 -0
- package/modules/scenarios/etc/scenarios.api.md +76 -0
- package/modules/scenarios/src/aggregates.ts +429 -0
- package/modules/scenarios/src/fx.ts +563 -0
- package/modules/scenarios/src/index.ts +5 -0
- package/modules/scenarios/src/internal/behaviors.ts +249 -0
- package/modules/scenarios/src/internal/data.ts +258 -0
- package/modules/scenarios/src/internal/failures.ts +219 -0
- package/modules/scenarios/src/internal/results.ts +131 -0
- package/modules/scenarios/src/market-resolution.ts +436 -0
- package/modules/scenarios/src/portfolio.ts +639 -0
- package/modules/scenarios/src/run.ts +1417 -0
- package/modules/scenarios/src/spot-pricer.ts +129 -0
- package/modules/scenarios/src/targets.ts +729 -0
- package/modules/scenarios/src/taylor.ts +287 -0
- package/modules/scenarios/src/transform.ts +468 -0
- package/modules/scenarios/src/types.ts +713 -0
- package/modules/scenarios/src/work.ts +1055 -0
- package/modules/strategy/dist/auto-range.d.ts +14 -0
- package/modules/strategy/dist/auto-range.d.ts.map +1 -0
- package/modules/strategy/dist/auto-range.js +19 -0
- package/modules/strategy/dist/auto-range.js.map +1 -0
- package/modules/strategy/dist/builders.d.ts +75 -0
- package/modules/strategy/dist/builders.d.ts.map +1 -0
- package/modules/strategy/dist/builders.js +112 -0
- package/modules/strategy/dist/builders.js.map +1 -0
- package/modules/strategy/dist/calendars.d.ts +70 -0
- package/modules/strategy/dist/calendars.d.ts.map +1 -0
- package/modules/strategy/dist/calendars.js +149 -0
- package/modules/strategy/dist/calendars.js.map +1 -0
- package/modules/strategy/dist/classify.d.ts +77 -0
- package/modules/strategy/dist/classify.d.ts.map +1 -0
- package/modules/strategy/dist/classify.js +144 -0
- package/modules/strategy/dist/classify.js.map +1 -0
- package/modules/strategy/dist/explain.d.ts +77 -0
- package/modules/strategy/dist/explain.d.ts.map +1 -0
- package/modules/strategy/dist/explain.js +300 -0
- package/modules/strategy/dist/explain.js.map +1 -0
- package/modules/strategy/dist/from-chain.d.ts +88 -0
- package/modules/strategy/dist/from-chain.d.ts.map +1 -0
- package/modules/strategy/dist/from-chain.js +457 -0
- package/modules/strategy/dist/from-chain.js.map +1 -0
- package/modules/strategy/dist/index.d.ts +102 -0
- package/modules/strategy/dist/index.d.ts.map +1 -0
- package/modules/strategy/dist/index.js +41 -0
- package/modules/strategy/dist/index.js.map +1 -0
- package/modules/strategy/dist/legs.d.ts +47 -0
- package/modules/strategy/dist/legs.d.ts.map +1 -0
- package/modules/strategy/dist/legs.js +87 -0
- package/modules/strategy/dist/legs.js.map +1 -0
- package/modules/strategy/dist/manifest.d.ts +116 -0
- package/modules/strategy/dist/manifest.d.ts.map +1 -0
- package/modules/strategy/dist/manifest.js +376 -0
- package/modules/strategy/dist/manifest.js.map +1 -0
- package/modules/strategy/dist/optimizer.d.ts +184 -0
- package/modules/strategy/dist/optimizer.d.ts.map +1 -0
- package/modules/strategy/dist/optimizer.js +404 -0
- package/modules/strategy/dist/optimizer.js.map +1 -0
- package/modules/strategy/dist/position.d.ts +181 -0
- package/modules/strategy/dist/position.d.ts.map +1 -0
- package/modules/strategy/dist/position.js +1693 -0
- package/modules/strategy/dist/position.js.map +1 -0
- package/modules/strategy/dist/probability.d.ts +192 -0
- package/modules/strategy/dist/probability.d.ts.map +1 -0
- package/modules/strategy/dist/probability.js +106 -0
- package/modules/strategy/dist/probability.js.map +1 -0
- package/modules/strategy/dist/scanner.d.ts +147 -0
- package/modules/strategy/dist/scanner.d.ts.map +1 -0
- package/modules/strategy/dist/scanner.js +438 -0
- package/modules/strategy/dist/scanner.js.map +1 -0
- package/modules/strategy/dist/strategies.d.ts +187 -0
- package/modules/strategy/dist/strategies.d.ts.map +1 -0
- package/modules/strategy/dist/strategies.js +541 -0
- package/modules/strategy/dist/strategies.js.map +1 -0
- package/modules/strategy/dist/svg.d.ts +35 -0
- package/modules/strategy/dist/svg.d.ts.map +1 -0
- package/modules/strategy/dist/svg.js +298 -0
- package/modules/strategy/dist/svg.js.map +1 -0
- package/modules/strategy/dist/thesis-distribution.d.ts +79 -0
- package/modules/strategy/dist/thesis-distribution.d.ts.map +1 -0
- package/modules/strategy/dist/thesis-distribution.js +125 -0
- package/modules/strategy/dist/thesis-distribution.js.map +1 -0
- package/modules/strategy/dist/types.d.ts +370 -0
- package/modules/strategy/dist/types.d.ts.map +1 -0
- package/modules/strategy/dist/types.js +8 -0
- package/modules/strategy/dist/types.js.map +1 -0
- package/modules/strategy/dist/validate.d.ts +63 -0
- package/modules/strategy/dist/validate.d.ts.map +1 -0
- package/modules/strategy/dist/validate.js +146 -0
- package/modules/strategy/dist/validate.js.map +1 -0
- package/modules/strategy/etc/strategy.api.md +174 -0
- package/modules/strategy/src/auto-range.ts +21 -0
- package/modules/strategy/src/builders.ts +221 -0
- package/modules/strategy/src/calendars.ts +245 -0
- package/modules/strategy/src/classify.ts +215 -0
- package/modules/strategy/src/explain.ts +471 -0
- package/modules/strategy/src/from-chain.ts +643 -0
- package/modules/strategy/src/index.ts +212 -0
- package/modules/strategy/src/legs.ts +140 -0
- package/modules/strategy/src/manifest.ts +756 -0
- package/modules/strategy/src/optimizer.ts +679 -0
- package/modules/strategy/src/position.ts +2084 -0
- package/modules/strategy/src/probability.ts +301 -0
- package/modules/strategy/src/scanner.ts +711 -0
- package/modules/strategy/src/strategies.ts +1018 -0
- package/modules/strategy/src/svg.ts +415 -0
- package/modules/strategy/src/thesis-distribution.ts +188 -0
- package/modules/strategy/src/types.ts +380 -0
- package/modules/strategy/src/validate.ts +207 -0
- package/modules/structure/OPTION-FLOW-DRIFT.md +126 -0
- package/modules/structure/dist/exposure.d.ts +350 -0
- package/modules/structure/dist/exposure.d.ts.map +1 -0
- package/modules/structure/dist/exposure.js +917 -0
- package/modules/structure/dist/exposure.js.map +1 -0
- package/modules/structure/dist/flow.d.ts +247 -0
- package/modules/structure/dist/flow.d.ts.map +1 -0
- package/modules/structure/dist/flow.js +643 -0
- package/modules/structure/dist/flow.js.map +1 -0
- package/modules/structure/dist/index.d.ts +20 -0
- package/modules/structure/dist/index.d.ts.map +1 -0
- package/modules/structure/dist/index.js +16 -0
- package/modules/structure/dist/index.js.map +1 -0
- package/modules/structure/dist/market-day.d.ts +29 -0
- package/modules/structure/dist/market-day.d.ts.map +1 -0
- package/modules/structure/dist/market-day.js +43 -0
- package/modules/structure/dist/market-day.js.map +1 -0
- package/modules/structure/dist/option-flow-drift.d.ts +184 -0
- package/modules/structure/dist/option-flow-drift.d.ts.map +1 -0
- package/modules/structure/dist/option-flow-drift.js +475 -0
- package/modules/structure/dist/option-flow-drift.js.map +1 -0
- package/modules/structure/dist/supplied-exposure.d.ts +191 -0
- package/modules/structure/dist/supplied-exposure.d.ts.map +1 -0
- package/modules/structure/dist/supplied-exposure.js +421 -0
- package/modules/structure/dist/supplied-exposure.js.map +1 -0
- package/modules/structure/etc/structure.api.md +72 -0
- package/modules/structure/src/exposure.ts +1330 -0
- package/modules/structure/src/flow.ts +955 -0
- package/modules/structure/src/index.ts +83 -0
- package/modules/structure/src/market-day.ts +47 -0
- package/modules/structure/src/option-flow-drift.ts +726 -0
- package/modules/structure/src/supplied-exposure.ts +671 -0
- package/modules/technical-analysis/dist/aliases.d.ts +42 -0
- package/modules/technical-analysis/dist/aliases.d.ts.map +1 -0
- package/modules/technical-analysis/dist/aliases.js +413 -0
- package/modules/technical-analysis/dist/aliases.js.map +1 -0
- package/modules/technical-analysis/dist/bands.d.ts +31 -0
- package/modules/technical-analysis/dist/bands.d.ts.map +1 -0
- package/modules/technical-analysis/dist/bands.js +79 -0
- package/modules/technical-analysis/dist/bands.js.map +1 -0
- package/modules/technical-analysis/dist/bars.d.ts +113 -0
- package/modules/technical-analysis/dist/bars.d.ts.map +1 -0
- package/modules/technical-analysis/dist/bars.js +374 -0
- package/modules/technical-analysis/dist/bars.js.map +1 -0
- package/modules/technical-analysis/dist/builtin-metadata.d.ts +1817 -0
- package/modules/technical-analysis/dist/builtin-metadata.d.ts.map +1 -0
- package/modules/technical-analysis/dist/builtin-metadata.js +1399 -0
- package/modules/technical-analysis/dist/builtin-metadata.js.map +1 -0
- package/modules/technical-analysis/dist/candle-aliases.d.ts +56 -0
- package/modules/technical-analysis/dist/candle-aliases.d.ts.map +1 -0
- package/modules/technical-analysis/dist/candle-aliases.js +246 -0
- package/modules/technical-analysis/dist/candle-aliases.js.map +1 -0
- package/modules/technical-analysis/dist/candle-talib.d.ts +114 -0
- package/modules/technical-analysis/dist/candle-talib.d.ts.map +1 -0
- package/modules/technical-analysis/dist/candle-talib.js +185 -0
- package/modules/technical-analysis/dist/candle-talib.js.map +1 -0
- package/modules/technical-analysis/dist/candlesticks.d.ts +103 -0
- package/modules/technical-analysis/dist/candlesticks.d.ts.map +1 -0
- package/modules/technical-analysis/dist/candlesticks.js +1009 -0
- package/modules/technical-analysis/dist/candlesticks.js.map +1 -0
- package/modules/technical-analysis/dist/chart-types.d.ts +205 -0
- package/modules/technical-analysis/dist/chart-types.d.ts.map +1 -0
- package/modules/technical-analysis/dist/chart-types.js +633 -0
- package/modules/technical-analysis/dist/chart-types.js.map +1 -0
- package/modules/technical-analysis/dist/columns.d.ts +24 -0
- package/modules/technical-analysis/dist/columns.d.ts.map +1 -0
- package/modules/technical-analysis/dist/columns.js +71 -0
- package/modules/technical-analysis/dist/columns.js.map +1 -0
- package/modules/technical-analysis/dist/cycle.d.ts +174 -0
- package/modules/technical-analysis/dist/cycle.d.ts.map +1 -0
- package/modules/technical-analysis/dist/cycle.js +489 -0
- package/modules/technical-analysis/dist/cycle.js.map +1 -0
- package/modules/technical-analysis/dist/discover.d.ts +100 -0
- package/modules/technical-analysis/dist/discover.d.ts.map +1 -0
- package/modules/technical-analysis/dist/discover.js +273 -0
- package/modules/technical-analysis/dist/discover.js.map +1 -0
- package/modules/technical-analysis/dist/divergence.d.ts +82 -0
- package/modules/technical-analysis/dist/divergence.d.ts.map +1 -0
- package/modules/technical-analysis/dist/divergence.js +269 -0
- package/modules/technical-analysis/dist/divergence.js.map +1 -0
- package/modules/technical-analysis/dist/features-ext.d.ts +162 -0
- package/modules/technical-analysis/dist/features-ext.d.ts.map +1 -0
- package/modules/technical-analysis/dist/features-ext.js +633 -0
- package/modules/technical-analysis/dist/features-ext.js.map +1 -0
- package/modules/technical-analysis/dist/features.d.ts +10 -0
- package/modules/technical-analysis/dist/features.d.ts.map +1 -0
- package/modules/technical-analysis/dist/features.js +10 -0
- package/modules/technical-analysis/dist/features.js.map +1 -0
- package/modules/technical-analysis/dist/framework.d.ts +353 -0
- package/modules/technical-analysis/dist/framework.d.ts.map +1 -0
- package/modules/technical-analysis/dist/framework.js +999 -0
- package/modules/technical-analysis/dist/framework.js.map +1 -0
- package/modules/technical-analysis/dist/fuzzy.d.ts +33 -0
- package/modules/technical-analysis/dist/fuzzy.d.ts.map +1 -0
- package/modules/technical-analysis/dist/fuzzy.js +80 -0
- package/modules/technical-analysis/dist/fuzzy.js.map +1 -0
- package/modules/technical-analysis/dist/generated/validation-specs.d.ts +12 -0
- package/modules/technical-analysis/dist/generated/validation-specs.d.ts.map +1 -0
- package/modules/technical-analysis/dist/generated/validation-specs.js +1052 -0
- package/modules/technical-analysis/dist/generated/validation-specs.js.map +1 -0
- package/modules/technical-analysis/dist/index.d.ts +132 -0
- package/modules/technical-analysis/dist/index.d.ts.map +1 -0
- package/modules/technical-analysis/dist/index.js +100 -0
- package/modules/technical-analysis/dist/index.js.map +1 -0
- package/modules/technical-analysis/dist/indicator-metadata.d.ts +21 -0
- package/modules/technical-analysis/dist/indicator-metadata.d.ts.map +1 -0
- package/modules/technical-analysis/dist/indicator-metadata.js +23 -0
- package/modules/technical-analysis/dist/indicator-metadata.js.map +1 -0
- package/modules/technical-analysis/dist/limits.d.ts +19 -0
- package/modules/technical-analysis/dist/limits.d.ts.map +1 -0
- package/modules/technical-analysis/dist/limits.js +19 -0
- package/modules/technical-analysis/dist/limits.js.map +1 -0
- package/modules/technical-analysis/dist/macd.d.ts +29 -0
- package/modules/technical-analysis/dist/macd.d.ts.map +1 -0
- package/modules/technical-analysis/dist/macd.js +61 -0
- package/modules/technical-analysis/dist/macd.js.map +1 -0
- package/modules/technical-analysis/dist/math.d.ts +69 -0
- package/modules/technical-analysis/dist/math.d.ts.map +1 -0
- package/modules/technical-analysis/dist/math.js +124 -0
- package/modules/technical-analysis/dist/math.js.map +1 -0
- package/modules/technical-analysis/dist/microstructure.d.ts +252 -0
- package/modules/technical-analysis/dist/microstructure.d.ts.map +1 -0
- package/modules/technical-analysis/dist/microstructure.js +552 -0
- package/modules/technical-analysis/dist/microstructure.js.map +1 -0
- package/modules/technical-analysis/dist/momentum-ext.d.ts +619 -0
- package/modules/technical-analysis/dist/momentum-ext.d.ts.map +1 -0
- package/modules/technical-analysis/dist/momentum-ext.js +1772 -0
- package/modules/technical-analysis/dist/momentum-ext.js.map +1 -0
- package/modules/technical-analysis/dist/momentum.d.ts +15 -0
- package/modules/technical-analysis/dist/momentum.d.ts.map +1 -0
- package/modules/technical-analysis/dist/momentum.js +14 -0
- package/modules/technical-analysis/dist/momentum.js.map +1 -0
- package/modules/technical-analysis/dist/moving-averages.d.ts +344 -0
- package/modules/technical-analysis/dist/moving-averages.d.ts.map +1 -0
- package/modules/technical-analysis/dist/moving-averages.js +1279 -0
- package/modules/technical-analysis/dist/moving-averages.js.map +1 -0
- package/modules/technical-analysis/dist/nan-policy.d.ts +42 -0
- package/modules/technical-analysis/dist/nan-policy.d.ts.map +1 -0
- package/modules/technical-analysis/dist/nan-policy.js +60 -0
- package/modules/technical-analysis/dist/nan-policy.js.map +1 -0
- package/modules/technical-analysis/dist/oscillators.d.ts +377 -0
- package/modules/technical-analysis/dist/oscillators.d.ts.map +1 -0
- package/modules/technical-analysis/dist/oscillators.js +1225 -0
- package/modules/technical-analysis/dist/oscillators.js.map +1 -0
- package/modules/technical-analysis/dist/output-meta.d.ts +71 -0
- package/modules/technical-analysis/dist/output-meta.d.ts.map +1 -0
- package/modules/technical-analysis/dist/output-meta.js +399 -0
- package/modules/technical-analysis/dist/output-meta.js.map +1 -0
- package/modules/technical-analysis/dist/overlap-ext.d.ts +206 -0
- package/modules/technical-analysis/dist/overlap-ext.d.ts.map +1 -0
- package/modules/technical-analysis/dist/overlap-ext.js +550 -0
- package/modules/technical-analysis/dist/overlap-ext.js.map +1 -0
- package/modules/technical-analysis/dist/overlap.d.ts +11 -0
- package/modules/technical-analysis/dist/overlap.d.ts.map +1 -0
- package/modules/technical-analysis/dist/overlap.js +10 -0
- package/modules/technical-analysis/dist/overlap.js.map +1 -0
- package/modules/technical-analysis/dist/performance-ext.d.ts +21 -0
- package/modules/technical-analysis/dist/performance-ext.d.ts.map +1 -0
- package/modules/technical-analysis/dist/performance-ext.js +31 -0
- package/modules/technical-analysis/dist/performance-ext.js.map +1 -0
- package/modules/technical-analysis/dist/pipeline.d.ts +105 -0
- package/modules/technical-analysis/dist/pipeline.d.ts.map +1 -0
- package/modules/technical-analysis/dist/pipeline.js +224 -0
- package/modules/technical-analysis/dist/pipeline.js.map +1 -0
- package/modules/technical-analysis/dist/price-action-ext.d.ts +90 -0
- package/modules/technical-analysis/dist/price-action-ext.d.ts.map +1 -0
- package/modules/technical-analysis/dist/price-action-ext.js +511 -0
- package/modules/technical-analysis/dist/price-action-ext.js.map +1 -0
- package/modules/technical-analysis/dist/price-action.d.ts +348 -0
- package/modules/technical-analysis/dist/price-action.d.ts.map +1 -0
- package/modules/technical-analysis/dist/price-action.js +613 -0
- package/modules/technical-analysis/dist/price-action.js.map +1 -0
- package/modules/technical-analysis/dist/registry.d.ts +84 -0
- package/modules/technical-analysis/dist/registry.d.ts.map +1 -0
- package/modules/technical-analysis/dist/registry.js +625 -0
- package/modules/technical-analysis/dist/registry.js.map +1 -0
- package/modules/technical-analysis/dist/resample.d.ts +77 -0
- package/modules/technical-analysis/dist/resample.d.ts.map +1 -0
- package/modules/technical-analysis/dist/resample.js +239 -0
- package/modules/technical-analysis/dist/resample.js.map +1 -0
- package/modules/technical-analysis/dist/rsi.d.ts +36 -0
- package/modules/technical-analysis/dist/rsi.d.ts.map +1 -0
- package/modules/technical-analysis/dist/rsi.js +95 -0
- package/modules/technical-analysis/dist/rsi.js.map +1 -0
- package/modules/technical-analysis/dist/series.d.ts +40 -0
- package/modules/technical-analysis/dist/series.d.ts.map +1 -0
- package/modules/technical-analysis/dist/series.js +125 -0
- package/modules/technical-analysis/dist/series.js.map +1 -0
- package/modules/technical-analysis/dist/signal.d.ts +140 -0
- package/modules/technical-analysis/dist/signal.d.ts.map +1 -0
- package/modules/technical-analysis/dist/signal.js +353 -0
- package/modules/technical-analysis/dist/signal.js.map +1 -0
- package/modules/technical-analysis/dist/snapshot-cardinality.d.ts +17 -0
- package/modules/technical-analysis/dist/snapshot-cardinality.d.ts.map +1 -0
- package/modules/technical-analysis/dist/snapshot-cardinality.js +53 -0
- package/modules/technical-analysis/dist/snapshot-cardinality.js.map +1 -0
- package/modules/technical-analysis/dist/snapshot-envelope.d.ts +19 -0
- package/modules/technical-analysis/dist/snapshot-envelope.d.ts.map +1 -0
- package/modules/technical-analysis/dist/snapshot-envelope.js +87 -0
- package/modules/technical-analysis/dist/snapshot-envelope.js.map +1 -0
- package/modules/technical-analysis/dist/statistics.d.ts +146 -0
- package/modules/technical-analysis/dist/statistics.d.ts.map +1 -0
- package/modules/technical-analysis/dist/statistics.js +524 -0
- package/modules/technical-analysis/dist/statistics.js.map +1 -0
- package/modules/technical-analysis/dist/stream-validation.d.ts +14 -0
- package/modules/technical-analysis/dist/stream-validation.d.ts.map +1 -0
- package/modules/technical-analysis/dist/stream-validation.js +35 -0
- package/modules/technical-analysis/dist/stream-validation.js.map +1 -0
- package/modules/technical-analysis/dist/transforms.d.ts +77 -0
- package/modules/technical-analysis/dist/transforms.d.ts.map +1 -0
- package/modules/technical-analysis/dist/transforms.js +246 -0
- package/modules/technical-analysis/dist/transforms.js.map +1 -0
- package/modules/technical-analysis/dist/trend-ext.d.ts +121 -0
- package/modules/technical-analysis/dist/trend-ext.d.ts.map +1 -0
- package/modules/technical-analysis/dist/trend-ext.js +691 -0
- package/modules/technical-analysis/dist/trend-ext.js.map +1 -0
- package/modules/technical-analysis/dist/trend.d.ts +373 -0
- package/modules/technical-analysis/dist/trend.d.ts.map +1 -0
- package/modules/technical-analysis/dist/trend.js +1159 -0
- package/modules/technical-analysis/dist/trend.js.map +1 -0
- package/modules/technical-analysis/dist/validate.d.ts +61 -0
- package/modules/technical-analysis/dist/validate.d.ts.map +1 -0
- package/modules/technical-analysis/dist/validate.js +334 -0
- package/modules/technical-analysis/dist/validate.js.map +1 -0
- package/modules/technical-analysis/dist/volatility-ext.d.ts +98 -0
- package/modules/technical-analysis/dist/volatility-ext.d.ts.map +1 -0
- package/modules/technical-analysis/dist/volatility-ext.js +535 -0
- package/modules/technical-analysis/dist/volatility-ext.js.map +1 -0
- package/modules/technical-analysis/dist/volatility.d.ts +239 -0
- package/modules/technical-analysis/dist/volatility.d.ts.map +1 -0
- package/modules/technical-analysis/dist/volatility.js +709 -0
- package/modules/technical-analysis/dist/volatility.js.map +1 -0
- package/modules/technical-analysis/dist/volume-core.d.ts +273 -0
- package/modules/technical-analysis/dist/volume-core.d.ts.map +1 -0
- package/modules/technical-analysis/dist/volume-core.js +847 -0
- package/modules/technical-analysis/dist/volume-core.js.map +1 -0
- package/modules/technical-analysis/dist/volume-ext.d.ts +61 -0
- package/modules/technical-analysis/dist/volume-ext.d.ts.map +1 -0
- package/modules/technical-analysis/dist/volume-ext.js +270 -0
- package/modules/technical-analysis/dist/volume-ext.js.map +1 -0
- package/modules/technical-analysis/dist/volume.d.ts +15 -0
- package/modules/technical-analysis/dist/volume.d.ts.map +1 -0
- package/modules/technical-analysis/dist/volume.js +15 -0
- package/modules/technical-analysis/dist/volume.js.map +1 -0
- package/modules/technical-analysis/dist/warmup.d.ts +38 -0
- package/modules/technical-analysis/dist/warmup.d.ts.map +1 -0
- package/modules/technical-analysis/dist/warmup.js +269 -0
- package/modules/technical-analysis/dist/warmup.js.map +1 -0
- package/modules/technical-analysis/etc/technical-analysis.api.md +663 -0
- package/modules/technical-analysis/src/aliases.ts +466 -0
- package/modules/technical-analysis/src/bands.ts +113 -0
- package/modules/technical-analysis/src/bars.ts +456 -0
- package/modules/technical-analysis/src/builtin-metadata.ts +1686 -0
- package/modules/technical-analysis/src/candle-aliases.ts +289 -0
- package/modules/technical-analysis/src/candle-talib.ts +215 -0
- package/modules/technical-analysis/src/candlesticks.ts +1024 -0
- package/modules/technical-analysis/src/chart-types.ts +813 -0
- package/modules/technical-analysis/src/columns.ts +87 -0
- package/modules/technical-analysis/src/cycle.ts +625 -0
- package/modules/technical-analysis/src/discover.ts +390 -0
- package/modules/technical-analysis/src/divergence.ts +388 -0
- package/modules/technical-analysis/src/features-ext.ts +866 -0
- package/modules/technical-analysis/src/features.ts +9 -0
- package/modules/technical-analysis/src/framework.ts +1331 -0
- package/modules/technical-analysis/src/fuzzy.ts +92 -0
- package/modules/technical-analysis/src/generated/validation-specs.ts +1055 -0
- package/modules/technical-analysis/src/index.ts +825 -0
- package/modules/technical-analysis/src/indicator-metadata.ts +43 -0
- package/modules/technical-analysis/src/limits.ts +19 -0
- package/modules/technical-analysis/src/macd.ts +95 -0
- package/modules/technical-analysis/src/math.ts +181 -0
- package/modules/technical-analysis/src/microstructure.ts +870 -0
- package/modules/technical-analysis/src/momentum-ext.ts +2348 -0
- package/modules/technical-analysis/src/momentum.ts +16 -0
- package/modules/technical-analysis/src/moving-averages.ts +1525 -0
- package/modules/technical-analysis/src/nan-policy.ts +58 -0
- package/modules/technical-analysis/src/oscillators.ts +1586 -0
- package/modules/technical-analysis/src/output-meta.ts +466 -0
- package/modules/technical-analysis/src/overlap-ext.ts +792 -0
- package/modules/technical-analysis/src/overlap.ts +12 -0
- package/modules/technical-analysis/src/performance-ext.ts +57 -0
- package/modules/technical-analysis/src/pipeline.ts +270 -0
- package/modules/technical-analysis/src/price-action-ext.ts +675 -0
- package/modules/technical-analysis/src/price-action.ts +955 -0
- package/modules/technical-analysis/src/registry.ts +784 -0
- package/modules/technical-analysis/src/resample.ts +335 -0
- package/modules/technical-analysis/src/rsi.ts +120 -0
- package/modules/technical-analysis/src/series.ts +168 -0
- package/modules/technical-analysis/src/signal.ts +429 -0
- package/modules/technical-analysis/src/snapshot-cardinality.ts +83 -0
- package/modules/technical-analysis/src/snapshot-envelope.ts +131 -0
- package/modules/technical-analysis/src/statistics.ts +720 -0
- package/modules/technical-analysis/src/stream-validation.ts +42 -0
- package/modules/technical-analysis/src/transforms.ts +351 -0
- package/modules/technical-analysis/src/trend-ext.ts +957 -0
- package/modules/technical-analysis/src/trend.ts +1529 -0
- package/modules/technical-analysis/src/validate.ts +555 -0
- package/modules/technical-analysis/src/volatility-ext.ts +781 -0
- package/modules/technical-analysis/src/volatility.ts +963 -0
- package/modules/technical-analysis/src/volume-core.ts +1106 -0
- package/modules/technical-analysis/src/volume-ext.ts +380 -0
- package/modules/technical-analysis/src/volume.ts +14 -0
- package/modules/technical-analysis/src/warmup.ts +322 -0
- package/modules/totalfinance/dist/backtest.d.ts +3 -0
- package/modules/totalfinance/dist/backtest.d.ts.map +1 -0
- package/modules/totalfinance/dist/backtest.js +3 -0
- package/modules/totalfinance/dist/backtest.js.map +1 -0
- package/modules/totalfinance/dist/calendars.d.ts +3 -0
- package/modules/totalfinance/dist/calendars.d.ts.map +1 -0
- package/modules/totalfinance/dist/calendars.js +3 -0
- package/modules/totalfinance/dist/calendars.js.map +1 -0
- package/modules/totalfinance/dist/commodities.d.ts +2 -0
- package/modules/totalfinance/dist/commodities.d.ts.map +1 -0
- package/modules/totalfinance/dist/commodities.js +2 -0
- package/modules/totalfinance/dist/commodities.js.map +1 -0
- package/modules/totalfinance/dist/core.d.ts +3 -0
- package/modules/totalfinance/dist/core.d.ts.map +1 -0
- package/modules/totalfinance/dist/core.js +3 -0
- package/modules/totalfinance/dist/core.js.map +1 -0
- package/modules/totalfinance/dist/crypto.d.ts +3 -0
- package/modules/totalfinance/dist/crypto.d.ts.map +1 -0
- package/modules/totalfinance/dist/crypto.js +3 -0
- package/modules/totalfinance/dist/crypto.js.map +1 -0
- package/modules/totalfinance/dist/fixed-income.d.ts +3 -0
- package/modules/totalfinance/dist/fixed-income.d.ts.map +1 -0
- package/modules/totalfinance/dist/fixed-income.js +3 -0
- package/modules/totalfinance/dist/fixed-income.js.map +1 -0
- package/modules/totalfinance/dist/foreign-exchange.d.ts +2 -0
- package/modules/totalfinance/dist/foreign-exchange.d.ts.map +1 -0
- package/modules/totalfinance/dist/foreign-exchange.js +2 -0
- package/modules/totalfinance/dist/foreign-exchange.js.map +1 -0
- package/modules/totalfinance/dist/fundamentals.d.ts +3 -0
- package/modules/totalfinance/dist/fundamentals.d.ts.map +1 -0
- package/modules/totalfinance/dist/fundamentals.js +3 -0
- package/modules/totalfinance/dist/fundamentals.js.map +1 -0
- package/modules/totalfinance/dist/index.d.ts +90 -0
- package/modules/totalfinance/dist/index.d.ts.map +1 -0
- package/modules/totalfinance/dist/index.js +68 -0
- package/modules/totalfinance/dist/index.js.map +1 -0
- package/modules/totalfinance/dist/math.d.ts +3 -0
- package/modules/totalfinance/dist/math.d.ts.map +1 -0
- package/modules/totalfinance/dist/math.js +3 -0
- package/modules/totalfinance/dist/math.js.map +1 -0
- package/modules/totalfinance/dist/options.d.ts +3 -0
- package/modules/totalfinance/dist/options.d.ts.map +1 -0
- package/modules/totalfinance/dist/options.js +3 -0
- package/modules/totalfinance/dist/options.js.map +1 -0
- package/modules/totalfinance/dist/performance.d.ts +3 -0
- package/modules/totalfinance/dist/performance.d.ts.map +1 -0
- package/modules/totalfinance/dist/performance.js +3 -0
- package/modules/totalfinance/dist/performance.js.map +1 -0
- package/modules/totalfinance/dist/portfolio.d.ts +2 -0
- package/modules/totalfinance/dist/portfolio.d.ts.map +1 -0
- package/modules/totalfinance/dist/portfolio.js +2 -0
- package/modules/totalfinance/dist/portfolio.js.map +1 -0
- package/modules/totalfinance/dist/research.d.ts +2 -0
- package/modules/totalfinance/dist/research.d.ts.map +1 -0
- package/modules/totalfinance/dist/research.js +2 -0
- package/modules/totalfinance/dist/research.js.map +1 -0
- package/modules/totalfinance/dist/risk.d.ts +3 -0
- package/modules/totalfinance/dist/risk.d.ts.map +1 -0
- package/modules/totalfinance/dist/risk.js +3 -0
- package/modules/totalfinance/dist/risk.js.map +1 -0
- package/modules/totalfinance/dist/scenarios.d.ts +2 -0
- package/modules/totalfinance/dist/scenarios.d.ts.map +1 -0
- package/modules/totalfinance/dist/scenarios.js +2 -0
- package/modules/totalfinance/dist/scenarios.js.map +1 -0
- package/modules/totalfinance/dist/strategy.d.ts +3 -0
- package/modules/totalfinance/dist/strategy.d.ts.map +1 -0
- package/modules/totalfinance/dist/strategy.js +3 -0
- package/modules/totalfinance/dist/strategy.js.map +1 -0
- package/modules/totalfinance/dist/structure.d.ts +3 -0
- package/modules/totalfinance/dist/structure.d.ts.map +1 -0
- package/modules/totalfinance/dist/structure.js +3 -0
- package/modules/totalfinance/dist/structure.js.map +1 -0
- package/modules/totalfinance/dist/technical-analysis.d.ts +3 -0
- package/modules/totalfinance/dist/technical-analysis.d.ts.map +1 -0
- package/modules/totalfinance/dist/technical-analysis.js +3 -0
- package/modules/totalfinance/dist/technical-analysis.js.map +1 -0
- package/modules/totalfinance/dist/valuation.d.ts +3 -0
- package/modules/totalfinance/dist/valuation.d.ts.map +1 -0
- package/modules/totalfinance/dist/valuation.js +3 -0
- package/modules/totalfinance/dist/valuation.js.map +1 -0
- package/modules/totalfinance/dist/volatility.d.ts +3 -0
- package/modules/totalfinance/dist/volatility.d.ts.map +1 -0
- package/modules/totalfinance/dist/volatility.js +3 -0
- package/modules/totalfinance/dist/volatility.js.map +1 -0
- package/modules/totalfinance/etc/totalfinance.api.md +73 -0
- package/modules/totalfinance/src/backtest.ts +2 -0
- package/modules/totalfinance/src/calendars.ts +2 -0
- package/modules/totalfinance/src/commodities.ts +1 -0
- package/modules/totalfinance/src/core.ts +2 -0
- package/modules/totalfinance/src/crypto.ts +2 -0
- package/modules/totalfinance/src/fixed-income.ts +2 -0
- package/modules/totalfinance/src/foreign-exchange.ts +1 -0
- package/modules/totalfinance/src/fundamentals.ts +2 -0
- package/modules/totalfinance/src/index.ts +129 -0
- package/modules/totalfinance/src/math.ts +2 -0
- package/modules/totalfinance/src/options.ts +2 -0
- package/modules/totalfinance/src/performance.ts +2 -0
- package/modules/totalfinance/src/portfolio.ts +1 -0
- package/modules/totalfinance/src/research.ts +1 -0
- package/modules/totalfinance/src/risk.ts +2 -0
- package/modules/totalfinance/src/scenarios.ts +1 -0
- package/modules/totalfinance/src/strategy.ts +2 -0
- package/modules/totalfinance/src/structure.ts +2 -0
- package/modules/totalfinance/src/technical-analysis.ts +2 -0
- package/modules/totalfinance/src/valuation.ts +2 -0
- package/modules/totalfinance/src/volatility.ts +2 -0
- package/modules/valuation/dist/adjusted-present-value.d.ts +62 -0
- package/modules/valuation/dist/adjusted-present-value.d.ts.map +1 -0
- package/modules/valuation/dist/adjusted-present-value.js +85 -0
- package/modules/valuation/dist/adjusted-present-value.js.map +1 -0
- package/modules/valuation/dist/capital-budgeting.d.ts +84 -0
- package/modules/valuation/dist/capital-budgeting.d.ts.map +1 -0
- package/modules/valuation/dist/capital-budgeting.js +204 -0
- package/modules/valuation/dist/capital-budgeting.js.map +1 -0
- package/modules/valuation/dist/cash-flows.d.ts +11 -0
- package/modules/valuation/dist/cash-flows.d.ts.map +1 -0
- package/modules/valuation/dist/cash-flows.js +10 -0
- package/modules/valuation/dist/cash-flows.js.map +1 -0
- package/modules/valuation/dist/comparable.d.ts +101 -0
- package/modules/valuation/dist/comparable.d.ts.map +1 -0
- package/modules/valuation/dist/comparable.js +194 -0
- package/modules/valuation/dist/comparable.js.map +1 -0
- package/modules/valuation/dist/corporate-primitives.d.ts +185 -0
- package/modules/valuation/dist/corporate-primitives.d.ts.map +1 -0
- package/modules/valuation/dist/corporate-primitives.js +337 -0
- package/modules/valuation/dist/corporate-primitives.js.map +1 -0
- package/modules/valuation/dist/corporate.d.ts +14 -0
- package/modules/valuation/dist/corporate.d.ts.map +1 -0
- package/modules/valuation/dist/corporate.js +13 -0
- package/modules/valuation/dist/corporate.js.map +1 -0
- package/modules/valuation/dist/discounted-cash-flow.d.ts +269 -0
- package/modules/valuation/dist/discounted-cash-flow.d.ts.map +1 -0
- package/modules/valuation/dist/discounted-cash-flow.js +611 -0
- package/modules/valuation/dist/discounted-cash-flow.js.map +1 -0
- package/modules/valuation/dist/discounting.d.ts +124 -0
- package/modules/valuation/dist/discounting.d.ts.map +1 -0
- package/modules/valuation/dist/discounting.js +235 -0
- package/modules/valuation/dist/discounting.js.map +1 -0
- package/modules/valuation/dist/equity-valuation.d.ts +104 -0
- package/modules/valuation/dist/equity-valuation.d.ts.map +1 -0
- package/modules/valuation/dist/equity-valuation.js +164 -0
- package/modules/valuation/dist/equity-valuation.js.map +1 -0
- package/modules/valuation/dist/flows.d.ts +30 -0
- package/modules/valuation/dist/flows.d.ts.map +1 -0
- package/modules/valuation/dist/flows.js +77 -0
- package/modules/valuation/dist/flows.js.map +1 -0
- package/modules/valuation/dist/forecasting.d.ts +205 -0
- package/modules/valuation/dist/forecasting.d.ts.map +1 -0
- package/modules/valuation/dist/forecasting.js +359 -0
- package/modules/valuation/dist/forecasting.js.map +1 -0
- package/modules/valuation/dist/index.d.ts +9 -0
- package/modules/valuation/dist/index.d.ts.map +1 -0
- package/modules/valuation/dist/index.js +10 -0
- package/modules/valuation/dist/index.js.map +1 -0
- package/modules/valuation/dist/leveraged-buyout.d.ts +160 -0
- package/modules/valuation/dist/leveraged-buyout.d.ts.map +1 -0
- package/modules/valuation/dist/leveraged-buyout.js +326 -0
- package/modules/valuation/dist/leveraged-buyout.js.map +1 -0
- package/modules/valuation/dist/loans.d.ts +148 -0
- package/modules/valuation/dist/loans.d.ts.map +1 -0
- package/modules/valuation/dist/loans.js +518 -0
- package/modules/valuation/dist/loans.js.map +1 -0
- package/modules/valuation/dist/probabilistic.d.ts +88 -0
- package/modules/valuation/dist/probabilistic.d.ts.map +1 -0
- package/modules/valuation/dist/probabilistic.js +239 -0
- package/modules/valuation/dist/probabilistic.js.map +1 -0
- package/modules/valuation/dist/solvers.d.ts +90 -0
- package/modules/valuation/dist/solvers.d.ts.map +1 -0
- package/modules/valuation/dist/solvers.js +238 -0
- package/modules/valuation/dist/solvers.js.map +1 -0
- package/modules/valuation/etc/valuation.api.md +162 -0
- package/modules/valuation/src/adjusted-present-value.ts +181 -0
- package/modules/valuation/src/capital-budgeting.ts +329 -0
- package/modules/valuation/src/cash-flows.ts +11 -0
- package/modules/valuation/src/comparable.ts +340 -0
- package/modules/valuation/src/corporate-primitives.ts +665 -0
- package/modules/valuation/src/corporate.ts +36 -0
- package/modules/valuation/src/discounted-cash-flow.ts +1083 -0
- package/modules/valuation/src/discounting.ts +437 -0
- package/modules/valuation/src/equity-valuation.ts +313 -0
- package/modules/valuation/src/flows.ts +144 -0
- package/modules/valuation/src/forecasting.ts +666 -0
- package/modules/valuation/src/index.ts +10 -0
- package/modules/valuation/src/leveraged-buyout.ts +560 -0
- package/modules/valuation/src/loans.ts +778 -0
- package/modules/valuation/src/probabilistic.ts +438 -0
- package/modules/valuation/src/solvers.ts +397 -0
- package/modules/volatility/dist/analytics.d.ts +133 -0
- package/modules/volatility/dist/analytics.d.ts.map +1 -0
- package/modules/volatility/dist/analytics.js +320 -0
- package/modules/volatility/dist/analytics.js.map +1 -0
- package/modules/volatility/dist/arbitrage.d.ts +118 -0
- package/modules/volatility/dist/arbitrage.d.ts.map +1 -0
- package/modules/volatility/dist/arbitrage.js +397 -0
- package/modules/volatility/dist/arbitrage.js.map +1 -0
- package/modules/volatility/dist/artifacts.d.ts +24 -0
- package/modules/volatility/dist/artifacts.d.ts.map +1 -0
- package/modules/volatility/dist/artifacts.js +22 -0
- package/modules/volatility/dist/artifacts.js.map +1 -0
- package/modules/volatility/dist/calibration-limits.d.ts +13 -0
- package/modules/volatility/dist/calibration-limits.d.ts.map +1 -0
- package/modules/volatility/dist/calibration-limits.js +46 -0
- package/modules/volatility/dist/calibration-limits.js.map +1 -0
- package/modules/volatility/dist/calibration-start.d.ts +13 -0
- package/modules/volatility/dist/calibration-start.d.ts.map +1 -0
- package/modules/volatility/dist/calibration-start.js +55 -0
- package/modules/volatility/dist/calibration-start.js.map +1 -0
- package/modules/volatility/dist/earnings.d.ts +152 -0
- package/modules/volatility/dist/earnings.d.ts.map +1 -0
- package/modules/volatility/dist/earnings.js +340 -0
- package/modules/volatility/dist/earnings.js.map +1 -0
- package/modules/volatility/dist/essvi.d.ts +115 -0
- package/modules/volatility/dist/essvi.d.ts.map +1 -0
- package/modules/volatility/dist/essvi.js +362 -0
- package/modules/volatility/dist/essvi.js.map +1 -0
- package/modules/volatility/dist/estimate.d.ts +14 -0
- package/modules/volatility/dist/estimate.d.ts.map +1 -0
- package/modules/volatility/dist/estimate.js +18 -0
- package/modules/volatility/dist/estimate.js.map +1 -0
- package/modules/volatility/dist/event.d.ts +155 -0
- package/modules/volatility/dist/event.d.ts.map +1 -0
- package/modules/volatility/dist/event.js +319 -0
- package/modules/volatility/dist/event.js.map +1 -0
- package/modules/volatility/dist/fitted-model-artifacts.d.ts +378 -0
- package/modules/volatility/dist/fitted-model-artifacts.d.ts.map +1 -0
- package/modules/volatility/dist/fitted-model-artifacts.js +1139 -0
- package/modules/volatility/dist/fitted-model-artifacts.js.map +1 -0
- package/modules/volatility/dist/fitted-model-families.d.ts +287 -0
- package/modules/volatility/dist/fitted-model-families.d.ts.map +1 -0
- package/modules/volatility/dist/fitted-model-families.js +1251 -0
- package/modules/volatility/dist/fitted-model-families.js.map +1 -0
- package/modules/volatility/dist/forecast.d.ts +195 -0
- package/modules/volatility/dist/forecast.d.ts.map +1 -0
- package/modules/volatility/dist/forecast.js +493 -0
- package/modules/volatility/dist/forecast.js.map +1 -0
- package/modules/volatility/dist/generated/validation-specs.d.ts +12 -0
- package/modules/volatility/dist/generated/validation-specs.d.ts.map +1 -0
- package/modules/volatility/dist/generated/validation-specs.js +2181 -0
- package/modules/volatility/dist/generated/validation-specs.js.map +1 -0
- package/modules/volatility/dist/heston-surface.d.ts +67 -0
- package/modules/volatility/dist/heston-surface.d.ts.map +1 -0
- package/modules/volatility/dist/heston-surface.js +135 -0
- package/modules/volatility/dist/heston-surface.js.map +1 -0
- package/modules/volatility/dist/index.d.ts +64 -0
- package/modules/volatility/dist/index.d.ts.map +1 -0
- package/modules/volatility/dist/index.js +68 -0
- package/modules/volatility/dist/index.js.map +1 -0
- package/modules/volatility/dist/local-volatility.d.ts +34 -0
- package/modules/volatility/dist/local-volatility.d.ts.map +1 -0
- package/modules/volatility/dist/local-volatility.js +59 -0
- package/modules/volatility/dist/local-volatility.js.map +1 -0
- package/modules/volatility/dist/metrics.d.ts +41 -0
- package/modules/volatility/dist/metrics.d.ts.map +1 -0
- package/modules/volatility/dist/metrics.js +117 -0
- package/modules/volatility/dist/metrics.js.map +1 -0
- package/modules/volatility/dist/min-variance-delta.d.ts +61 -0
- package/modules/volatility/dist/min-variance-delta.d.ts.map +1 -0
- package/modules/volatility/dist/min-variance-delta.js +101 -0
- package/modules/volatility/dist/min-variance-delta.js.map +1 -0
- package/modules/volatility/dist/observed-skew.d.ts +137 -0
- package/modules/volatility/dist/observed-skew.d.ts.map +1 -0
- package/modules/volatility/dist/observed-skew.js +461 -0
- package/modules/volatility/dist/observed-skew.js.map +1 -0
- package/modules/volatility/dist/otm-strip.d.ts +39 -0
- package/modules/volatility/dist/otm-strip.d.ts.map +1 -0
- package/modules/volatility/dist/otm-strip.js +181 -0
- package/modules/volatility/dist/otm-strip.js.map +1 -0
- package/modules/volatility/dist/risk-reversal.d.ts +89 -0
- package/modules/volatility/dist/risk-reversal.d.ts.map +1 -0
- package/modules/volatility/dist/risk-reversal.js +176 -0
- package/modules/volatility/dist/risk-reversal.js.map +1 -0
- package/modules/volatility/dist/sabr-delta.d.ts +67 -0
- package/modules/volatility/dist/sabr-delta.d.ts.map +1 -0
- package/modules/volatility/dist/sabr-delta.js +153 -0
- package/modules/volatility/dist/sabr-delta.js.map +1 -0
- package/modules/volatility/dist/sabr.d.ts +62 -0
- package/modules/volatility/dist/sabr.d.ts.map +1 -0
- package/modules/volatility/dist/sabr.js +262 -0
- package/modules/volatility/dist/sabr.js.map +1 -0
- package/modules/volatility/dist/skew.d.ts +63 -0
- package/modules/volatility/dist/skew.d.ts.map +1 -0
- package/modules/volatility/dist/skew.js +147 -0
- package/modules/volatility/dist/skew.js.map +1 -0
- package/modules/volatility/dist/ssvi-kernel.d.ts +90 -0
- package/modules/volatility/dist/ssvi-kernel.d.ts.map +1 -0
- package/modules/volatility/dist/ssvi-kernel.js +103 -0
- package/modules/volatility/dist/ssvi-kernel.js.map +1 -0
- package/modules/volatility/dist/ssvi.d.ts +181 -0
- package/modules/volatility/dist/ssvi.d.ts.map +1 -0
- package/modules/volatility/dist/ssvi.js +490 -0
- package/modules/volatility/dist/ssvi.js.map +1 -0
- package/modules/volatility/dist/sticky-regime.d.ts +47 -0
- package/modules/volatility/dist/sticky-regime.d.ts.map +1 -0
- package/modules/volatility/dist/sticky-regime.js +81 -0
- package/modules/volatility/dist/sticky-regime.js.map +1 -0
- package/modules/volatility/dist/surface-pca.d.ts +111 -0
- package/modules/volatility/dist/surface-pca.d.ts.map +1 -0
- package/modules/volatility/dist/surface-pca.js +297 -0
- package/modules/volatility/dist/surface-pca.js.map +1 -0
- package/modules/volatility/dist/surface.d.ts +286 -0
- package/modules/volatility/dist/surface.d.ts.map +1 -0
- package/modules/volatility/dist/surface.js +1105 -0
- package/modules/volatility/dist/surface.js.map +1 -0
- package/modules/volatility/dist/svi.d.ts +133 -0
- package/modules/volatility/dist/svi.d.ts.map +1 -0
- package/modules/volatility/dist/svi.js +491 -0
- package/modules/volatility/dist/svi.js.map +1 -0
- package/modules/volatility/dist/swaption-cube.d.ts +125 -0
- package/modules/volatility/dist/swaption-cube.d.ts.map +1 -0
- package/modules/volatility/dist/swaption-cube.js +334 -0
- package/modules/volatility/dist/swaption-cube.js.map +1 -0
- package/modules/volatility/dist/tail-risk.d.ts +65 -0
- package/modules/volatility/dist/tail-risk.d.ts.map +1 -0
- package/modules/volatility/dist/tail-risk.js +155 -0
- package/modules/volatility/dist/tail-risk.js.map +1 -0
- package/modules/volatility/dist/term.d.ts +121 -0
- package/modules/volatility/dist/term.d.ts.map +1 -0
- package/modules/volatility/dist/term.js +336 -0
- package/modules/volatility/dist/term.js.map +1 -0
- package/modules/volatility/dist/vanna-volga.d.ts +278 -0
- package/modules/volatility/dist/vanna-volga.d.ts.map +1 -0
- package/modules/volatility/dist/vanna-volga.js +833 -0
- package/modules/volatility/dist/vanna-volga.js.map +1 -0
- package/modules/volatility/dist/variance-index.d.ts +101 -0
- package/modules/volatility/dist/variance-index.d.ts.map +1 -0
- package/modules/volatility/dist/variance-index.js +240 -0
- package/modules/volatility/dist/variance-index.js.map +1 -0
- package/modules/volatility/dist/volatility-spot-beta.d.ts +57 -0
- package/modules/volatility/dist/volatility-spot-beta.d.ts.map +1 -0
- package/modules/volatility/dist/volatility-spot-beta.js +136 -0
- package/modules/volatility/dist/volatility-spot-beta.js.map +1 -0
- package/modules/volatility/etc/volatility.api.md +207 -0
- package/modules/volatility/src/analytics.ts +513 -0
- package/modules/volatility/src/arbitrage.ts +561 -0
- package/modules/volatility/src/artifacts.ts +62 -0
- package/modules/volatility/src/calibration-limits.ts +61 -0
- package/modules/volatility/src/calibration-start.ts +79 -0
- package/modules/volatility/src/earnings.ts +548 -0
- package/modules/volatility/src/essvi.ts +528 -0
- package/modules/volatility/src/estimate.ts +21 -0
- package/modules/volatility/src/event.ts +542 -0
- package/modules/volatility/src/fitted-model-artifacts.ts +1844 -0
- package/modules/volatility/src/fitted-model-families.ts +1681 -0
- package/modules/volatility/src/forecast.ts +757 -0
- package/modules/volatility/src/generated/validation-specs.ts +2184 -0
- package/modules/volatility/src/heston-surface.ts +215 -0
- package/modules/volatility/src/index.ts +285 -0
- package/modules/volatility/src/local-volatility.ts +104 -0
- package/modules/volatility/src/metrics.ts +176 -0
- package/modules/volatility/src/min-variance-delta.ts +167 -0
- package/modules/volatility/src/observed-skew.ts +684 -0
- package/modules/volatility/src/otm-strip.ts +234 -0
- package/modules/volatility/src/risk-reversal.ts +316 -0
- package/modules/volatility/src/sabr-delta.ts +238 -0
- package/modules/volatility/src/sabr.ts +375 -0
- package/modules/volatility/src/skew.ts +244 -0
- package/modules/volatility/src/ssvi-kernel.ts +134 -0
- package/modules/volatility/src/ssvi.ts +707 -0
- package/modules/volatility/src/sticky-regime.ts +150 -0
- package/modules/volatility/src/surface-pca.ts +439 -0
- package/modules/volatility/src/surface.ts +1499 -0
- package/modules/volatility/src/svi.ts +687 -0
- package/modules/volatility/src/swaption-cube.ts +539 -0
- package/modules/volatility/src/tail-risk.ts +254 -0
- package/modules/volatility/src/term.ts +587 -0
- package/modules/volatility/src/vanna-volga.ts +1337 -0
- package/modules/volatility/src/variance-index.ts +396 -0
- package/modules/volatility/src/volatility-spot-beta.ts +252 -0
- package/modules/workflows/dist/capabilities.d.ts +8 -0
- package/modules/workflows/dist/capabilities.d.ts.map +1 -0
- package/modules/workflows/dist/capabilities.js +50 -0
- package/modules/workflows/dist/capabilities.js.map +1 -0
- package/modules/workflows/dist/envelope-schema.d.ts +36 -0
- package/modules/workflows/dist/envelope-schema.d.ts.map +1 -0
- package/modules/workflows/dist/envelope-schema.js +152 -0
- package/modules/workflows/dist/envelope-schema.js.map +1 -0
- package/modules/workflows/dist/index.d.ts +33 -0
- package/modules/workflows/dist/index.d.ts.map +1 -0
- package/modules/workflows/dist/index.js +27 -0
- package/modules/workflows/dist/index.js.map +1 -0
- package/modules/workflows/dist/json-safe.d.ts +7 -0
- package/modules/workflows/dist/json-safe.d.ts.map +1 -0
- package/modules/workflows/dist/json-safe.js +23 -0
- package/modules/workflows/dist/json-safe.js.map +1 -0
- package/modules/workflows/dist/local/file-lock.d.ts +23 -0
- package/modules/workflows/dist/local/file-lock.d.ts.map +1 -0
- package/modules/workflows/dist/local/file-lock.js +198 -0
- package/modules/workflows/dist/local/file-lock.js.map +1 -0
- package/modules/workflows/dist/local/file-stores.d.ts +33 -0
- package/modules/workflows/dist/local/file-stores.d.ts.map +1 -0
- package/modules/workflows/dist/local/file-stores.js +376 -0
- package/modules/workflows/dist/local/file-stores.js.map +1 -0
- package/modules/workflows/dist/local/index.d.ts +15 -0
- package/modules/workflows/dist/local/index.d.ts.map +1 -0
- package/modules/workflows/dist/local/index.js +12 -0
- package/modules/workflows/dist/local/index.js.map +1 -0
- package/modules/workflows/dist/local/job-worker.d.ts +28 -0
- package/modules/workflows/dist/local/job-worker.d.ts.map +1 -0
- package/modules/workflows/dist/local/job-worker.js +56 -0
- package/modules/workflows/dist/local/job-worker.js.map +1 -0
- package/modules/workflows/dist/local/jobs.d.ts +51 -0
- package/modules/workflows/dist/local/jobs.d.ts.map +1 -0
- package/modules/workflows/dist/local/jobs.js +313 -0
- package/modules/workflows/dist/local/jobs.js.map +1 -0
- package/modules/workflows/dist/local/local-runner.d.ts +39 -0
- package/modules/workflows/dist/local/local-runner.d.ts.map +1 -0
- package/modules/workflows/dist/local/local-runner.js +102 -0
- package/modules/workflows/dist/local/local-runner.js.map +1 -0
- package/modules/workflows/dist/local/profiles.d.ts +27 -0
- package/modules/workflows/dist/local/profiles.d.ts.map +1 -0
- package/modules/workflows/dist/local/profiles.js +77 -0
- package/modules/workflows/dist/local/profiles.js.map +1 -0
- package/modules/workflows/dist/operation-kit.d.ts +10 -0
- package/modules/workflows/dist/operation-kit.d.ts.map +1 -0
- package/modules/workflows/dist/operation-kit.js +193 -0
- package/modules/workflows/dist/operation-kit.js.map +1 -0
- package/modules/workflows/dist/operation.d.ts +210 -0
- package/modules/workflows/dist/operation.d.ts.map +1 -0
- package/modules/workflows/dist/operation.js +255 -0
- package/modules/workflows/dist/operation.js.map +1 -0
- package/modules/workflows/dist/operations-analysis.d.ts +188 -0
- package/modules/workflows/dist/operations-analysis.d.ts.map +1 -0
- package/modules/workflows/dist/operations-analysis.js +908 -0
- package/modules/workflows/dist/operations-analysis.js.map +1 -0
- package/modules/workflows/dist/operations-compute.d.ts +21 -0
- package/modules/workflows/dist/operations-compute.d.ts.map +1 -0
- package/modules/workflows/dist/operations-compute.js +1227 -0
- package/modules/workflows/dist/operations-compute.js.map +1 -0
- package/modules/workflows/dist/operations-journey.d.ts +27 -0
- package/modules/workflows/dist/operations-journey.d.ts.map +1 -0
- package/modules/workflows/dist/operations-journey.js +2445 -0
- package/modules/workflows/dist/operations-journey.js.map +1 -0
- package/modules/workflows/dist/operations-trade.d.ts +3 -0
- package/modules/workflows/dist/operations-trade.d.ts.map +1 -0
- package/modules/workflows/dist/operations-trade.js +648 -0
- package/modules/workflows/dist/operations-trade.js.map +1 -0
- package/modules/workflows/dist/preview.d.ts +16 -0
- package/modules/workflows/dist/preview.d.ts.map +1 -0
- package/modules/workflows/dist/preview.js +30 -0
- package/modules/workflows/dist/preview.js.map +1 -0
- package/modules/workflows/dist/registry.d.ts +26 -0
- package/modules/workflows/dist/registry.d.ts.map +1 -0
- package/modules/workflows/dist/registry.js +110 -0
- package/modules/workflows/dist/registry.js.map +1 -0
- package/modules/workflows/dist/runtime.d.ts +76 -0
- package/modules/workflows/dist/runtime.d.ts.map +1 -0
- package/modules/workflows/dist/runtime.js +445 -0
- package/modules/workflows/dist/runtime.js.map +1 -0
- package/modules/workflows/dist/stores-trade.d.ts +101 -0
- package/modules/workflows/dist/stores-trade.d.ts.map +1 -0
- package/modules/workflows/dist/stores-trade.js +275 -0
- package/modules/workflows/dist/stores-trade.js.map +1 -0
- package/modules/workflows/dist/stores.d.ts +109 -0
- package/modules/workflows/dist/stores.d.ts.map +1 -0
- package/modules/workflows/dist/stores.js +393 -0
- package/modules/workflows/dist/stores.js.map +1 -0
- package/modules/workflows/dist/trade-wire-common-schemas.d.ts +57 -0
- package/modules/workflows/dist/trade-wire-common-schemas.d.ts.map +1 -0
- package/modules/workflows/dist/trade-wire-common-schemas.js +286 -0
- package/modules/workflows/dist/trade-wire-common-schemas.js.map +1 -0
- package/modules/workflows/dist/trade-wire-ledger-schemas.d.ts +102 -0
- package/modules/workflows/dist/trade-wire-ledger-schemas.d.ts.map +1 -0
- package/modules/workflows/dist/trade-wire-ledger-schemas.js +321 -0
- package/modules/workflows/dist/trade-wire-ledger-schemas.js.map +1 -0
- package/modules/workflows/dist/trade-wire-market-schemas.d.ts +5 -0
- package/modules/workflows/dist/trade-wire-market-schemas.d.ts.map +1 -0
- package/modules/workflows/dist/trade-wire-market-schemas.js +84 -0
- package/modules/workflows/dist/trade-wire-market-schemas.js.map +1 -0
- package/modules/workflows/dist/trade-wire-schemas.d.ts +1134 -0
- package/modules/workflows/dist/trade-wire-schemas.d.ts.map +1 -0
- package/modules/workflows/dist/trade-wire-schemas.js +755 -0
- package/modules/workflows/dist/trade-wire-schemas.js.map +1 -0
- package/modules/workflows/dist/version.d.ts +3 -0
- package/modules/workflows/dist/version.d.ts.map +1 -0
- package/modules/workflows/dist/version.js +3 -0
- package/modules/workflows/dist/version.js.map +1 -0
- package/modules/workflows/dist/wire-schemas.d.ts +84 -0
- package/modules/workflows/dist/wire-schemas.d.ts.map +1 -0
- package/modules/workflows/dist/wire-schemas.js +88 -0
- package/modules/workflows/dist/wire-schemas.js.map +1 -0
- package/modules/workflows/etc/workflows.api.md +95 -0
- package/modules/workflows/src/capabilities.ts +67 -0
- package/modules/workflows/src/envelope-schema.ts +170 -0
- package/modules/workflows/src/index.ts +118 -0
- package/modules/workflows/src/json-safe.ts +19 -0
- package/modules/workflows/src/local/file-lock.ts +200 -0
- package/modules/workflows/src/local/file-stores.ts +452 -0
- package/modules/workflows/src/local/index.ts +20 -0
- package/modules/workflows/src/local/job-worker.ts +74 -0
- package/modules/workflows/src/local/jobs.ts +458 -0
- package/modules/workflows/src/local/local-runner.ts +170 -0
- package/modules/workflows/src/local/profiles.ts +113 -0
- package/modules/workflows/src/operation-kit.ts +234 -0
- package/modules/workflows/src/operation.ts +607 -0
- package/modules/workflows/src/operations-analysis.ts +1058 -0
- package/modules/workflows/src/operations-compute.ts +1458 -0
- package/modules/workflows/src/operations-journey.ts +2744 -0
- package/modules/workflows/src/operations-trade.ts +946 -0
- package/modules/workflows/src/preview.ts +34 -0
- package/modules/workflows/src/registry.ts +150 -0
- package/modules/workflows/src/runtime.ts +633 -0
- package/modules/workflows/src/stores-trade.ts +463 -0
- package/modules/workflows/src/stores.ts +608 -0
- package/modules/workflows/src/trade-wire-common-schemas.ts +337 -0
- package/modules/workflows/src/trade-wire-ledger-schemas.ts +359 -0
- package/modules/workflows/src/trade-wire-market-schemas.ts +103 -0
- package/modules/workflows/src/trade-wire-schemas.ts +906 -0
- package/modules/workflows/src/version.ts +2 -0
- package/modules/workflows/src/wire-schemas.ts +100 -0
- package/package.json +1008 -0
|
@@ -0,0 +1,1499 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Implied-volatility surface (spec §10.1).
|
|
3
|
+
*
|
|
4
|
+
* Builds a surface from an option chain: solves an implied vol per quote (or uses the quote's own
|
|
5
|
+
* `impliedVolatility`), groups into per-expiry smiles, and offers strike×expiry lookup (plus moneyness- and
|
|
6
|
+
* delta-axis accessors) with extrapolation and sparse-data diagnostics. Cross-expiry interpolation is
|
|
7
|
+
* linear in total variance `w = σ²·T`, the calendar-arbitrage-friendly axis. Eight `model`s are
|
|
8
|
+
* supported: non-parametric `raw` (linear), `interpolated` (shape-preserving PCHIP) and `smoothed`
|
|
9
|
+
* (Gaussian-kernel); parametric `svi`/`sabr` calibrated per expiry; and three calibrated globally to the
|
|
10
|
+
* whole surface — `ssvi` (the arbitrage-free Gatheral–Jacquier surface SVI), `essvi` (SSVI with a
|
|
11
|
+
* per-maturity skew), and `heston` (stochastic-vol). Parametric models fall back to an interpolated smile
|
|
12
|
+
* (with a diagnostic) for expiries with too few strikes, and an SVI slice that remains
|
|
13
|
+
* butterfly-arbitrageable after calibration is flagged. (Dupire local-volatility *surface fitting* is
|
|
14
|
+
* sequenced later — spec §10.1.)
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import {
|
|
18
|
+
type Assumptions,
|
|
19
|
+
CONVENTIONS_VERSION,
|
|
20
|
+
type Computed,
|
|
21
|
+
type Diagnostics,
|
|
22
|
+
type EpochMs,
|
|
23
|
+
ErrorCode,
|
|
24
|
+
InputError,
|
|
25
|
+
type MarketInputs,
|
|
26
|
+
type OptionQuote,
|
|
27
|
+
type OptionType,
|
|
28
|
+
type PriceSource,
|
|
29
|
+
type QuantWarning,
|
|
30
|
+
WarningCode,
|
|
31
|
+
ensureFinite,
|
|
32
|
+
ensureKnownKeys,
|
|
33
|
+
optionExpiryToMs,
|
|
34
|
+
requireArgumentArray,
|
|
35
|
+
requireArgumentObject,
|
|
36
|
+
selectQuotePrice,
|
|
37
|
+
wrongShapeError,
|
|
38
|
+
yearFraction,
|
|
39
|
+
resolveValuationAsOf,
|
|
40
|
+
type ClosedRequestSpecification,
|
|
41
|
+
validateClosedRequest,
|
|
42
|
+
} from '@totalfinance/core';
|
|
43
|
+
import { VALIDATION_SPECS } from './generated/validation-specs.js';
|
|
44
|
+
import { makePchipInterpolator, normalCdf } from '@totalfinance/math';
|
|
45
|
+
import {
|
|
46
|
+
impliedVolatility,
|
|
47
|
+
type HestonParameters,
|
|
48
|
+
type SabrParameters,
|
|
49
|
+
type SabrVolatilityType,
|
|
50
|
+
} from '@totalfinance/options';
|
|
51
|
+
import { hestonImpliedVolatility } from '@totalfinance/options/heston';
|
|
52
|
+
import { sabrVolatility } from '@totalfinance/options/sabr';
|
|
53
|
+
import { type SVIParameters, calibrateSvi, sviVolatility } from './svi.js';
|
|
54
|
+
import { type SSVIParameters, calibrateSsvi, ssviVolatility } from './ssvi.js';
|
|
55
|
+
import { type ESSVIParameters, calibrateEssvi, essviVolatility } from './essvi.js';
|
|
56
|
+
import { calibrateSabrSmile } from './sabr.js';
|
|
57
|
+
import { calibrateHestonSurface } from './heston-surface.js';
|
|
58
|
+
import {
|
|
59
|
+
type ArbitrageCheckOptions,
|
|
60
|
+
type ArbitrageReport,
|
|
61
|
+
surfaceArbitrageReport,
|
|
62
|
+
} from './arbitrage.js';
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* `raw`/`interpolated`/`smoothed` are non-parametric (linear, PCHIP, and a Gaussian-kernel smoother);
|
|
66
|
+
* `svi`/`sabr` fit a parametric smile per expiry; `heston` calibrates one global stochastic-vol model
|
|
67
|
+
* to the whole surface. Parametric models fall back to an interpolated smile for expiries with too few
|
|
68
|
+
* strikes. (Dupire local-volatility *surface fitting* is sequenced later — spec §10.1.)
|
|
69
|
+
*/
|
|
70
|
+
export type SurfaceModel =
|
|
71
|
+
| 'raw'
|
|
72
|
+
| 'interpolated'
|
|
73
|
+
| 'smoothed'
|
|
74
|
+
| 'svi'
|
|
75
|
+
| 'sabr'
|
|
76
|
+
| 'ssvi'
|
|
77
|
+
| 'essvi'
|
|
78
|
+
| 'heston';
|
|
79
|
+
|
|
80
|
+
const SURFACE_MODELS: readonly SurfaceModel[] = [
|
|
81
|
+
'raw',
|
|
82
|
+
'interpolated',
|
|
83
|
+
'smoothed',
|
|
84
|
+
'svi',
|
|
85
|
+
'sabr',
|
|
86
|
+
'ssvi',
|
|
87
|
+
'essvi',
|
|
88
|
+
'heston',
|
|
89
|
+
];
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Market snapshot for `volatilitySurface()` — the workspace-canonical {@link MarketInputs}, except `spot` is
|
|
93
|
+
* optional (it falls back to each quote's `underlyingPrice` when omitted) (WS3.2).
|
|
94
|
+
*/
|
|
95
|
+
export type SurfaceMarket = Omit<MarketInputs, 'spot'> & {
|
|
96
|
+
/** Spot price. Falls back to each quote's `underlyingPrice` when omitted. */
|
|
97
|
+
spot?: number;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
/** The documented {@link SurfaceMarket} fields (the {@link MarketInputs} keys, `spot` optional). */
|
|
101
|
+
export const SURFACE_MARKET_KEYS = ['spot', 'riskFreeRate', 'dividendYield', 'asOf'] as const;
|
|
102
|
+
|
|
103
|
+
/** Non-market surface configuration: price source, model, and per-model calibration knobs (WS3.2). */
|
|
104
|
+
export interface SurfaceConfig {
|
|
105
|
+
/** Which quote price to invert when a quote has no `impliedVolatility` (default `mid`). */
|
|
106
|
+
priceSource?: PriceSource;
|
|
107
|
+
/**
|
|
108
|
+
* `interpolated` (PCHIP, default), `raw` (linear), `smoothed` (Gaussian kernel), `svi`/`sabr`
|
|
109
|
+
* (parametric per expiry), `ssvi` (one global arbitrage-free surface SVI), `essvi` (SSVI with a
|
|
110
|
+
* per-maturity skew), or `heston` (one global stochastic-vol model fit to the whole surface).
|
|
111
|
+
*/
|
|
112
|
+
model?: SurfaceModel;
|
|
113
|
+
/** Below this many usable strikes, an expiry slice is flagged sparse (default 3). */
|
|
114
|
+
minQuotesPerExpiry?: number;
|
|
115
|
+
/** SABR backbone exponent β ∈ [0, 1] for `model: 'sabr'` (default 0.5). */
|
|
116
|
+
sabrBeta?: number;
|
|
117
|
+
/** SABR Hagan expansion for `model: 'sabr'` (default `'lognormal'`). */
|
|
118
|
+
sabrVolatilityType?: SabrVolatilityType;
|
|
119
|
+
/** Gaussian-kernel bandwidth (in log-moneyness) for `model: 'smoothed'` (default auto). */
|
|
120
|
+
smoothingBandwidth?: number;
|
|
121
|
+
/** Warm start (partial pin) for the global `model: 'heston'` calibration — threads into `calibrateHestonSurface`'s `initialParameters`. */
|
|
122
|
+
hestonInitialParameters?: Partial<HestonParameters>;
|
|
123
|
+
/** COS cosine-term count for the `model: 'heston'` calibration & evaluation (default 128). */
|
|
124
|
+
cosineExpansionTerms?: number;
|
|
125
|
+
/** Curvature family for the global `model: 'ssvi'` calibration (default `'power-law'`). */
|
|
126
|
+
ssviPhi?: 'power-law' | 'heston';
|
|
127
|
+
/** Least-squares weighting for `model: 'ssvi'`: `'uniform'` (default) or `'vega'` (ATM-dominant). */
|
|
128
|
+
ssviWeight?: 'uniform' | 'vega';
|
|
129
|
+
/** Curvature family for the global `model: 'essvi'` calibration (default `'power-law'`). */
|
|
130
|
+
essviPhi?: 'power-law' | 'heston';
|
|
131
|
+
/** Least-squares weighting for `model: 'essvi'`: `'uniform'` (default) or `'vega'` (ATM-dominant). */
|
|
132
|
+
essviWeight?: 'uniform' | 'vega';
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/** The documented {@link SurfaceConfig} fields (Law 12 allowlist). */
|
|
136
|
+
const SURFACE_CONFIG_KEYS = [
|
|
137
|
+
'priceSource',
|
|
138
|
+
'model',
|
|
139
|
+
'minQuotesPerExpiry',
|
|
140
|
+
'sabrBeta',
|
|
141
|
+
'sabrVolatilityType',
|
|
142
|
+
'smoothingBandwidth',
|
|
143
|
+
'hestonInitialParameters',
|
|
144
|
+
'cosineExpansionTerms',
|
|
145
|
+
'ssviPhi',
|
|
146
|
+
'ssviWeight',
|
|
147
|
+
'essviPhi',
|
|
148
|
+
'essviWeight',
|
|
149
|
+
] as const;
|
|
150
|
+
|
|
151
|
+
/** Internal merged view of the two public inputs, used by the constructor body and smile builder. */
|
|
152
|
+
type VolatilitySurfaceOptions = SurfaceMarket & SurfaceConfig;
|
|
153
|
+
|
|
154
|
+
/** One per-expiry smile, strikes ascending. */
|
|
155
|
+
export interface SurfaceSlice {
|
|
156
|
+
expiry: string;
|
|
157
|
+
/** Time to expiry in years (ACT/365F). */
|
|
158
|
+
timeToExpiryYears: number;
|
|
159
|
+
/** Forward `S·e^{(r−q)t}`. */
|
|
160
|
+
forward: number;
|
|
161
|
+
strikes: number[];
|
|
162
|
+
impliedVolatilities: number[];
|
|
163
|
+
/** Call-delta `e^{−qt}·N(d1)` at each strike (the smile's delta axis, for skew lookups). */
|
|
164
|
+
deltas: number[];
|
|
165
|
+
/** Fitted raw-SVI parameters when `model: 'svi'` (absent if the slice fell back to interpolation). */
|
|
166
|
+
svi?: SVIParameters;
|
|
167
|
+
/** Fitted SABR parameters when `model: 'sabr'` (absent if the slice fell back to interpolation). */
|
|
168
|
+
sabr?: SabrParameters;
|
|
169
|
+
/** The globally-calibrated SSVI parameters when `model: 'ssvi'` (shared across all slices). */
|
|
170
|
+
ssvi?: SSVIParameters;
|
|
171
|
+
/** The globally-calibrated eSSVI parameters when `model: 'essvi'` (shared across all slices). */
|
|
172
|
+
essvi?: ESSVIParameters;
|
|
173
|
+
/** The globally-calibrated Heston parameters when `model: 'heston'` (shared across all slices). */
|
|
174
|
+
heston?: HestonParameters;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/** A raw solved surface point before smoothing. */
|
|
178
|
+
export interface SurfacePoint {
|
|
179
|
+
expiry: string;
|
|
180
|
+
strike: number;
|
|
181
|
+
type: OptionType;
|
|
182
|
+
timeToExpiryYears: number;
|
|
183
|
+
impliedVolatility: number;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/** Result of a surface lookup: the IV plus whether the query was extrapolated. */
|
|
187
|
+
export interface SurfaceLookup extends Computed<number> {
|
|
188
|
+
extrapolated: boolean;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/** Schema version stamped onto every {@link VolatilitySurface#toJSON} snapshot; checked on restore (WS4.4). */
|
|
192
|
+
export const SURFACE_SCHEMA_VERSION = '1';
|
|
193
|
+
|
|
194
|
+
/** A vol-structure shock echoed in a shocked surface's {@link VolatilitySurface.assumptions} (WS4.4). */
|
|
195
|
+
export interface SurfaceShock {
|
|
196
|
+
/** Additive parallel shift applied to every stored IV (in vol points, e.g. `0.02` = +2 vol). */
|
|
197
|
+
parallel: number;
|
|
198
|
+
/** Skew rotation: adds `skewTilt · k` where `k = ln(K/forward)` (log-moneyness). */
|
|
199
|
+
skewTilt: number;
|
|
200
|
+
/** Which quantity the tilt is pinned to: `'strike'` (default) or `'moneyness'`. */
|
|
201
|
+
sticky: 'strike' | 'moneyness';
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* One chart-facing row from {@link VolatilitySurface#toRows} — the smile-chart / heatmap feed. Per the
|
|
206
|
+
* workspace missing-value policy (WS2.12), every chart-facing numeric is `number | null`: a non-finite
|
|
207
|
+
* stored value becomes `null`, never `NaN` and never omitted.
|
|
208
|
+
*/
|
|
209
|
+
export interface SurfaceRow {
|
|
210
|
+
expiry: string;
|
|
211
|
+
strike: number;
|
|
212
|
+
/** `ln(strike/forward)`, or `null` if non-finite. */
|
|
213
|
+
logMoneyness: number | null;
|
|
214
|
+
/** Stored call-delta at the strike, or `null` if the stored value is non-finite. */
|
|
215
|
+
delta: number | null;
|
|
216
|
+
/** Stored implied vol at the strike, or `null` if the stored value is non-finite. */
|
|
217
|
+
impliedVolatility: number | null;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* A serialized surface (spec WS4.4). Carries the model, per-slice smile state (including any fitted
|
|
222
|
+
* `svi`/`sabr`/`heston` parameters), points, assumptions/diagnostics, the global Heston parameters, `spotRef`,
|
|
223
|
+
* and the config knobs needed to REBUILD interpolators. Closures are never serialized —
|
|
224
|
+
* {@link VolatilitySurface.fromJSON} rebuilds them from this state so the restored surface answers `iv()`
|
|
225
|
+
* identically.
|
|
226
|
+
*/
|
|
227
|
+
export interface VolatilitySurfaceSnapshot {
|
|
228
|
+
schemaVersion: string;
|
|
229
|
+
model: SurfaceModel;
|
|
230
|
+
slices: SurfaceSlice[];
|
|
231
|
+
points: SurfacePoint[];
|
|
232
|
+
assumptions: Assumptions<{ shock?: SurfaceShock }>;
|
|
233
|
+
diagnostics: Diagnostics;
|
|
234
|
+
/** The global SSVI parameters when `model: 'ssvi'`. */
|
|
235
|
+
ssvi?: SSVIParameters;
|
|
236
|
+
/** The global eSSVI parameters when `model: 'essvi'`. */
|
|
237
|
+
essvi?: ESSVIParameters;
|
|
238
|
+
/** The global Heston parameters when `model: 'heston'`. */
|
|
239
|
+
heston?: HestonParameters;
|
|
240
|
+
referenceSpot: number;
|
|
241
|
+
/** Config knobs needed to rebuild the per-slice interpolators without re-solving from quotes. */
|
|
242
|
+
config: {
|
|
243
|
+
riskFreeRate: number;
|
|
244
|
+
dividendYield: number;
|
|
245
|
+
sabrBeta: number;
|
|
246
|
+
sabrVolatilityType: SabrVolatilityType;
|
|
247
|
+
smoothingBandwidth?: number;
|
|
248
|
+
cosineExpansionTerms: number;
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
function expiryToYears(asOf: EpochMs, expiry: string): number {
|
|
253
|
+
// A bare `YYYY-MM-DD` resolves to 16:00 ET (US options close), not UTC midnight, so a same-day 0DTE
|
|
254
|
+
// chain quoted intraday still carries positive time-to-expiry instead of being dropped as expired.
|
|
255
|
+
// Matches the core/options/structure convention (spec §1 expiry handling).
|
|
256
|
+
const ms = optionExpiryToMs(expiry);
|
|
257
|
+
return yearFraction(asOf, ms, 'ACT/365F');
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
function callDelta(input: {
|
|
261
|
+
spot: number;
|
|
262
|
+
strike: number;
|
|
263
|
+
timeToExpiryYears: number;
|
|
264
|
+
riskFreeRate: number;
|
|
265
|
+
dividendYield: number;
|
|
266
|
+
volatility: number;
|
|
267
|
+
}): number {
|
|
268
|
+
const {
|
|
269
|
+
spot: S,
|
|
270
|
+
strike: K,
|
|
271
|
+
timeToExpiryYears: T,
|
|
272
|
+
riskFreeRate: r,
|
|
273
|
+
dividendYield: q,
|
|
274
|
+
volatility: sigma,
|
|
275
|
+
} = input;
|
|
276
|
+
const d1 = (Math.log(S / K) + (r - q + 0.5 * sigma * sigma) * T) / (sigma * Math.sqrt(T));
|
|
277
|
+
return Math.exp(-q * T) * normalCdf(d1);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
function fitWarning(model: 'svi' | 'sabr', expiry: string, rmse: number): QuantWarning {
|
|
281
|
+
return {
|
|
282
|
+
code: WarningCode.VolatilityFitUnconverged,
|
|
283
|
+
message: `${model.toUpperCase()} fit for ${expiry} did not fully converge (rmse=${rmse.toExponential(
|
|
284
|
+
2,
|
|
285
|
+
)}).`,
|
|
286
|
+
severity: 'warn',
|
|
287
|
+
context: { expiry, model, rmse },
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
function insufficientWarning(
|
|
292
|
+
model: 'svi' | 'sabr',
|
|
293
|
+
need: number,
|
|
294
|
+
expiry: string,
|
|
295
|
+
have: number,
|
|
296
|
+
): QuantWarning {
|
|
297
|
+
return {
|
|
298
|
+
code: WarningCode.VolatilityFitInsufficientData,
|
|
299
|
+
message: `Expiry ${expiry} has ${have} strike(s) (<${need} needed for ${model.toUpperCase()}); falling back to an interpolated smile.`,
|
|
300
|
+
severity: 'warn',
|
|
301
|
+
context: { expiry, model, need, have },
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
interface RawPoint {
|
|
306
|
+
strike: number;
|
|
307
|
+
type: OptionType;
|
|
308
|
+
impliedVolatility: number;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
/** The knobs {@link buildSmile} needs to reconstruct a slice's smile closure without re-fitting. */
|
|
312
|
+
interface SmileConfig {
|
|
313
|
+
model: SurfaceModel;
|
|
314
|
+
riskFreeRate: number;
|
|
315
|
+
dividendYield: number;
|
|
316
|
+
sabrVolatilityType: SabrVolatilityType;
|
|
317
|
+
smoothingBandwidth?: number;
|
|
318
|
+
cosineExpansionTerms: number;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
/** The diagnostics `method` label for a model (single source shared by the constructor and `shock`). */
|
|
322
|
+
function methodFor(model: SurfaceModel, sabrBeta: number): string {
|
|
323
|
+
return model === 'svi'
|
|
324
|
+
? 'svi+total-variance'
|
|
325
|
+
: model === 'sabr'
|
|
326
|
+
? `sabr(β=${sabrBeta})+total-variance`
|
|
327
|
+
: model === 'ssvi'
|
|
328
|
+
? 'ssvi-global+total-variance'
|
|
329
|
+
: model === 'essvi'
|
|
330
|
+
? 'essvi-global+total-variance'
|
|
331
|
+
: model === 'heston'
|
|
332
|
+
? 'heston-cos+total-variance'
|
|
333
|
+
: model === 'smoothed'
|
|
334
|
+
? 'gaussian-kernel+total-variance'
|
|
335
|
+
: model === 'interpolated'
|
|
336
|
+
? 'pchip+total-variance'
|
|
337
|
+
: 'linear+total-variance';
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
/** Deep-copy SSVI parameters (the `phi` object and the `θ` term-structure array must not be aliased). */
|
|
341
|
+
function cloneSSVI(p: SSVIParameters): SSVIParameters {
|
|
342
|
+
return { ...p, phi: { ...p.phi }, thetaTerm: p.thetaTerm.map((x) => ({ ...x })) };
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
/** Deep-copy eSSVI parameters (the `phi` object and the `(t, θ, ρ)` term-structure array must not be aliased). */
|
|
346
|
+
function cloneESSVI(p: ESSVIParameters): ESSVIParameters {
|
|
347
|
+
return { ...p, phi: { ...p.phi }, thetaTerm: p.thetaTerm.map((x) => ({ ...x })) };
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* Build a slice's strike→IV closure from ALREADY-fitted state — this NEVER re-fits. Parametric slices
|
|
352
|
+
* read their stored `svi`/`sabr`/`heston` parameters; non-parametric slices interpolate the stored `impliedVolatilities`
|
|
353
|
+
* (PCHIP, or linear for `raw`/too-few-points, with flat extrapolation; a Gaussian kernel for
|
|
354
|
+
* `smoothed`). It is the single source of truth for the smile shape, called by the constructor (after
|
|
355
|
+
* fitting), by {@link VolatilitySurface.fromJSON} (from a snapshot), and by {@link VolatilitySurface#shock} (from
|
|
356
|
+
* shifted samples) — so a live, restored, or shocked surface all answer `iv()` byte-identically.
|
|
357
|
+
*/
|
|
358
|
+
function buildSmile(
|
|
359
|
+
slice: SurfaceSlice,
|
|
360
|
+
cfg: SmileConfig,
|
|
361
|
+
referenceSpot: number,
|
|
362
|
+
): (x: number) => number {
|
|
363
|
+
if (slice.strikes.length === 1) {
|
|
364
|
+
const v = slice.impliedVolatilities[0]!;
|
|
365
|
+
return () => v;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
if (cfg.model === 'svi' && slice.svi !== undefined) {
|
|
369
|
+
const p = slice.svi;
|
|
370
|
+
return (K: number) => sviVolatility(p, Math.log(K / slice.forward), slice.timeToExpiryYears);
|
|
371
|
+
}
|
|
372
|
+
if (cfg.model === 'sabr' && slice.sabr !== undefined) {
|
|
373
|
+
const p = slice.sabr;
|
|
374
|
+
const vt = cfg.sabrVolatilityType;
|
|
375
|
+
return (K: number) =>
|
|
376
|
+
sabrVolatility({
|
|
377
|
+
input: { forward: slice.forward, strike: K, timeToExpiryYears: slice.timeToExpiryYears },
|
|
378
|
+
parameters: p,
|
|
379
|
+
options: { volatilityType: vt },
|
|
380
|
+
});
|
|
381
|
+
}
|
|
382
|
+
if (cfg.model === 'ssvi' && slice.ssvi !== undefined) {
|
|
383
|
+
// The whole surface shares one globally-calibrated SSVI param set (mirrored onto each slice); the smile
|
|
384
|
+
// is its `ssviVolatility` at `t`, evaluated in log-moneyness (θ(t) interpolation ⇒ arbitrage-free in time).
|
|
385
|
+
const p = slice.ssvi;
|
|
386
|
+
return (K: number) => ssviVolatility(p, Math.log(K / slice.forward), slice.timeToExpiryYears);
|
|
387
|
+
}
|
|
388
|
+
if (cfg.model === 'essvi' && slice.essvi !== undefined) {
|
|
389
|
+
// Like SSVI, one globally-calibrated eSSVI param set (mirrored onto each slice), but with a per-maturity
|
|
390
|
+
// skew ρ(θ); the smile is its `essviVolatility` at `t`, evaluated in log-moneyness.
|
|
391
|
+
const p = slice.essvi;
|
|
392
|
+
return (K: number) => essviVolatility(p, Math.log(K / slice.forward), slice.timeToExpiryYears);
|
|
393
|
+
}
|
|
394
|
+
if (cfg.model === 'heston') {
|
|
395
|
+
// The whole surface shares one calibrated parameter set (mirrored onto each slice); the smile is
|
|
396
|
+
// its COS-priced IV at `t`. A failed inversion yields NaN, which the lookup surfaces (never faked).
|
|
397
|
+
const parameters = slice.heston!;
|
|
398
|
+
const terms = cfg.cosineExpansionTerms;
|
|
399
|
+
const r = cfg.riskFreeRate;
|
|
400
|
+
const q = cfg.dividendYield;
|
|
401
|
+
const S = referenceSpot;
|
|
402
|
+
const t = slice.timeToExpiryYears;
|
|
403
|
+
return (K: number) =>
|
|
404
|
+
hestonImpliedVolatility({
|
|
405
|
+
type: 'call',
|
|
406
|
+
input: { spot: S, strike: K, timeToExpiryYears: t, riskFreeRate: r, dividendYield: q },
|
|
407
|
+
parameters,
|
|
408
|
+
options: {
|
|
409
|
+
terms,
|
|
410
|
+
greeks: false,
|
|
411
|
+
},
|
|
412
|
+
}).value;
|
|
413
|
+
}
|
|
414
|
+
if (cfg.model === 'smoothed') {
|
|
415
|
+
// Nadaraya–Watson Gaussian-kernel smoother in log-moneyness: a denoised, smooth smile.
|
|
416
|
+
const ks = slice.strikes.map((K) => Math.log(K / slice.forward));
|
|
417
|
+
const ys = slice.impliedVolatilities.slice();
|
|
418
|
+
const range = ks[ks.length - 1]! - ks[0]!;
|
|
419
|
+
const h = cfg.smoothingBandwidth ?? Math.max(0.03, (range / Math.max(1, ks.length - 1)) * 1.5);
|
|
420
|
+
return (K: number) => {
|
|
421
|
+
const k = Math.log(K / slice.forward);
|
|
422
|
+
let num = 0;
|
|
423
|
+
let den = 0;
|
|
424
|
+
for (let i = 0; i < ks.length; i++) {
|
|
425
|
+
const wt = Math.exp(-0.5 * ((k - ks[i]!) / h) ** 2);
|
|
426
|
+
num += wt * ys[i]!;
|
|
427
|
+
den += wt;
|
|
428
|
+
}
|
|
429
|
+
return den > 0 ? num / den : ys[0]!;
|
|
430
|
+
};
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
// Non-parametric smile (the explicit choice, or a parametric fall-back): PCHIP unless `raw` /
|
|
434
|
+
// too few points, then linear with flat extrapolation outside the strike range.
|
|
435
|
+
if (cfg.model !== 'raw' && slice.strikes.length >= 3) {
|
|
436
|
+
return makePchipInterpolator(slice.strikes, slice.impliedVolatilities);
|
|
437
|
+
}
|
|
438
|
+
const xs = slice.strikes;
|
|
439
|
+
const ys = slice.impliedVolatilities;
|
|
440
|
+
return (x: number) => {
|
|
441
|
+
if (x <= xs[0]!) return ys[0]!;
|
|
442
|
+
if (x >= xs[xs.length - 1]!) return ys[ys.length - 1]!;
|
|
443
|
+
let hi = 1;
|
|
444
|
+
while (hi < xs.length && xs[hi]! < x) hi++;
|
|
445
|
+
const lo = hi - 1;
|
|
446
|
+
const w = (x - xs[lo]!) / (xs[hi]! - xs[lo]!);
|
|
447
|
+
return ys[lo]! + w * (ys[hi]! - ys[lo]!);
|
|
448
|
+
};
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
/**
|
|
452
|
+
* Deep-copy a slice so a serialized snapshot (or a surface rebuilt from one) never aliases the other's
|
|
453
|
+
* mutable state: the `strikes`/`impliedVolatilities`/`deltas` arrays AND the fitted `svi`/`sabr`/`heston` parameters are
|
|
454
|
+
* copied, not shared. A shallow `{ ...s }` would leave those arrays live-linked — mutating a
|
|
455
|
+
* snapshot's `impliedVolatilities` would then silently change the surface's own `iv()` answers.
|
|
456
|
+
*/
|
|
457
|
+
function cloneSlice(s: SurfaceSlice): SurfaceSlice {
|
|
458
|
+
return {
|
|
459
|
+
...s,
|
|
460
|
+
strikes: s.strikes.slice(),
|
|
461
|
+
impliedVolatilities: s.impliedVolatilities.slice(),
|
|
462
|
+
deltas: s.deltas.slice(),
|
|
463
|
+
...(s.svi ? { svi: { ...s.svi } } : {}),
|
|
464
|
+
...(s.sabr ? { sabr: { ...s.sabr } } : {}),
|
|
465
|
+
...(s.ssvi ? { ssvi: cloneSSVI(s.ssvi) } : {}),
|
|
466
|
+
...(s.essvi ? { essvi: cloneESSVI(s.essvi) } : {}),
|
|
467
|
+
...(s.heston ? { heston: { ...s.heston } } : {}),
|
|
468
|
+
};
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
/** Copy diagnostics with a fresh `warnings` array so a snapshot's warnings can't be pushed into the live one. */
|
|
472
|
+
function cloneDiagnostics(d: Diagnostics): Diagnostics {
|
|
473
|
+
return { ...d, warnings: d.warnings.map((w) => ({ ...w })) };
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
/** Copy assumptions with a fresh `shock` sub-object (when present) so the snapshot is self-contained. */
|
|
477
|
+
function cloneSurfaceAssumptions(
|
|
478
|
+
a: Assumptions<{ shock?: SurfaceShock }>,
|
|
479
|
+
): Assumptions<{ shock?: SurfaceShock }> {
|
|
480
|
+
return { ...a, ...(a.shock ? { shock: { ...a.shock } } : {}) };
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
export interface VolatilitySurfaceInput {
|
|
484
|
+
quotes: OptionQuote[];
|
|
485
|
+
market: SurfaceMarket;
|
|
486
|
+
config?: SurfaceConfig;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
/** A fitted implied-volatility surface with diagnostics-bearing lookup. */
|
|
490
|
+
export class VolatilitySurface {
|
|
491
|
+
readonly model: SurfaceModel;
|
|
492
|
+
readonly slices: SurfaceSlice[];
|
|
493
|
+
readonly points: SurfacePoint[];
|
|
494
|
+
readonly diagnostics: Diagnostics;
|
|
495
|
+
readonly assumptions: Assumptions<{ shock?: SurfaceShock }>;
|
|
496
|
+
/** The global SSVI parameters when `model: 'ssvi'`, else `undefined`. */
|
|
497
|
+
readonly ssvi?: SSVIParameters;
|
|
498
|
+
/** The global eSSVI parameters when `model: 'essvi'`, else `undefined`. */
|
|
499
|
+
readonly essvi?: ESSVIParameters;
|
|
500
|
+
/** The global Heston parameters when `model: 'heston'`, else `undefined`. */
|
|
501
|
+
readonly heston?: HestonParameters;
|
|
502
|
+
private readonly interps: Array<(x: number) => number>;
|
|
503
|
+
private readonly referenceSpot: number;
|
|
504
|
+
// The config knobs needed to rebuild interpolators (for `shock` / `toJSON` / `fromJSON`), captured so
|
|
505
|
+
// a shocked or restored surface reproduces the smiles without re-solving IVs from quotes.
|
|
506
|
+
private readonly rate: number;
|
|
507
|
+
private readonly dividendYield: number;
|
|
508
|
+
private readonly sabrBeta: number;
|
|
509
|
+
private readonly sabrVolatilityType: SabrVolatilityType;
|
|
510
|
+
private readonly smoothingBandwidth?: number;
|
|
511
|
+
private readonly cosineExpansionTerms: number;
|
|
512
|
+
|
|
513
|
+
constructor(input: VolatilitySurfaceInput) {
|
|
514
|
+
requireArgumentObject('volatilitySurface', 'input', input);
|
|
515
|
+
ensureKnownKeys('volatilitySurface', 'input', input, ['quotes', 'market', 'config']);
|
|
516
|
+
const { quotes, market, config = {} } = input;
|
|
517
|
+
// Container + element-0 shape guard (the first-touch law): `undefined` quotes would die on the
|
|
518
|
+
// for…of ("quotes is not iterable"), and a string ITERATES — 'hello' would loop character-by-
|
|
519
|
+
// character into a raw destructure TypeError. Teach the OptionQuote shape instead.
|
|
520
|
+
requireArgumentArray('volatilitySurface', 'quotes', quotes);
|
|
521
|
+
if (quotes.length > 0) {
|
|
522
|
+
const first = quotes[0] as unknown;
|
|
523
|
+
const contract =
|
|
524
|
+
first !== null && typeof first === 'object'
|
|
525
|
+
? (first as { contract?: unknown }).contract
|
|
526
|
+
: undefined;
|
|
527
|
+
if (contract === null || typeof contract !== 'object') {
|
|
528
|
+
throw wrongShapeError(
|
|
529
|
+
'volatilitySurface',
|
|
530
|
+
'quotes[0] to be an OptionQuote: { contract: { underlying, type, style, strike, expiry }, ts, bid?/ask?/mid?/impliedVolatility?, underlyingPrice? }',
|
|
531
|
+
first,
|
|
532
|
+
);
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
// A misspelled market/config field (`devidendYield`, `modle`) silently changing the fit is the
|
|
536
|
+
// Law 12 bug class — reject unknown keys on both objects before they merge.
|
|
537
|
+
requireArgumentObject('volatilitySurface', 'market', market);
|
|
538
|
+
ensureKnownKeys('volatilitySurface', 'market', market, SURFACE_MARKET_KEYS);
|
|
539
|
+
// `null` slips past the `= {}` default and would die on the first config read — reject it typed.
|
|
540
|
+
requireArgumentObject('volatilitySurface', 'config', config);
|
|
541
|
+
ensureKnownKeys('volatilitySurface', 'config', config, SURFACE_CONFIG_KEYS);
|
|
542
|
+
const options: VolatilitySurfaceOptions = { ...market, ...config };
|
|
543
|
+
ensureFinite(options.riskFreeRate, 'riskFreeRate', 'volatilitySurface');
|
|
544
|
+
const asOfMs = resolveValuationAsOf(options.asOf, 'volatilitySurface');
|
|
545
|
+
ensureFinite(asOfMs, 'asOf', 'volatilitySurface');
|
|
546
|
+
const q = options.dividendYield ?? 0;
|
|
547
|
+
ensureFinite(q, 'dividendYield', 'volatilitySurface');
|
|
548
|
+
// A non-finite/non-positive global spot √-propagates NaN through every forward and IV while the
|
|
549
|
+
// surface still reports converged:true — reject it up front (design law #4). `> 0` alone passes
|
|
550
|
+
// Infinity, so the finiteness check is load-bearing.
|
|
551
|
+
if (options.spot !== undefined && (!(options.spot > 0) || !Number.isFinite(options.spot))) {
|
|
552
|
+
throw new InputError(
|
|
553
|
+
`volatilitySurface: spot must be a positive finite number; got ${options.spot}.`,
|
|
554
|
+
{
|
|
555
|
+
code: ErrorCode.InputNegativeSpot,
|
|
556
|
+
context: { spot: options.spot },
|
|
557
|
+
},
|
|
558
|
+
);
|
|
559
|
+
}
|
|
560
|
+
const r = options.riskFreeRate;
|
|
561
|
+
const source: PriceSource = options.priceSource ?? 'mid';
|
|
562
|
+
if (options.model !== undefined && !SURFACE_MODELS.includes(options.model)) {
|
|
563
|
+
// Reject an unknown model rather than silently falling through to interpolated behaviour.
|
|
564
|
+
throw new InputError(
|
|
565
|
+
`volatilitySurface: model must be one of ${SURFACE_MODELS.join(', ')}; got "${options.model}".`,
|
|
566
|
+
{ code: ErrorCode.InputInvalidEnum, context: { model: options.model } },
|
|
567
|
+
);
|
|
568
|
+
}
|
|
569
|
+
this.model = options.model ?? 'interpolated';
|
|
570
|
+
const minPerExpiry = options.minQuotesPerExpiry ?? 3;
|
|
571
|
+
const warnings: QuantWarning[] = [];
|
|
572
|
+
|
|
573
|
+
// Group usable solved points by expiry.
|
|
574
|
+
const byExpiry = new Map<string, RawPoint[]>();
|
|
575
|
+
const points: SurfacePoint[] = [];
|
|
576
|
+
let skipped = 0;
|
|
577
|
+
let crossed = 0;
|
|
578
|
+
|
|
579
|
+
for (const quote of quotes) {
|
|
580
|
+
const S = options.spot ?? quote.underlyingPrice;
|
|
581
|
+
const { strike, type, expiry } = quote.contract;
|
|
582
|
+
// A CROSSED quote (bid > ask) is broken market data, not a smile: its mid is meaningless, so
|
|
583
|
+
// the IV solved from it is meaningless, and a whole surface built on a crossed chain used to
|
|
584
|
+
// come back with zero warnings. Policy is unchanged (the mid is still used / the quote still
|
|
585
|
+
// takes its normal path) — but the surface now says out loud that it was fed crossed prices.
|
|
586
|
+
if (
|
|
587
|
+
typeof quote.bid === 'number' &&
|
|
588
|
+
typeof quote.ask === 'number' &&
|
|
589
|
+
Number.isFinite(quote.bid) &&
|
|
590
|
+
Number.isFinite(quote.ask) &&
|
|
591
|
+
quote.bid > quote.ask
|
|
592
|
+
) {
|
|
593
|
+
crossed++;
|
|
594
|
+
}
|
|
595
|
+
if (S === undefined || !(S > 0) || !Number.isFinite(S)) {
|
|
596
|
+
skipped++;
|
|
597
|
+
continue;
|
|
598
|
+
}
|
|
599
|
+
const T = expiryToYears(asOfMs, expiry);
|
|
600
|
+
if (!(T > 0) || !(strike > 0)) {
|
|
601
|
+
skipped++;
|
|
602
|
+
continue;
|
|
603
|
+
}
|
|
604
|
+
let volatility: number | undefined;
|
|
605
|
+
if (
|
|
606
|
+
quote.impliedVolatility !== undefined &&
|
|
607
|
+
quote.impliedVolatility > 0 &&
|
|
608
|
+
Number.isFinite(quote.impliedVolatility)
|
|
609
|
+
) {
|
|
610
|
+
volatility = quote.impliedVolatility;
|
|
611
|
+
} else {
|
|
612
|
+
const price = selectQuotePrice(quote, source);
|
|
613
|
+
if (price !== undefined && price > 0) {
|
|
614
|
+
const res = impliedVolatility({
|
|
615
|
+
price,
|
|
616
|
+
spot: S,
|
|
617
|
+
strike,
|
|
618
|
+
timeToExpiryYears: T,
|
|
619
|
+
riskFreeRate: r,
|
|
620
|
+
type,
|
|
621
|
+
dividendYield: q,
|
|
622
|
+
});
|
|
623
|
+
if (res.diagnostics.converged && res.value !== null && res.value > 0)
|
|
624
|
+
volatility = res.value;
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
if (volatility === undefined) {
|
|
628
|
+
skipped++;
|
|
629
|
+
continue;
|
|
630
|
+
}
|
|
631
|
+
points.push({ expiry, strike, type, timeToExpiryYears: T, impliedVolatility: volatility });
|
|
632
|
+
const arr = byExpiry.get(expiry);
|
|
633
|
+
if (arr) arr.push({ strike, type, impliedVolatility: volatility });
|
|
634
|
+
else byExpiry.set(expiry, [{ strike, type, impliedVolatility: volatility }]);
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
if (skipped > 0) {
|
|
638
|
+
warnings.push({
|
|
639
|
+
code: WarningCode.VolatilitySurfaceQuotesSkipped,
|
|
640
|
+
message: `${skipped} quote(s) skipped (missing spot/price or IV did not solve).`,
|
|
641
|
+
severity: 'info',
|
|
642
|
+
context: { skipped },
|
|
643
|
+
});
|
|
644
|
+
}
|
|
645
|
+
if (crossed > 0) {
|
|
646
|
+
warnings.push({
|
|
647
|
+
code: ErrorCode.DataCrossedMarket,
|
|
648
|
+
message:
|
|
649
|
+
`${crossed} quote(s) are CROSSED (bid > ask) — a locked/crossed or stale book. Their mids ` +
|
|
650
|
+
`are not tradeable prices, so any implied vol solved from them is not a market vol; treat ` +
|
|
651
|
+
`this surface as provisional until the feed is clean.`,
|
|
652
|
+
severity: 'warn',
|
|
653
|
+
context: { crossed, quotes: quotes.length },
|
|
654
|
+
});
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
// Build per-expiry smiles. For each strike, prefer the out-of-the-money quote (put below the
|
|
658
|
+
// forward, call above) — the standard, most liquid IV source — averaging when only one side or a
|
|
659
|
+
// duplicate strike exists.
|
|
660
|
+
const slices: SurfaceSlice[] = [];
|
|
661
|
+
for (const [expiry, raw] of byExpiry) {
|
|
662
|
+
const T = expiryToYears(asOfMs, expiry);
|
|
663
|
+
// Spot-fallback mode: take the first quote of this expiry that actually CARRIES a usable
|
|
664
|
+
// underlyingPrice. Taking the first quote of the expiry outright dropped the whole expiry
|
|
665
|
+
// whenever its first quote happened to omit the price — silently, and dependent on the ORDER
|
|
666
|
+
// the chain arrived in (the same quotes shuffled produced a different surface).
|
|
667
|
+
const Sref =
|
|
668
|
+
options.spot ??
|
|
669
|
+
quotes.find(
|
|
670
|
+
(qq) =>
|
|
671
|
+
qq.contract.expiry === expiry &&
|
|
672
|
+
qq.underlyingPrice !== undefined &&
|
|
673
|
+
qq.underlyingPrice > 0 &&
|
|
674
|
+
Number.isFinite(qq.underlyingPrice),
|
|
675
|
+
)?.underlyingPrice;
|
|
676
|
+
if (Sref === undefined) {
|
|
677
|
+
// Reachable only if every quote of an expiry that produced points lost its price in between;
|
|
678
|
+
// name the expiry rather than letting it vanish into the generic skip counter.
|
|
679
|
+
warnings.push({
|
|
680
|
+
code: WarningCode.VolatilitySurfaceSparse,
|
|
681
|
+
message: `Expiry ${expiry} was dropped: no quote carries a usable underlyingPrice and no market.spot was supplied, so its forward cannot be resolved.`,
|
|
682
|
+
severity: 'warn',
|
|
683
|
+
context: { expiry, reason: 'no-reference-spot' },
|
|
684
|
+
});
|
|
685
|
+
continue;
|
|
686
|
+
}
|
|
687
|
+
const forward = Sref * Math.exp((r - q) * T);
|
|
688
|
+
|
|
689
|
+
const byStrike = new Map<number, { otm?: number; any: number[] }>();
|
|
690
|
+
for (const p of raw) {
|
|
691
|
+
const isOtm =
|
|
692
|
+
(p.type === 'put' && p.strike <= forward) || (p.type === 'call' && p.strike >= forward);
|
|
693
|
+
const entry = byStrike.get(p.strike) ?? { any: [] };
|
|
694
|
+
entry.any.push(p.impliedVolatility);
|
|
695
|
+
if (isOtm)
|
|
696
|
+
entry.otm =
|
|
697
|
+
entry.otm === undefined ? p.impliedVolatility : (entry.otm + p.impliedVolatility) / 2;
|
|
698
|
+
byStrike.set(p.strike, entry);
|
|
699
|
+
}
|
|
700
|
+
const strikes = [...byStrike.keys()].sort((a, b) => a - b);
|
|
701
|
+
const impliedVolatilities = strikes.map((k) => {
|
|
702
|
+
const e = byStrike.get(k)!;
|
|
703
|
+
return e.otm ?? e.any.reduce((s, v) => s + v, 0) / e.any.length;
|
|
704
|
+
});
|
|
705
|
+
const deltas = strikes.map((k, i) =>
|
|
706
|
+
callDelta({
|
|
707
|
+
spot: Sref,
|
|
708
|
+
strike: k,
|
|
709
|
+
timeToExpiryYears: T,
|
|
710
|
+
riskFreeRate: r,
|
|
711
|
+
dividendYield: q,
|
|
712
|
+
volatility: impliedVolatilities[i]!,
|
|
713
|
+
}),
|
|
714
|
+
);
|
|
715
|
+
slices.push({ expiry, timeToExpiryYears: T, forward, strikes, impliedVolatilities, deltas });
|
|
716
|
+
|
|
717
|
+
if (strikes.length < minPerExpiry) {
|
|
718
|
+
warnings.push({
|
|
719
|
+
code: WarningCode.VolatilitySurfaceSparse,
|
|
720
|
+
message: `Expiry ${expiry} has only ${strikes.length} usable strike(s); the smile is sparse.`,
|
|
721
|
+
severity: 'warn',
|
|
722
|
+
context: { expiry, strikes: strikes.length },
|
|
723
|
+
});
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
slices.sort((a, b) => a.timeToExpiryYears - b.timeToExpiryYears);
|
|
727
|
+
|
|
728
|
+
if (slices.length === 0) {
|
|
729
|
+
throw new InputError('volatilitySurface: no usable quotes produced a smile.', {
|
|
730
|
+
code: ErrorCode.InputOutOfRange,
|
|
731
|
+
context: { quotes: quotes.length },
|
|
732
|
+
});
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
this.slices = slices;
|
|
736
|
+
this.points = points;
|
|
737
|
+
// A representative spot for delta/moneyness axes and Heston pricing (back out of the forward).
|
|
738
|
+
this.referenceSpot =
|
|
739
|
+
options.spot ?? slices[0]!.forward * Math.exp(-(r - q) * slices[0]!.timeToExpiryYears);
|
|
740
|
+
this.rate = r;
|
|
741
|
+
this.dividendYield = q;
|
|
742
|
+
this.sabrBeta = options.sabrBeta ?? 0.5;
|
|
743
|
+
this.sabrVolatilityType = options.sabrVolatilityType ?? 'lognormal';
|
|
744
|
+
this.cosineExpansionTerms = options.cosineExpansionTerms ?? 128;
|
|
745
|
+
if (options.smoothingBandwidth !== undefined)
|
|
746
|
+
this.smoothingBandwidth = options.smoothingBandwidth;
|
|
747
|
+
|
|
748
|
+
// Global Heston: one parameter set calibrated to the whole surface, before the per-slice smiles.
|
|
749
|
+
if (this.model === 'heston') {
|
|
750
|
+
const targets = slices.flatMap((s) =>
|
|
751
|
+
s.strikes.map((K, i) => ({
|
|
752
|
+
strike: K,
|
|
753
|
+
timeToExpiryYears: s.timeToExpiryYears,
|
|
754
|
+
impliedVolatility: s.impliedVolatilities[i]!,
|
|
755
|
+
forward: s.forward,
|
|
756
|
+
})),
|
|
757
|
+
);
|
|
758
|
+
const fit = calibrateHestonSurface({
|
|
759
|
+
targets,
|
|
760
|
+
market: { spot: this.referenceSpot, riskFreeRate: r, dividendYield: q },
|
|
761
|
+
options: {
|
|
762
|
+
...(options.hestonInitialParameters !== undefined
|
|
763
|
+
? { initialParameters: options.hestonInitialParameters }
|
|
764
|
+
: {}),
|
|
765
|
+
...(options.cosineExpansionTerms !== undefined
|
|
766
|
+
? { terms: options.cosineExpansionTerms }
|
|
767
|
+
: {}),
|
|
768
|
+
},
|
|
769
|
+
});
|
|
770
|
+
this.heston = fit.parameters;
|
|
771
|
+
for (const s of slices) s.heston = fit.parameters;
|
|
772
|
+
if (!fit.converged) {
|
|
773
|
+
warnings.push({
|
|
774
|
+
code: WarningCode.VolatilityFitUnconverged,
|
|
775
|
+
message: `Global Heston calibration did not fully converge (rmse=${fit.rmse.toExponential(
|
|
776
|
+
2,
|
|
777
|
+
)}).`,
|
|
778
|
+
severity: 'warn',
|
|
779
|
+
context: { model: 'heston', rmse: fit.rmse },
|
|
780
|
+
});
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
// Global SSVI: one arbitrage-free parameter set calibrated to the whole surface (like Heston), before
|
|
785
|
+
// the per-slice smiles. Cross-expiry interpolation uses SSVI's own θ(t) ⇒ calendar-arb-free in time.
|
|
786
|
+
if (this.model === 'ssvi') {
|
|
787
|
+
const ssviSlices = slices.map((s) => ({
|
|
788
|
+
timeToExpiryYears: s.timeToExpiryYears,
|
|
789
|
+
k: s.strikes.map((K) => Math.log(K / s.forward)),
|
|
790
|
+
impliedVolatility: s.impliedVolatilities.slice(),
|
|
791
|
+
}));
|
|
792
|
+
const fit = calibrateSsvi(
|
|
793
|
+
{ slices: ssviSlices },
|
|
794
|
+
{
|
|
795
|
+
...(options.ssviPhi !== undefined ? { phi: options.ssviPhi } : {}),
|
|
796
|
+
...(options.ssviWeight !== undefined ? { weight: options.ssviWeight } : {}),
|
|
797
|
+
},
|
|
798
|
+
);
|
|
799
|
+
this.ssvi = fit.parameters;
|
|
800
|
+
for (const s of slices) s.ssvi = fit.parameters;
|
|
801
|
+
if (!fit.converged) {
|
|
802
|
+
warnings.push({
|
|
803
|
+
code: WarningCode.VolatilityFitUnconverged,
|
|
804
|
+
message: `Global SSVI calibration did not fully converge (rmse=${fit.rmse.toExponential(
|
|
805
|
+
2,
|
|
806
|
+
)}).`,
|
|
807
|
+
severity: 'warn',
|
|
808
|
+
context: { model: 'ssvi', rmse: fit.rmse },
|
|
809
|
+
});
|
|
810
|
+
}
|
|
811
|
+
if (!fit.arbitrage.butterflyArbitrageFree) {
|
|
812
|
+
warnings.push({
|
|
813
|
+
code: WarningCode.VolatilityButterflyArbitrage,
|
|
814
|
+
message: `The calibrated SSVI surface is butterfly-arbitrageable (min g(k)=${fit.arbitrage.minButterflyG.toFixed(
|
|
815
|
+
4,
|
|
816
|
+
)} < 0); the implied density goes negative.`,
|
|
817
|
+
severity: 'warn',
|
|
818
|
+
context: { minButterflyG: fit.arbitrage.minButterflyG },
|
|
819
|
+
});
|
|
820
|
+
}
|
|
821
|
+
if (!fit.arbitrage.calendarArbitrageFree) {
|
|
822
|
+
warnings.push({
|
|
823
|
+
code: ErrorCode.VolatilityCalendarArbitrage,
|
|
824
|
+
message: `The calibrated SSVI surface has a residual calendar arbitrage across maturities.`,
|
|
825
|
+
severity: 'warn',
|
|
826
|
+
context: {},
|
|
827
|
+
});
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
// Global eSSVI: SSVI with a per-maturity skew ρ(θ), calibrated once to the whole surface. Because ρ
|
|
832
|
+
// varies, a monotone θ no longer GUARANTEES calendar-arbitrage-freedom, so the calendar warning is a
|
|
833
|
+
// genuinely reachable disclosure here (the calibration scans the (k, t) grid).
|
|
834
|
+
if (this.model === 'essvi') {
|
|
835
|
+
const essviSlices = slices.map((s) => ({
|
|
836
|
+
timeToExpiryYears: s.timeToExpiryYears,
|
|
837
|
+
k: s.strikes.map((K) => Math.log(K / s.forward)),
|
|
838
|
+
impliedVolatility: s.impliedVolatilities.slice(),
|
|
839
|
+
}));
|
|
840
|
+
const fit = calibrateEssvi(
|
|
841
|
+
{ slices: essviSlices },
|
|
842
|
+
{
|
|
843
|
+
...(options.essviPhi !== undefined ? { phi: options.essviPhi } : {}),
|
|
844
|
+
...(options.essviWeight !== undefined ? { weight: options.essviWeight } : {}),
|
|
845
|
+
},
|
|
846
|
+
);
|
|
847
|
+
this.essvi = fit.parameters;
|
|
848
|
+
for (const s of slices) s.essvi = fit.parameters;
|
|
849
|
+
if (!fit.converged) {
|
|
850
|
+
warnings.push({
|
|
851
|
+
code: WarningCode.VolatilityFitUnconverged,
|
|
852
|
+
message: `Global eSSVI calibration did not fully converge (rmse=${fit.rmse.toExponential(
|
|
853
|
+
2,
|
|
854
|
+
)}).`,
|
|
855
|
+
severity: 'warn',
|
|
856
|
+
context: { model: 'essvi', rmse: fit.rmse },
|
|
857
|
+
});
|
|
858
|
+
}
|
|
859
|
+
if (!fit.arbitrage.butterflyArbitrageFree) {
|
|
860
|
+
warnings.push({
|
|
861
|
+
code: WarningCode.VolatilityButterflyArbitrage,
|
|
862
|
+
message: `The calibrated eSSVI surface is butterfly-arbitrageable (min g(k)=${fit.arbitrage.minButterflyG.toFixed(
|
|
863
|
+
4,
|
|
864
|
+
)} < 0); the implied density goes negative.`,
|
|
865
|
+
severity: 'warn',
|
|
866
|
+
context: { minButterflyG: fit.arbitrage.minButterflyG },
|
|
867
|
+
});
|
|
868
|
+
}
|
|
869
|
+
if (!fit.arbitrage.calendarArbitrageFree) {
|
|
870
|
+
warnings.push({
|
|
871
|
+
code: ErrorCode.VolatilityCalendarArbitrage,
|
|
872
|
+
message: `The calibrated eSSVI surface has a residual calendar arbitrage (min Δw=${fit.arbitrage.minCalendarSlope.toFixed(
|
|
873
|
+
4,
|
|
874
|
+
)} < 0) — the per-maturity skew crosses in total variance.`,
|
|
875
|
+
severity: 'warn',
|
|
876
|
+
context: { minCalendarSlope: fit.arbitrage.minCalendarSlope },
|
|
877
|
+
});
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
this.interps = slices.map((s) => this.makeSmile(s, options, warnings));
|
|
882
|
+
this.diagnostics = {
|
|
883
|
+
engine: 'vol-surface',
|
|
884
|
+
method: methodFor(this.model, options.sabrBeta ?? 0.5),
|
|
885
|
+
// Honest convergence: a parametric fit that did not converge already pushed a
|
|
886
|
+
// `volatility.fit_unconverged` warning; the surface-level flag must reflect that, not be hardcoded true.
|
|
887
|
+
converged: !warnings.some((w) => w.code === 'volatility.fit_unconverged'),
|
|
888
|
+
warnings,
|
|
889
|
+
};
|
|
890
|
+
this.assumptions = {
|
|
891
|
+
conventionsVersion: CONVENTIONS_VERSION,
|
|
892
|
+
dayCount: 'ACT/365F',
|
|
893
|
+
compounding: 'continuous',
|
|
894
|
+
asOf: asOfMs,
|
|
895
|
+
model: `vol-surface:${this.model}`,
|
|
896
|
+
};
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
/**
|
|
900
|
+
* Build the per-strike smile for one slice. `svi`/`sabr` fit a parametric model (storing the fitted
|
|
901
|
+
* parameters on the slice); `interpolated` is PCHIP; `raw` is linear. A parametric model with too
|
|
902
|
+
* few strikes to identify it falls back to an interpolated smile with a diagnostic.
|
|
903
|
+
*/
|
|
904
|
+
private makeSmile(
|
|
905
|
+
slice: SurfaceSlice,
|
|
906
|
+
options: VolatilitySurfaceOptions,
|
|
907
|
+
warnings: QuantWarning[],
|
|
908
|
+
): (x: number) => number {
|
|
909
|
+
const cfg = this.smileConfig(options);
|
|
910
|
+
// A single-strike slice is a flat smile; never attempt a parametric fit (and emit no warning).
|
|
911
|
+
if (slice.strikes.length === 1) return buildSmile(slice, cfg, this.referenceSpot);
|
|
912
|
+
|
|
913
|
+
// Fit the parametric models here (storing parameters + emitting diagnostics on the slice); the closure
|
|
914
|
+
// itself is then built by the shared `buildSmile` from those stored parameters — so a live, restored,
|
|
915
|
+
// or shocked surface all rebuild the same closure and answer `iv()` identically.
|
|
916
|
+
if (this.model === 'svi') {
|
|
917
|
+
if (slice.strikes.length >= 5) {
|
|
918
|
+
const ks = slice.strikes.map((K) => Math.log(K / slice.forward));
|
|
919
|
+
const ws = slice.strikes.map(
|
|
920
|
+
(_, i) => slice.impliedVolatilities[i]! ** 2 * slice.timeToExpiryYears,
|
|
921
|
+
);
|
|
922
|
+
// Pass the slice's maturity so calibrateSvi's fit-vs-data check is in true vol points (a fit
|
|
923
|
+
// that is arbitrage-free but far from the quotes comes back `converged: false`, which the
|
|
924
|
+
// surface turns into a `volatility.fit_unconverged` warning and an honest surface-level flag).
|
|
925
|
+
const fit = calibrateSvi({ k: ks, w: ws }, { timeToExpiryYears: slice.timeToExpiryYears });
|
|
926
|
+
slice.svi = fit.parameters;
|
|
927
|
+
if (!fit.converged) warnings.push(fitWarning('svi', slice.expiry, fit.rmse));
|
|
928
|
+
if (!fit.butterflyFree) {
|
|
929
|
+
warnings.push({
|
|
930
|
+
code: WarningCode.VolatilityButterflyArbitrage,
|
|
931
|
+
message: `SVI fit for ${
|
|
932
|
+
slice.expiry
|
|
933
|
+
} is butterfly-arbitrageable (min g(k)=${fit.minButterflyG.toFixed(
|
|
934
|
+
4,
|
|
935
|
+
)} < 0); the implied density goes negative.`,
|
|
936
|
+
severity: 'warn',
|
|
937
|
+
context: { expiry: slice.expiry, minButterflyG: fit.minButterflyG },
|
|
938
|
+
});
|
|
939
|
+
}
|
|
940
|
+
} else {
|
|
941
|
+
warnings.push(insufficientWarning('svi', 5, slice.expiry, slice.strikes.length));
|
|
942
|
+
}
|
|
943
|
+
} else if (this.model === 'sabr') {
|
|
944
|
+
if (slice.strikes.length >= 3) {
|
|
945
|
+
const vt = options.sabrVolatilityType ?? 'lognormal';
|
|
946
|
+
const fit = calibrateSabrSmile(
|
|
947
|
+
{
|
|
948
|
+
forward: slice.forward,
|
|
949
|
+
strikes: slice.strikes,
|
|
950
|
+
impliedVolatilities: slice.impliedVolatilities,
|
|
951
|
+
timeToExpiryYears: slice.timeToExpiryYears,
|
|
952
|
+
},
|
|
953
|
+
{ beta: options.sabrBeta ?? 0.5, volatilityType: vt },
|
|
954
|
+
);
|
|
955
|
+
slice.sabr = fit.parameters;
|
|
956
|
+
if (!fit.converged) warnings.push(fitWarning('sabr', slice.expiry, fit.rmse));
|
|
957
|
+
} else {
|
|
958
|
+
warnings.push(insufficientWarning('sabr', 3, slice.expiry, slice.strikes.length));
|
|
959
|
+
}
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
return buildSmile(slice, cfg, this.referenceSpot);
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
/** The subset of options {@link buildSmile} needs to rebuild a slice's smile without re-fitting. */
|
|
966
|
+
private smileConfig(options: VolatilitySurfaceOptions): SmileConfig {
|
|
967
|
+
return {
|
|
968
|
+
model: this.model,
|
|
969
|
+
riskFreeRate: options.riskFreeRate,
|
|
970
|
+
dividendYield: options.dividendYield ?? 0,
|
|
971
|
+
sabrVolatilityType: options.sabrVolatilityType ?? 'lognormal',
|
|
972
|
+
cosineExpansionTerms: options.cosineExpansionTerms ?? 128,
|
|
973
|
+
...(options.smoothingBandwidth !== undefined
|
|
974
|
+
? { smoothingBandwidth: options.smoothingBandwidth }
|
|
975
|
+
: {}),
|
|
976
|
+
};
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
/** The {@link SmileConfig} for this surface's own stored (captured) config knobs. */
|
|
980
|
+
private ownSmileConfig(model: SurfaceModel = this.model): SmileConfig {
|
|
981
|
+
return {
|
|
982
|
+
model,
|
|
983
|
+
riskFreeRate: this.rate,
|
|
984
|
+
dividendYield: this.dividendYield,
|
|
985
|
+
sabrVolatilityType: this.sabrVolatilityType,
|
|
986
|
+
cosineExpansionTerms: this.cosineExpansionTerms,
|
|
987
|
+
...(this.smoothingBandwidth !== undefined
|
|
988
|
+
? { smoothingBandwidth: this.smoothingBandwidth }
|
|
989
|
+
: {}),
|
|
990
|
+
};
|
|
991
|
+
}
|
|
992
|
+
|
|
993
|
+
/** Run the static no-arbitrage diagnostics (calendar + butterfly) over this surface. */
|
|
994
|
+
arbitrage(options?: ArbitrageCheckOptions): ArbitrageReport {
|
|
995
|
+
return surfaceArbitrageReport(this, options);
|
|
996
|
+
}
|
|
997
|
+
|
|
998
|
+
private slot(input: string | number): number {
|
|
999
|
+
return typeof input === 'number' ? input : expiryToYears(this.assumptions.asOf!, input);
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
/** Sorted list of the surface's expiry labels. */
|
|
1003
|
+
expiries(): string[] {
|
|
1004
|
+
return this.slices.map((s) => s.expiry);
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
/** The smile at an expiry (exact label or nearest by `t`), or `undefined` if none. */
|
|
1008
|
+
slice(expiry: string | number): SurfaceSlice | undefined {
|
|
1009
|
+
if (typeof expiry === 'string') return this.slices.find((s) => s.expiry === expiry);
|
|
1010
|
+
let best: SurfaceSlice | undefined;
|
|
1011
|
+
let bestD = Infinity;
|
|
1012
|
+
for (const s of this.slices) {
|
|
1013
|
+
const d = Math.abs(s.timeToExpiryYears - expiry);
|
|
1014
|
+
if (d < bestD) {
|
|
1015
|
+
bestD = d;
|
|
1016
|
+
best = s;
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1019
|
+
return best;
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
/** Implied vol at `(strike, expiry)`. Throws if the surface is empty (never fabricates). */
|
|
1023
|
+
impliedVolatility(strike: number, expiry: string | number): number {
|
|
1024
|
+
return this.lookup(strike, expiry).value;
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
/**
|
|
1028
|
+
* Implied vol on the moneyness axis. `moneyness` is `K/S` (spot-moneyness) by default, or `K/F`
|
|
1029
|
+
* (forward-moneyness) when `forward` is set — so `impliedVolatilityByMoneyness(1, e)` is the at-the-money(-forward) vol.
|
|
1030
|
+
*
|
|
1031
|
+
* For a NUMERIC `expiry` (a maturity in years) the forward is computed AT THAT MATURITY,
|
|
1032
|
+
* `F(t) = spot·e^{(r−q)·t}` — not borrowed from the nearest fitted slice, which anchored a
|
|
1033
|
+
* mid-expiry query to a neighbour's forward and shifted the ATM-forward point off by the carry
|
|
1034
|
+
* between them.
|
|
1035
|
+
*/
|
|
1036
|
+
impliedVolatilityByMoneyness(
|
|
1037
|
+
moneyness: number,
|
|
1038
|
+
expiry: string | number,
|
|
1039
|
+
options: { forward?: boolean } = {},
|
|
1040
|
+
): number {
|
|
1041
|
+
if (!(moneyness > 0)) {
|
|
1042
|
+
throw new InputError(
|
|
1043
|
+
`VolatilitySurface.impliedVolatilityByMoneyness: moneyness must be > 0, got ${moneyness}.`,
|
|
1044
|
+
{
|
|
1045
|
+
code: ErrorCode.InputOutOfRange,
|
|
1046
|
+
context: { moneyness },
|
|
1047
|
+
},
|
|
1048
|
+
);
|
|
1049
|
+
}
|
|
1050
|
+
let ref: number;
|
|
1051
|
+
if (options.forward && typeof expiry === 'number') {
|
|
1052
|
+
// A numeric expiry is a maturity, not a label: the forward it asks about is the one at THAT t.
|
|
1053
|
+
// `slice(t)` returns the NEAREST slice, so the old code answered with that slice's forward —
|
|
1054
|
+
// e.g. a 6-month query on a 3m/1y surface got the 3m forward, an 8.8bp ATM error at r−q = 3.5%.
|
|
1055
|
+
if (!Number.isFinite(expiry) || expiry <= 0) {
|
|
1056
|
+
throw new InputError(
|
|
1057
|
+
`VolatilitySurface.impliedVolatilityByMoneyness: a numeric expiry is a maturity in years and must be positive and finite, got ${expiry}.`,
|
|
1058
|
+
{ code: ErrorCode.InputNegativeTime, context: { expiry } },
|
|
1059
|
+
);
|
|
1060
|
+
}
|
|
1061
|
+
ref = this.referenceSpot * Math.exp((this.rate - this.dividendYield) * expiry);
|
|
1062
|
+
} else if (options.forward) {
|
|
1063
|
+
// Forward-moneyness needs the slice's forward. If the expiry label resolves no slice, refuse —
|
|
1064
|
+
// never silently answer the SPOT-moneyness question with spotRef instead (design law #4).
|
|
1065
|
+
const slice = this.slice(expiry);
|
|
1066
|
+
if (!slice) {
|
|
1067
|
+
throw new InputError(
|
|
1068
|
+
`VolatilitySurface.impliedVolatilityByMoneyness: forward-moneyness requested for expiry ${String(
|
|
1069
|
+
expiry,
|
|
1070
|
+
)}, but ` +
|
|
1071
|
+
`no slice resolves a forward there; the surface cannot answer a forward-moneyness query.`,
|
|
1072
|
+
{ code: ErrorCode.VolatilityForwardUnavailable, context: { expiry } },
|
|
1073
|
+
);
|
|
1074
|
+
}
|
|
1075
|
+
ref = slice.forward;
|
|
1076
|
+
} else {
|
|
1077
|
+
ref = this.referenceSpot;
|
|
1078
|
+
}
|
|
1079
|
+
return this.impliedVolatility(moneyness * ref, expiry);
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
/**
|
|
1083
|
+
* Implied vol on the call-delta axis: interpolate the strike whose call-delta equals `callDelta`
|
|
1084
|
+
* (∈ (0, 1)) from the slice's stored delta ladder, then read the smile there. A 0.25 delta selects
|
|
1085
|
+
* the 25-delta call strike.
|
|
1086
|
+
*/
|
|
1087
|
+
impliedVolatilityByDelta(callDelta: number, expiry: string | number): number {
|
|
1088
|
+
if (!(callDelta > 0 && callDelta < 1)) {
|
|
1089
|
+
throw new InputError(
|
|
1090
|
+
`VolatilitySurface.impliedVolatilityByDelta: callDelta must be in (0, 1), got ${callDelta}.`,
|
|
1091
|
+
{
|
|
1092
|
+
code: ErrorCode.InputOutOfRange,
|
|
1093
|
+
context: { callDelta },
|
|
1094
|
+
},
|
|
1095
|
+
);
|
|
1096
|
+
}
|
|
1097
|
+
const s = this.slice(expiry);
|
|
1098
|
+
if (!s) {
|
|
1099
|
+
throw new InputError(
|
|
1100
|
+
`VolatilitySurface.impliedVolatilityByDelta: no slice for expiry ${String(expiry)}.`,
|
|
1101
|
+
{
|
|
1102
|
+
code: ErrorCode.InputOutOfRange,
|
|
1103
|
+
context: { expiry },
|
|
1104
|
+
},
|
|
1105
|
+
);
|
|
1106
|
+
}
|
|
1107
|
+
// `deltas` decrease as strike increases; find the bracketing pair and interpolate the strike.
|
|
1108
|
+
const d = s.deltas;
|
|
1109
|
+
const k = s.strikes;
|
|
1110
|
+
if (callDelta >= d[0]!) return this.impliedVolatility(k[0]!, expiry);
|
|
1111
|
+
if (callDelta <= d[d.length - 1]!) return this.impliedVolatility(k[k.length - 1]!, expiry);
|
|
1112
|
+
let hi = 1;
|
|
1113
|
+
while (hi < d.length && d[hi]! > callDelta) hi++;
|
|
1114
|
+
const lo = hi - 1;
|
|
1115
|
+
const frac = (d[lo]! - callDelta) / (d[lo]! - d[hi]!);
|
|
1116
|
+
const strike = k[lo]! + frac * (k[hi]! - k[lo]!);
|
|
1117
|
+
return this.impliedVolatility(strike, expiry);
|
|
1118
|
+
}
|
|
1119
|
+
|
|
1120
|
+
/**
|
|
1121
|
+
* Implied vol at `(strike, expiry)` with diagnostics. Strike uses the per-slice smile; expiry
|
|
1122
|
+
* interpolates total variance linearly between the two bracketing slices. `extrapolated` is true
|
|
1123
|
+
* when the query lies outside the fitted strike range or expiry range.
|
|
1124
|
+
*/
|
|
1125
|
+
lookup(strike: number, expiry: string | number): SurfaceLookup {
|
|
1126
|
+
// Reject impossible query coordinates before interpolating, so a NaN/negative query never
|
|
1127
|
+
// returns a value with `converged: true` (design law #4).
|
|
1128
|
+
if (!Number.isFinite(strike) || strike <= 0) {
|
|
1129
|
+
throw new InputError(
|
|
1130
|
+
`VolatilitySurface.lookup: strike must be a positive finite number, got ${strike}.`,
|
|
1131
|
+
{
|
|
1132
|
+
code: ErrorCode.InputNegativeStrike,
|
|
1133
|
+
context: { strike },
|
|
1134
|
+
},
|
|
1135
|
+
);
|
|
1136
|
+
}
|
|
1137
|
+
const T = this.slot(expiry);
|
|
1138
|
+
if (!Number.isFinite(T) || T <= 0) {
|
|
1139
|
+
throw new InputError(
|
|
1140
|
+
`VolatilitySurface.lookup: time-to-expiry must be positive and finite, got ${T} (from ${String(
|
|
1141
|
+
expiry,
|
|
1142
|
+
)}).`,
|
|
1143
|
+
{ code: ErrorCode.InputNegativeTime, context: { expiry, timeToExpiryYears: T } },
|
|
1144
|
+
);
|
|
1145
|
+
}
|
|
1146
|
+
const warnings: QuantWarning[] = [];
|
|
1147
|
+
const n = this.slices.length;
|
|
1148
|
+
|
|
1149
|
+
const strikeExtrapolated = (i: number): boolean => {
|
|
1150
|
+
const s = this.slices[i]!;
|
|
1151
|
+
return strike < s.strikes[0]! || strike > s.strikes[s.strikes.length - 1]!;
|
|
1152
|
+
};
|
|
1153
|
+
|
|
1154
|
+
let value: number;
|
|
1155
|
+
let extrapolated = false;
|
|
1156
|
+
|
|
1157
|
+
if (T <= this.slices[0]!.timeToExpiryYears) {
|
|
1158
|
+
value = this.interps[0]!(strike);
|
|
1159
|
+
extrapolated = T < this.slices[0]!.timeToExpiryYears || strikeExtrapolated(0);
|
|
1160
|
+
} else if (T >= this.slices[n - 1]!.timeToExpiryYears) {
|
|
1161
|
+
value = this.interps[n - 1]!(strike);
|
|
1162
|
+
extrapolated = T > this.slices[n - 1]!.timeToExpiryYears || strikeExtrapolated(n - 1);
|
|
1163
|
+
} else {
|
|
1164
|
+
let hi = 1;
|
|
1165
|
+
while (hi < n && this.slices[hi]!.timeToExpiryYears < T) hi++;
|
|
1166
|
+
const lo = hi - 1;
|
|
1167
|
+
const t0 = this.slices[lo]!.timeToExpiryYears;
|
|
1168
|
+
const t1 = this.slices[hi]!.timeToExpiryYears;
|
|
1169
|
+
const iv0 = this.interps[lo]!(strike);
|
|
1170
|
+
const iv1 = this.interps[hi]!(strike);
|
|
1171
|
+
// Linear interpolation in total variance w = σ²·t (calendar-arbitrage-friendly).
|
|
1172
|
+
const w0 = iv0 * iv0 * t0;
|
|
1173
|
+
const w1 = iv1 * iv1 * t1;
|
|
1174
|
+
const w = w0 + ((w1 - w0) * (T - t0)) / (t1 - t0);
|
|
1175
|
+
value = Math.sqrt(Math.max(0, w) / T);
|
|
1176
|
+
extrapolated = strikeExtrapolated(lo) || strikeExtrapolated(hi);
|
|
1177
|
+
}
|
|
1178
|
+
|
|
1179
|
+
if (extrapolated) {
|
|
1180
|
+
warnings.push({
|
|
1181
|
+
code: WarningCode.SurfaceExtrapolated,
|
|
1182
|
+
message: `Surface lookup at strike ${strike}, t=${T.toFixed(
|
|
1183
|
+
4,
|
|
1184
|
+
)} is extrapolated beyond the fitted data.`,
|
|
1185
|
+
severity: 'warn',
|
|
1186
|
+
context: { strike, timeToExpiryYears: T },
|
|
1187
|
+
});
|
|
1188
|
+
}
|
|
1189
|
+
|
|
1190
|
+
return {
|
|
1191
|
+
value,
|
|
1192
|
+
extrapolated,
|
|
1193
|
+
assumptions: this.assumptions,
|
|
1194
|
+
// Carry the surface-construction warnings (butterfly arbitrage, insufficient data, fit RMSE,
|
|
1195
|
+
// extrapolated slices) into every per-call diagnostic — a lookup on an arbitrageable slice must
|
|
1196
|
+
// not present as clean just because this particular query interpolated fine (design law #4).
|
|
1197
|
+
diagnostics: { ...this.diagnostics, warnings: [...this.diagnostics.warnings, ...warnings] },
|
|
1198
|
+
};
|
|
1199
|
+
}
|
|
1200
|
+
|
|
1201
|
+
/**
|
|
1202
|
+
* Return a NEW surface with a shifted vol structure, produced WITHOUT re-fitting: each stored IV
|
|
1203
|
+
* sample gains a `parallel` offset plus a `skewTilt · k` skew rotation (`k = ln(K/forward)`,
|
|
1204
|
+
* log-moneyness), the per-slice deltas are recomputed from the shifted IVs, and only the
|
|
1205
|
+
* interpolators are rebuilt. The shock is echoed in the new surface's `assumptions.shock`.
|
|
1206
|
+
*
|
|
1207
|
+
* `sticky`: `'strike'` (default) pins the tilt to each stored strike's own log-moneyness vs the slice
|
|
1208
|
+
* forward; `'moneyness'` lets the same additive shift travel with moneyness. Because the shift is
|
|
1209
|
+
* applied to the stored strike-indexed IV samples, both modes coincide at the stored strikes in this
|
|
1210
|
+
* eager v1 — the distinction only matters once a surface is re-anchored to a new spot/forward, which
|
|
1211
|
+
* this method does not do; the requested mode is recorded in `assumptions.shock.sticky` so a caller
|
|
1212
|
+
* that later re-anchors knows how the tilt was meant to travel.
|
|
1213
|
+
*
|
|
1214
|
+
* Parametric models (`svi`/`sabr`/`heston`) have no closed-form shock, so the current smile is SAMPLED
|
|
1215
|
+
* at each slice's stored strikes, those samples are shifted, and the result DEGRADES to
|
|
1216
|
+
* `'interpolated'` with a `volatility.shock_degraded_to_interpolated` `warn` — the parametric fit is not
|
|
1217
|
+
* re-fit. Non-parametric models (`raw`/`interpolated`/`smoothed`) are preserved.
|
|
1218
|
+
*/
|
|
1219
|
+
shock(
|
|
1220
|
+
shifts: { parallel?: number; skewTilt?: number },
|
|
1221
|
+
{ sticky = 'strike' }: { sticky?: 'strike' | 'moneyness' } = {},
|
|
1222
|
+
): VolatilitySurface {
|
|
1223
|
+
const parallel = shifts.parallel ?? 0;
|
|
1224
|
+
const skewTilt = shifts.skewTilt ?? 0;
|
|
1225
|
+
const parametric =
|
|
1226
|
+
this.model === 'svi' ||
|
|
1227
|
+
this.model === 'sabr' ||
|
|
1228
|
+
this.model === 'ssvi' ||
|
|
1229
|
+
this.model === 'essvi' ||
|
|
1230
|
+
this.model === 'heston';
|
|
1231
|
+
const newModel: SurfaceModel = parametric ? 'interpolated' : this.model;
|
|
1232
|
+
const SHOCK_VOL_FLOOR = 1e-6;
|
|
1233
|
+
let shockFloored = false;
|
|
1234
|
+
|
|
1235
|
+
const newSlices: SurfaceSlice[] = this.slices.map((s, si) => {
|
|
1236
|
+
const interp = this.interps[si]!;
|
|
1237
|
+
// Parametric: sample the fitted smile at the stored strikes; non-parametric: shift stored IVs.
|
|
1238
|
+
const impliedVolatilities = s.strikes.map((K, i) => {
|
|
1239
|
+
const base = parametric ? interp(K) : s.impliedVolatilities[i]!;
|
|
1240
|
+
const k = Math.log(K / s.forward);
|
|
1241
|
+
const shocked = base + parallel + skewTilt * k;
|
|
1242
|
+
// A large negative shift must not produce a non-positive/NaN vol silently — floor + flag it.
|
|
1243
|
+
if (!(shocked >= SHOCK_VOL_FLOOR)) {
|
|
1244
|
+
shockFloored = true;
|
|
1245
|
+
return SHOCK_VOL_FLOOR;
|
|
1246
|
+
}
|
|
1247
|
+
return shocked;
|
|
1248
|
+
});
|
|
1249
|
+
const deltas = s.strikes.map((K, i) =>
|
|
1250
|
+
callDelta({
|
|
1251
|
+
spot: this.referenceSpot,
|
|
1252
|
+
strike: K,
|
|
1253
|
+
timeToExpiryYears: s.timeToExpiryYears,
|
|
1254
|
+
riskFreeRate: this.rate,
|
|
1255
|
+
dividendYield: this.dividendYield,
|
|
1256
|
+
volatility: impliedVolatilities[i]!,
|
|
1257
|
+
}),
|
|
1258
|
+
);
|
|
1259
|
+
return {
|
|
1260
|
+
expiry: s.expiry,
|
|
1261
|
+
timeToExpiryYears: s.timeToExpiryYears,
|
|
1262
|
+
forward: s.forward,
|
|
1263
|
+
strikes: s.strikes.slice(),
|
|
1264
|
+
impliedVolatilities,
|
|
1265
|
+
deltas,
|
|
1266
|
+
};
|
|
1267
|
+
});
|
|
1268
|
+
|
|
1269
|
+
const warnings: QuantWarning[] = [...this.diagnostics.warnings];
|
|
1270
|
+
if (parametric) {
|
|
1271
|
+
warnings.push({
|
|
1272
|
+
code: WarningCode.VolatilityShockDegradedToInterpolated,
|
|
1273
|
+
message:
|
|
1274
|
+
`Shock applied to a parametric '${this.model}' surface: the smile was sampled at the stored ` +
|
|
1275
|
+
`strikes and shifted, and the shocked surface is 'interpolated' (the ${this.model.toUpperCase()} ` +
|
|
1276
|
+
`fit was not re-fit).`,
|
|
1277
|
+
severity: 'warn',
|
|
1278
|
+
context: { from: this.model, to: newModel, parallel, skewTilt, sticky },
|
|
1279
|
+
});
|
|
1280
|
+
}
|
|
1281
|
+
if (shockFloored) {
|
|
1282
|
+
warnings.push({
|
|
1283
|
+
code: WarningCode.VolatilityShockFloored,
|
|
1284
|
+
message: `The shock drove one or more implied volatilities to/below the ${SHOCK_VOL_FLOOR} floor; those points were clamped to the floor, not the requested shift.`,
|
|
1285
|
+
severity: 'warn',
|
|
1286
|
+
context: { volatilityFloor: SHOCK_VOL_FLOOR },
|
|
1287
|
+
});
|
|
1288
|
+
}
|
|
1289
|
+
|
|
1290
|
+
const cfg = this.ownSmileConfig(newModel);
|
|
1291
|
+
const interps = newSlices.map((s) => buildSmile(s, cfg, this.referenceSpot));
|
|
1292
|
+
|
|
1293
|
+
const diagnostics: Diagnostics = {
|
|
1294
|
+
...this.diagnostics,
|
|
1295
|
+
engine: 'vol-surface',
|
|
1296
|
+
method: methodFor(newModel, this.sabrBeta),
|
|
1297
|
+
warnings,
|
|
1298
|
+
};
|
|
1299
|
+
const assumptions: Assumptions<{ shock?: SurfaceShock }> = {
|
|
1300
|
+
...this.assumptions,
|
|
1301
|
+
model: `vol-surface:${newModel} (shocked)`,
|
|
1302
|
+
shock: { parallel, skewTilt, sticky },
|
|
1303
|
+
};
|
|
1304
|
+
|
|
1305
|
+
return VolatilitySurface.fromParts({
|
|
1306
|
+
model: newModel,
|
|
1307
|
+
slices: newSlices,
|
|
1308
|
+
points: this.points.map((p) => ({ ...p })),
|
|
1309
|
+
diagnostics,
|
|
1310
|
+
assumptions,
|
|
1311
|
+
interps,
|
|
1312
|
+
referenceSpot: this.referenceSpot,
|
|
1313
|
+
riskFreeRate: this.rate,
|
|
1314
|
+
dividendYield: this.dividendYield,
|
|
1315
|
+
sabrBeta: this.sabrBeta,
|
|
1316
|
+
sabrVolatilityType: this.sabrVolatilityType,
|
|
1317
|
+
cosineExpansionTerms: this.cosineExpansionTerms,
|
|
1318
|
+
...(this.smoothingBandwidth !== undefined
|
|
1319
|
+
? { smoothingBandwidth: this.smoothingBandwidth }
|
|
1320
|
+
: {}),
|
|
1321
|
+
});
|
|
1322
|
+
}
|
|
1323
|
+
|
|
1324
|
+
/**
|
|
1325
|
+
* The smile-chart / heatmap feed: one {@link SurfaceRow} per (slice, stored strike), with
|
|
1326
|
+
* `logMoneyness = ln(strike/forward)` and the stored `delta`/`iv`. Per the workspace missing-value
|
|
1327
|
+
* policy (WS2.12), any non-finite chart-facing numeric is emitted as `null` (never `NaN`, never
|
|
1328
|
+
* omitted).
|
|
1329
|
+
*/
|
|
1330
|
+
toRows(): SurfaceRow[] {
|
|
1331
|
+
const finiteOrNull = (x: number | undefined): number | null =>
|
|
1332
|
+
x !== undefined && Number.isFinite(x) ? x : null;
|
|
1333
|
+
const rows: SurfaceRow[] = [];
|
|
1334
|
+
for (const s of this.slices) {
|
|
1335
|
+
for (let i = 0; i < s.strikes.length; i++) {
|
|
1336
|
+
const strike = s.strikes[i]!;
|
|
1337
|
+
const lm = s.forward > 0 ? Math.log(strike / s.forward) : NaN;
|
|
1338
|
+
rows.push({
|
|
1339
|
+
expiry: s.expiry,
|
|
1340
|
+
strike,
|
|
1341
|
+
logMoneyness: finiteOrNull(lm),
|
|
1342
|
+
delta: finiteOrNull(s.deltas[i]),
|
|
1343
|
+
impliedVolatility: finiteOrNull(s.impliedVolatilities[i]),
|
|
1344
|
+
});
|
|
1345
|
+
}
|
|
1346
|
+
}
|
|
1347
|
+
return rows;
|
|
1348
|
+
}
|
|
1349
|
+
|
|
1350
|
+
/**
|
|
1351
|
+
* Serialize the surface to a plain, JSON-safe {@link VolatilitySurfaceSnapshot} (no closures). Restore it
|
|
1352
|
+
* with {@link VolatilitySurface.fromJSON}; the pair round-trips `iv()` identically on all six models.
|
|
1353
|
+
*/
|
|
1354
|
+
toJSON(): VolatilitySurfaceSnapshot {
|
|
1355
|
+
return {
|
|
1356
|
+
schemaVersion: SURFACE_SCHEMA_VERSION,
|
|
1357
|
+
model: this.model,
|
|
1358
|
+
// Deep-copy every mutable field so the snapshot is an INDEPENDENT value — mutating it (or the
|
|
1359
|
+
// live surface) afterwards never corrupts the other (WS4.4 / review: no shallow "live" snapshot).
|
|
1360
|
+
slices: this.slices.map(cloneSlice),
|
|
1361
|
+
points: this.points.map((p) => ({ ...p })),
|
|
1362
|
+
assumptions: cloneSurfaceAssumptions(this.assumptions),
|
|
1363
|
+
diagnostics: cloneDiagnostics(this.diagnostics),
|
|
1364
|
+
referenceSpot: this.referenceSpot,
|
|
1365
|
+
config: {
|
|
1366
|
+
riskFreeRate: this.rate,
|
|
1367
|
+
dividendYield: this.dividendYield,
|
|
1368
|
+
sabrBeta: this.sabrBeta,
|
|
1369
|
+
sabrVolatilityType: this.sabrVolatilityType,
|
|
1370
|
+
cosineExpansionTerms: this.cosineExpansionTerms,
|
|
1371
|
+
...(this.smoothingBandwidth !== undefined
|
|
1372
|
+
? { smoothingBandwidth: this.smoothingBandwidth }
|
|
1373
|
+
: {}),
|
|
1374
|
+
},
|
|
1375
|
+
...(this.ssvi !== undefined ? { ssvi: cloneSSVI(this.ssvi) } : {}),
|
|
1376
|
+
...(this.essvi !== undefined ? { essvi: cloneESSVI(this.essvi) } : {}),
|
|
1377
|
+
...(this.heston !== undefined ? { heston: { ...this.heston } } : {}),
|
|
1378
|
+
};
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
/**
|
|
1382
|
+
* Rebuild a surface from a {@link VolatilitySurfaceSnapshot}. Rejects a `schemaVersion` mismatch (design law
|
|
1383
|
+
* #4: never silently restore state a different build wrote). Interpolators are rebuilt via
|
|
1384
|
+
* {@link buildSmile} from the stored slice parameters — never re-fitted — so the restored surface answers
|
|
1385
|
+
* `iv()` identically to the one that produced the snapshot.
|
|
1386
|
+
*/
|
|
1387
|
+
static fromJSON(snapshot: VolatilitySurfaceSnapshot): VolatilitySurface {
|
|
1388
|
+
if (snapshot.schemaVersion !== SURFACE_SCHEMA_VERSION) {
|
|
1389
|
+
throw new InputError(
|
|
1390
|
+
`VolatilitySurface.fromJSON: snapshot schemaVersion "${String(
|
|
1391
|
+
snapshot.schemaVersion,
|
|
1392
|
+
)}" does not ` +
|
|
1393
|
+
`match this build's "${SURFACE_SCHEMA_VERSION}"; the surface cannot be safely restored.`,
|
|
1394
|
+
{
|
|
1395
|
+
code: ErrorCode.VolatilitySnapshotVersionMismatch,
|
|
1396
|
+
context: { got: snapshot.schemaVersion, supported: SURFACE_SCHEMA_VERSION },
|
|
1397
|
+
},
|
|
1398
|
+
);
|
|
1399
|
+
}
|
|
1400
|
+
const cfg = snapshot.config;
|
|
1401
|
+
// Deep-copy so the rebuilt surface owns its own state and is not live-linked to the caller's snapshot.
|
|
1402
|
+
const slices: SurfaceSlice[] = snapshot.slices.map(cloneSlice);
|
|
1403
|
+
const smileCfg: SmileConfig = {
|
|
1404
|
+
model: snapshot.model,
|
|
1405
|
+
riskFreeRate: cfg.riskFreeRate,
|
|
1406
|
+
dividendYield: cfg.dividendYield,
|
|
1407
|
+
sabrVolatilityType: cfg.sabrVolatilityType,
|
|
1408
|
+
cosineExpansionTerms: cfg.cosineExpansionTerms,
|
|
1409
|
+
...(cfg.smoothingBandwidth !== undefined
|
|
1410
|
+
? { smoothingBandwidth: cfg.smoothingBandwidth }
|
|
1411
|
+
: {}),
|
|
1412
|
+
};
|
|
1413
|
+
const interps = slices.map((s) => buildSmile(s, smileCfg, snapshot.referenceSpot));
|
|
1414
|
+
return VolatilitySurface.fromParts({
|
|
1415
|
+
model: snapshot.model,
|
|
1416
|
+
slices,
|
|
1417
|
+
points: snapshot.points.map((p) => ({ ...p })),
|
|
1418
|
+
diagnostics: cloneDiagnostics(snapshot.diagnostics),
|
|
1419
|
+
assumptions: cloneSurfaceAssumptions(snapshot.assumptions),
|
|
1420
|
+
interps,
|
|
1421
|
+
referenceSpot: snapshot.referenceSpot,
|
|
1422
|
+
riskFreeRate: cfg.riskFreeRate,
|
|
1423
|
+
dividendYield: cfg.dividendYield,
|
|
1424
|
+
sabrBeta: cfg.sabrBeta,
|
|
1425
|
+
sabrVolatilityType: cfg.sabrVolatilityType,
|
|
1426
|
+
cosineExpansionTerms: cfg.cosineExpansionTerms,
|
|
1427
|
+
...(snapshot.ssvi !== undefined ? { ssvi: cloneSSVI(snapshot.ssvi) } : {}),
|
|
1428
|
+
...(snapshot.essvi !== undefined ? { essvi: cloneESSVI(snapshot.essvi) } : {}),
|
|
1429
|
+
...(snapshot.heston !== undefined ? { heston: { ...snapshot.heston } } : {}),
|
|
1430
|
+
...(cfg.smoothingBandwidth !== undefined
|
|
1431
|
+
? { smoothingBandwidth: cfg.smoothingBandwidth }
|
|
1432
|
+
: {}),
|
|
1433
|
+
});
|
|
1434
|
+
}
|
|
1435
|
+
|
|
1436
|
+
/**
|
|
1437
|
+
* Construct a surface from already-built parts, bypassing quote-solving. Used by {@link shock} and
|
|
1438
|
+
* {@link fromJSON}: the readonly fields are set on a bare instance so `iv()`/`lookup()` behave exactly
|
|
1439
|
+
* as a constructor-built surface would.
|
|
1440
|
+
*/
|
|
1441
|
+
private static fromParts(parts: {
|
|
1442
|
+
model: SurfaceModel;
|
|
1443
|
+
slices: SurfaceSlice[];
|
|
1444
|
+
points: SurfacePoint[];
|
|
1445
|
+
diagnostics: Diagnostics;
|
|
1446
|
+
assumptions: Assumptions<{ shock?: SurfaceShock }>;
|
|
1447
|
+
ssvi?: SSVIParameters;
|
|
1448
|
+
essvi?: ESSVIParameters;
|
|
1449
|
+
heston?: HestonParameters;
|
|
1450
|
+
interps: Array<(x: number) => number>;
|
|
1451
|
+
referenceSpot: number;
|
|
1452
|
+
riskFreeRate: number;
|
|
1453
|
+
dividendYield: number;
|
|
1454
|
+
sabrBeta: number;
|
|
1455
|
+
sabrVolatilityType: SabrVolatilityType;
|
|
1456
|
+
smoothingBandwidth?: number;
|
|
1457
|
+
cosineExpansionTerms: number;
|
|
1458
|
+
}): VolatilitySurface {
|
|
1459
|
+
// Set the readonly fields on a bare instance via `Object.assign` (constructors are the only place
|
|
1460
|
+
// TS lets you write readonly props directly; a rebuilt surface must skip quote-solving).
|
|
1461
|
+
const surf = Object.create(VolatilitySurface.prototype) as VolatilitySurface;
|
|
1462
|
+
Object.assign(surf, {
|
|
1463
|
+
model: parts.model,
|
|
1464
|
+
slices: parts.slices,
|
|
1465
|
+
points: parts.points,
|
|
1466
|
+
diagnostics: parts.diagnostics,
|
|
1467
|
+
assumptions: parts.assumptions,
|
|
1468
|
+
interps: parts.interps,
|
|
1469
|
+
referenceSpot: parts.referenceSpot,
|
|
1470
|
+
rate: parts.riskFreeRate,
|
|
1471
|
+
dividendYield: parts.dividendYield,
|
|
1472
|
+
sabrBeta: parts.sabrBeta,
|
|
1473
|
+
sabrVolatilityType: parts.sabrVolatilityType,
|
|
1474
|
+
cosineExpansionTerms: parts.cosineExpansionTerms,
|
|
1475
|
+
...(parts.ssvi !== undefined ? { ssvi: parts.ssvi } : {}),
|
|
1476
|
+
...(parts.essvi !== undefined ? { essvi: parts.essvi } : {}),
|
|
1477
|
+
...(parts.heston !== undefined ? { heston: parts.heston } : {}),
|
|
1478
|
+
...(parts.smoothingBandwidth !== undefined
|
|
1479
|
+
? { smoothingBandwidth: parts.smoothingBandwidth }
|
|
1480
|
+
: {}),
|
|
1481
|
+
});
|
|
1482
|
+
return surf;
|
|
1483
|
+
}
|
|
1484
|
+
}
|
|
1485
|
+
|
|
1486
|
+
/** Fit an implied-volatility surface from an option chain. */
|
|
1487
|
+
const VOLATILITY_SURFACE_SPEC: ClosedRequestSpecification = (() => {
|
|
1488
|
+
const spec = VALIDATION_SPECS['volatilitySurface#0'];
|
|
1489
|
+
if (spec === undefined)
|
|
1490
|
+
throw new Error('surface: missing generated spec — run `pnpm validation:update`');
|
|
1491
|
+
return spec;
|
|
1492
|
+
})();
|
|
1493
|
+
|
|
1494
|
+
export function volatilitySurface(input: VolatilitySurfaceInput): VolatilitySurface {
|
|
1495
|
+
validateClosedRequest('volatilitySurface', input, VOLATILITY_SURFACE_SPEC, {
|
|
1496
|
+
exampleCall: 'volatilitySurface({ referenceDate, slices })',
|
|
1497
|
+
});
|
|
1498
|
+
return new VolatilitySurface(input);
|
|
1499
|
+
}
|