@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,1514 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bonds (spec §14.1): fixed-rate, zero-coupon, floating-rate notes, amortizing, and inflation-linked
|
|
3
|
+
* instruments, with the full analytics suite — clean/dirty price, accrued interest, yield to maturity
|
|
4
|
+
* and to call, Macaulay / modified / effective / key-rate duration, convexity, and DV01/PV01.
|
|
5
|
+
*
|
|
6
|
+
* Yield-based metrics use the actuarial ("true yield") convention: a cash flow at year fraction τ from
|
|
7
|
+
* settlement (under the bond's day count) is discounted by `(1 + y/f)^(−f·τ)`, where `f` is the bond's
|
|
8
|
+
* coupon frequency. This is unambiguous, handles stub periods and zero-coupons uniformly, and yields
|
|
9
|
+
* clean closed-form duration/convexity. Curve-based metrics (effective/key-rate duration) reprice
|
|
10
|
+
* against a {@link YieldCurve} and its shocks. Floating and inflation coupons are *projected* from the
|
|
11
|
+
* supplied curve/index, then valued — bad or missing projection inputs throw (no silent degradation).
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import {
|
|
15
|
+
requireFiniteFields,
|
|
16
|
+
type Assumptions,
|
|
17
|
+
CONVENTIONS_VERSION,
|
|
18
|
+
type Computed,
|
|
19
|
+
ConvergenceError,
|
|
20
|
+
type Diagnostics,
|
|
21
|
+
ErrorCode,
|
|
22
|
+
InputError,
|
|
23
|
+
type ClosedRequestSpecification,
|
|
24
|
+
type QuantWarning,
|
|
25
|
+
ensureKnownKeys,
|
|
26
|
+
requireArgumentObject,
|
|
27
|
+
seriesFacade,
|
|
28
|
+
validateClosedRequest,
|
|
29
|
+
warning,
|
|
30
|
+
} from '@totalfinance/core';
|
|
31
|
+
import { brent } from '@totalfinance/math';
|
|
32
|
+
import { FIELD_HINTS, specificationExampleCall } from './validate.js';
|
|
33
|
+
import { VALIDATION_SPECS } from './generated/validation-specs.js';
|
|
34
|
+
import {
|
|
35
|
+
type BusinessDayConvention,
|
|
36
|
+
type FixedIncomeDayCount,
|
|
37
|
+
type Frequency,
|
|
38
|
+
type SchedulePeriod,
|
|
39
|
+
compareDates,
|
|
40
|
+
generateSchedule,
|
|
41
|
+
paymentsPerYear,
|
|
42
|
+
yearFraction,
|
|
43
|
+
} from './conventions.js';
|
|
44
|
+
import type { YieldCurve } from './curves.js';
|
|
45
|
+
|
|
46
|
+
// ---------------------------------------------------------------------------------------------------
|
|
47
|
+
// Cash flows
|
|
48
|
+
// ---------------------------------------------------------------------------------------------------
|
|
49
|
+
|
|
50
|
+
export interface CashFlow {
|
|
51
|
+
/** Regular (unadjusted) schedule date — used for accrual, time-to-cashflow, and yield discounting. */
|
|
52
|
+
date: string;
|
|
53
|
+
/** Business-day-adjusted payment date — used for curve discounting. */
|
|
54
|
+
paymentDate: string;
|
|
55
|
+
/** Total payment (interest + principal). */
|
|
56
|
+
amount: number;
|
|
57
|
+
/** Coupon/interest portion. */
|
|
58
|
+
interest: number;
|
|
59
|
+
/** Principal (redemption/amortization) portion. */
|
|
60
|
+
principal: number;
|
|
61
|
+
/** Outstanding notional accruing over the period that produced this flow. */
|
|
62
|
+
notional: number;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** Projection inputs for instruments whose coupons are not fixed at issuance. */
|
|
66
|
+
export interface ProjectionContext {
|
|
67
|
+
/** Forecast curve for projecting floating-rate coupons. */
|
|
68
|
+
forecastCurve?: YieldCurve;
|
|
69
|
+
/** Price-index level at a date, for inflation-linked indexation. */
|
|
70
|
+
referenceIndex?: (date: string) => number;
|
|
71
|
+
/**
|
|
72
|
+
* The index fixing (decimal, e.g. `0.0532` for 5.32%) that ALREADY SET the coupon currently
|
|
73
|
+
* accruing on a floating-rate note — the one whose accrual period began before the forecast
|
|
74
|
+
* curve's reference date.
|
|
75
|
+
*
|
|
76
|
+
* A settled-mid-period FRN has one coupon that is no longer a projection: it was fixed in the
|
|
77
|
+
* past, on a date the curve does not reach. Asking the curve for it is a query before its
|
|
78
|
+
* reference date, which throws. Supply the observed fixing (SOFR/EURIBOR print for that reset)
|
|
79
|
+
* and it is used verbatim for that one coupon; every later coupon still projects off the curve.
|
|
80
|
+
* The note's quoted `spread` is added on top, exactly as for a projected coupon.
|
|
81
|
+
*
|
|
82
|
+
* Only the in-progress coupon is substituted. Coupons that both began AND ended before the
|
|
83
|
+
* curve's reference date are settled history, not projections — one fixing cannot honestly stand
|
|
84
|
+
* in for a whole strip of past resets, so those are rejected rather than fabricated.
|
|
85
|
+
*/
|
|
86
|
+
knownFixingRate?: number;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export type BondKind = 'fixed' | 'zero' | 'frn' | 'amortizing' | 'inflation';
|
|
90
|
+
|
|
91
|
+
/** Amortization style for an amortizing bond. */
|
|
92
|
+
export type Amortization =
|
|
93
|
+
| { type: 'straight' } // equal principal each period
|
|
94
|
+
| { type: 'annuity' } // level total payment (principal + interest)
|
|
95
|
+
| { principalByPeriod: readonly number[] }; // explicit principal repayments, one per coupon period
|
|
96
|
+
|
|
97
|
+
/** The fields every bond specification shares — the base the per-kind specifications extend. */
|
|
98
|
+
export interface BaseSpecification {
|
|
99
|
+
/** Dated date / first accrual date. */
|
|
100
|
+
issueDate: string;
|
|
101
|
+
maturityDate: string;
|
|
102
|
+
/** Annualized coupon rate (decimal). */
|
|
103
|
+
couponRate: number;
|
|
104
|
+
frequency: Frequency;
|
|
105
|
+
/** Redemption / par value. Default 100. */
|
|
106
|
+
faceValue?: number;
|
|
107
|
+
/** Accrual day count. Default `30/360`. */
|
|
108
|
+
dayCount?: FixedIncomeDayCount;
|
|
109
|
+
convention?: BusinessDayConvention;
|
|
110
|
+
endOfMonth?: boolean;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/** A constructed bond: schedule, cash flows, and settlement-relative helpers. */
|
|
114
|
+
export interface Bond {
|
|
115
|
+
readonly kind: BondKind;
|
|
116
|
+
readonly faceValue: number;
|
|
117
|
+
readonly issueDate: string;
|
|
118
|
+
readonly maturityDate: string;
|
|
119
|
+
readonly couponRate: number;
|
|
120
|
+
readonly frequency: number;
|
|
121
|
+
readonly dayCount: FixedIncomeDayCount;
|
|
122
|
+
/** Business-day convention applied when the payment schedule was generated. */
|
|
123
|
+
readonly businessDayConvention: BusinessDayConvention;
|
|
124
|
+
readonly schedule: readonly SchedulePeriod[];
|
|
125
|
+
/** Every life cash flow (projected via `context` for FRN/inflation). */
|
|
126
|
+
cashflows(context?: ProjectionContext): CashFlow[];
|
|
127
|
+
/** Cash flows strictly after `settlementDate` — what a buyer settling then receives. */
|
|
128
|
+
futureCashflows(settlementDate: string, context?: ProjectionContext): CashFlow[];
|
|
129
|
+
/** Accrued interest at `settlementDate` (per the bond's face value). */
|
|
130
|
+
accrued(settlementDate: string, context?: ProjectionContext): number;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function faceOf(specification: { faceValue?: number }): number {
|
|
134
|
+
const f = specification.faceValue ?? 100;
|
|
135
|
+
if (!Number.isFinite(f) || f <= 0) {
|
|
136
|
+
throw new InputError(`faceOf: faceValue must be a positive number (got ${f}).`, {
|
|
137
|
+
code: ErrorCode.InputOutOfRange,
|
|
138
|
+
context: { field: 'faceValue', value: f },
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
return f;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Generated closed-request specs (spec 3B.1b): allowlists projected from the declarations —
|
|
146
|
+
* including the `Amortization` union, whose branch resolution is the shared validator's
|
|
147
|
+
* discriminant-first path. Resolved at module load so a stale key fails at import.
|
|
148
|
+
*/
|
|
149
|
+
function specOf(key: string): ClosedRequestSpecification {
|
|
150
|
+
const spec = VALIDATION_SPECS[key];
|
|
151
|
+
if (spec === undefined) {
|
|
152
|
+
throw new Error(
|
|
153
|
+
`bonds: no generated validation spec for '${key}' — run \`pnpm validation:update\``,
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
return spec;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
const FIXED_RATE_SPEC = specOf('bonds.fixedRate#0');
|
|
160
|
+
const ZERO_COUPON_SPEC = specOf('bonds.zeroCoupon#0');
|
|
161
|
+
const FRN_SPEC = specOf('bonds.floatingRateNote#0');
|
|
162
|
+
const AMORTIZING_SPEC = specOf('bonds.amortizing#0');
|
|
163
|
+
const INFLATION_LINKED_SPEC = specOf('bonds.inflationLinked#0');
|
|
164
|
+
const BOND_CONTEXT_SPEC = specOf('Bond#cashflows#0');
|
|
165
|
+
const PRICE_MULTI_CURVE_BOND_SPEC = specOf('priceMultiCurve#0');
|
|
166
|
+
const PRICE_MULTI_CURVE_OPTIONS_SPEC = specOf('priceMultiCurve#1');
|
|
167
|
+
const YIELD_TO_CALL_BOND_SPEC = specOf('yieldToCall#0');
|
|
168
|
+
const YIELD_TO_CALL_CALL_SPEC = specOf('yieldToCall#1');
|
|
169
|
+
const YIELD_TO_CALL_OPTIONS_SPEC = specOf('yieldToCall#2');
|
|
170
|
+
|
|
171
|
+
const ANALYTICS_EXAMPLE = (): string =>
|
|
172
|
+
"yieldToCall(bond, { callDate: '2028-01-15', callPrice: 102 }, { price: 98.5, settlementDate: '2026-06-15' })";
|
|
173
|
+
|
|
174
|
+
/** The bespoke bond teaching, unchanged from `requireSpecification`: derived example + unit hints. */
|
|
175
|
+
function specificationTeaching(functionName: string, required: readonly string[]) {
|
|
176
|
+
return {
|
|
177
|
+
argumentName: 'specification',
|
|
178
|
+
subject: true,
|
|
179
|
+
exampleCall: () => specificationExampleCall(functionName, required),
|
|
180
|
+
hints: FIELD_HINTS,
|
|
181
|
+
} as const;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
const CONTEXT_TEACHING = {
|
|
185
|
+
argumentName: 'context',
|
|
186
|
+
exampleCall: "bond.futureCashflows('2026-06-15', { forecastCurve, knownFixingRate: 0.0532 })",
|
|
187
|
+
} as const;
|
|
188
|
+
|
|
189
|
+
function buildSchedule(specification: BaseSpecification): SchedulePeriod[] {
|
|
190
|
+
return generateSchedule({
|
|
191
|
+
effectiveDate: specification.issueDate,
|
|
192
|
+
maturityDate: specification.maturityDate,
|
|
193
|
+
frequency: specification.frequency,
|
|
194
|
+
...(specification.convention !== undefined ? { convention: specification.convention } : {}),
|
|
195
|
+
...(specification.endOfMonth !== undefined ? { endOfMonth: specification.endOfMonth } : {}),
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/** Assemble the shared `Bond` shell from a precomputed cash-flow generator. */
|
|
200
|
+
function makeBond(
|
|
201
|
+
kind: BondKind,
|
|
202
|
+
specification: BaseSpecification,
|
|
203
|
+
schedule: SchedulePeriod[],
|
|
204
|
+
flowsFor: (context: ProjectionContext) => CashFlow[],
|
|
205
|
+
): Bond {
|
|
206
|
+
const face = faceOf(specification);
|
|
207
|
+
const dayCount = specification.dayCount ?? '30/360';
|
|
208
|
+
const frequency = paymentsPerYear(specification.frequency);
|
|
209
|
+
|
|
210
|
+
const accrued = (settlementDate: string, context: ProjectionContext = {}): number => {
|
|
211
|
+
validateClosedRequest('bond.accrued', context, BOND_CONTEXT_SPEC, CONTEXT_TEACHING);
|
|
212
|
+
const period = schedule.find(
|
|
213
|
+
(p) =>
|
|
214
|
+
compareDates(p.accrualStart, settlementDate) <= 0 &&
|
|
215
|
+
compareDates(settlementDate, p.accrualEnd) < 0,
|
|
216
|
+
);
|
|
217
|
+
if (!period) return 0; // before issue or on/after maturity
|
|
218
|
+
const full = yearFraction(period.accrualStart, period.accrualEnd, dayCount);
|
|
219
|
+
const partial = yearFraction(period.accrualStart, settlementDate, dayCount);
|
|
220
|
+
const frac = full === 0 ? 0 : partial / full;
|
|
221
|
+
// The interest the *current* period will pay, scaled by the elapsed fraction.
|
|
222
|
+
const flow = flowsFor(context).find((f) => f.date === period.accrualEnd);
|
|
223
|
+
return flow ? flow.interest * frac : 0;
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
return {
|
|
227
|
+
kind,
|
|
228
|
+
faceValue: face,
|
|
229
|
+
issueDate: specification.issueDate,
|
|
230
|
+
maturityDate: specification.maturityDate,
|
|
231
|
+
couponRate: specification.couponRate,
|
|
232
|
+
frequency,
|
|
233
|
+
dayCount,
|
|
234
|
+
// Mirrors the default in `generateSchedule` (buildSchedule omits it when spec.convention is unset).
|
|
235
|
+
businessDayConvention: specification.convention ?? 'modifiedFollowing',
|
|
236
|
+
schedule,
|
|
237
|
+
cashflows: (context = {}) => {
|
|
238
|
+
validateClosedRequest('bond.cashflows', context, BOND_CONTEXT_SPEC, CONTEXT_TEACHING);
|
|
239
|
+
return flowsFor(context);
|
|
240
|
+
},
|
|
241
|
+
futureCashflows: (settlementDate, context = {}) => {
|
|
242
|
+
validateClosedRequest('bond.futureCashflows', context, BOND_CONTEXT_SPEC, CONTEXT_TEACHING);
|
|
243
|
+
return flowsFor(context).filter((f) => compareDates(f.date, settlementDate) > 0);
|
|
244
|
+
},
|
|
245
|
+
accrued,
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
// ---------------------------------------------------------------------------------------------------
|
|
250
|
+
// Bond constructors
|
|
251
|
+
// ---------------------------------------------------------------------------------------------------
|
|
252
|
+
|
|
253
|
+
export type FixedRateBondSpecification = BaseSpecification;
|
|
254
|
+
|
|
255
|
+
function fixedRate(specification: FixedRateBondSpecification): Bond {
|
|
256
|
+
validateClosedRequest(
|
|
257
|
+
'bonds.fixedRate',
|
|
258
|
+
specification,
|
|
259
|
+
FIXED_RATE_SPEC,
|
|
260
|
+
specificationTeaching('bonds.fixedRate', [
|
|
261
|
+
'issueDate',
|
|
262
|
+
'maturityDate',
|
|
263
|
+
'couponRate',
|
|
264
|
+
'frequency',
|
|
265
|
+
]),
|
|
266
|
+
);
|
|
267
|
+
const face = faceOf(specification);
|
|
268
|
+
const dayCount = specification.dayCount ?? '30/360';
|
|
269
|
+
const schedule = buildSchedule(specification);
|
|
270
|
+
const last = schedule.length - 1;
|
|
271
|
+
const flowsFor = (): CashFlow[] =>
|
|
272
|
+
schedule.map((p, i) => {
|
|
273
|
+
const interest =
|
|
274
|
+
specification.couponRate * face * yearFraction(p.accrualStart, p.accrualEnd, dayCount);
|
|
275
|
+
const principal = i === last ? face : 0;
|
|
276
|
+
return {
|
|
277
|
+
date: p.accrualEnd,
|
|
278
|
+
paymentDate: p.paymentDate,
|
|
279
|
+
interest,
|
|
280
|
+
principal,
|
|
281
|
+
amount: interest + principal,
|
|
282
|
+
notional: face,
|
|
283
|
+
};
|
|
284
|
+
});
|
|
285
|
+
return makeBond('fixed', specification, schedule, flowsFor);
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
export interface ZeroCouponBondSpecification {
|
|
289
|
+
issueDate: string;
|
|
290
|
+
maturityDate: string;
|
|
291
|
+
faceValue?: number;
|
|
292
|
+
dayCount?: FixedIncomeDayCount;
|
|
293
|
+
/** Yield compounding frequency for analytics. Default 1 (annual). */
|
|
294
|
+
frequency?: Frequency;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
function zeroCoupon(specification: ZeroCouponBondSpecification): Bond {
|
|
298
|
+
validateClosedRequest(
|
|
299
|
+
'bonds.zeroCoupon',
|
|
300
|
+
specification,
|
|
301
|
+
ZERO_COUPON_SPEC,
|
|
302
|
+
specificationTeaching('bonds.zeroCoupon', ['issueDate', 'maturityDate']),
|
|
303
|
+
);
|
|
304
|
+
const face = faceOf(specification);
|
|
305
|
+
const base: BaseSpecification = {
|
|
306
|
+
issueDate: specification.issueDate,
|
|
307
|
+
maturityDate: specification.maturityDate,
|
|
308
|
+
couponRate: 0,
|
|
309
|
+
frequency: specification.frequency ?? 'annual',
|
|
310
|
+
...(specification.faceValue !== undefined ? { faceValue: specification.faceValue } : {}),
|
|
311
|
+
...(specification.dayCount !== undefined ? { dayCount: specification.dayCount } : {}),
|
|
312
|
+
};
|
|
313
|
+
// A single redemption flow at maturity — no coupon schedule.
|
|
314
|
+
const schedule: SchedulePeriod[] = [
|
|
315
|
+
{
|
|
316
|
+
accrualStart: specification.issueDate,
|
|
317
|
+
accrualEnd: specification.maturityDate,
|
|
318
|
+
paymentDate: specification.maturityDate,
|
|
319
|
+
isStub: false,
|
|
320
|
+
},
|
|
321
|
+
];
|
|
322
|
+
const flowsFor = (): CashFlow[] => [
|
|
323
|
+
{
|
|
324
|
+
date: specification.maturityDate,
|
|
325
|
+
paymentDate: specification.maturityDate,
|
|
326
|
+
interest: 0,
|
|
327
|
+
principal: face,
|
|
328
|
+
amount: face,
|
|
329
|
+
notional: face,
|
|
330
|
+
},
|
|
331
|
+
];
|
|
332
|
+
return makeBond('zero', base, schedule, flowsFor);
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
export interface FloatingRateNoteSpecification extends BaseSpecification {
|
|
336
|
+
/** Quoted margin over the projected index (decimal), e.g. 0.0025 = 25bp. Default 0. */
|
|
337
|
+
spread?: number;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* Resolve the index rate for ONE floating coupon: the curve's forward when the reset is still in
|
|
342
|
+
* the future, the caller's observed fixing when the reset already happened.
|
|
343
|
+
*
|
|
344
|
+
* A forecast curve begins at its reference date, so `curve.forwardRate` over a period that STARTED
|
|
345
|
+
* before it is a query before t = 0 and throws `Curve query before reference date (t=−0.08)`. That
|
|
346
|
+
* is the correct refusal from the curve and a useless message from the FRN: settling any FRN
|
|
347
|
+
* between two coupon dates hits it, and nothing in the error names the missing input. The in-progress
|
|
348
|
+
* coupon is not a projection at all — it was fixed on a past reset date — so the caller supplies it
|
|
349
|
+
* via {@link ProjectionContext.knownFixingRate}.
|
|
350
|
+
*/
|
|
351
|
+
function projectFrnRate(
|
|
352
|
+
period: SchedulePeriod,
|
|
353
|
+
curve: YieldCurve,
|
|
354
|
+
dayCount: FixedIncomeDayCount,
|
|
355
|
+
context: ProjectionContext,
|
|
356
|
+
): number {
|
|
357
|
+
if (compareDates(period.accrualStart, curve.referenceDate) >= 0) {
|
|
358
|
+
return curve.forwardRate(period.accrualStart, period.accrualEnd, dayCount);
|
|
359
|
+
}
|
|
360
|
+
// The reset predates the curve. Only a coupon still ACCRUING at the reference date is a single,
|
|
361
|
+
// nameable fixing; a coupon that also ENDED before it is settled history.
|
|
362
|
+
if (compareDates(period.accrualEnd, curve.referenceDate) <= 0) {
|
|
363
|
+
throw new InputError(
|
|
364
|
+
`projectFrnRate: A floating-rate note coupon accruing ${period.accrualStart} → ${period.accrualEnd} ended before ` +
|
|
365
|
+
`the forecast curve's reference date (${curve.referenceDate}): it was set by a historical ` +
|
|
366
|
+
'index print, which a forward curve cannot supply, and one fixing cannot stand in for a strip ' +
|
|
367
|
+
'of past resets. Build the note from the coupon period in progress (issueDate = the last ' +
|
|
368
|
+
'reset date) and pass that reset via context.knownFixingRate, or use a forecast curve whose ' +
|
|
369
|
+
"referenceDate is on or before the note's issueDate.",
|
|
370
|
+
{
|
|
371
|
+
code: ErrorCode.InputOutOfRange,
|
|
372
|
+
context: {
|
|
373
|
+
kind: 'frn',
|
|
374
|
+
accrualStart: period.accrualStart,
|
|
375
|
+
accrualEnd: period.accrualEnd,
|
|
376
|
+
curveReferenceDate: curve.referenceDate,
|
|
377
|
+
},
|
|
378
|
+
},
|
|
379
|
+
);
|
|
380
|
+
}
|
|
381
|
+
const fixing = context.knownFixingRate;
|
|
382
|
+
if (fixing === undefined) {
|
|
383
|
+
throw new InputError(
|
|
384
|
+
`projectFrnRate: A floating-rate note settling mid-period needs context.knownFixingRate: the coupon accruing ` +
|
|
385
|
+
`${period.accrualStart} → ${period.accrualEnd} was FIXED on ${period.accrualStart}, before the ` +
|
|
386
|
+
`forecast curve's reference date (${curve.referenceDate}), so the curve cannot project it. ` +
|
|
387
|
+
'Pass the observed index fixing for that reset (a decimal, e.g. 0.0532 for 5.32%).\n' +
|
|
388
|
+
' e.g. priceMultiCurve(frn, { settlementDate, discountCurve, forecastCurve }) with\n' +
|
|
389
|
+
' frn.cashflows({ forecastCurve, knownFixingRate: 0.0532 })',
|
|
390
|
+
{
|
|
391
|
+
code: ErrorCode.InputMissingField,
|
|
392
|
+
context: {
|
|
393
|
+
kind: 'frn',
|
|
394
|
+
field: 'knownFixingRate',
|
|
395
|
+
accrualStart: period.accrualStart,
|
|
396
|
+
accrualEnd: period.accrualEnd,
|
|
397
|
+
curveReferenceDate: curve.referenceDate,
|
|
398
|
+
},
|
|
399
|
+
},
|
|
400
|
+
);
|
|
401
|
+
}
|
|
402
|
+
if (!Number.isFinite(fixing)) {
|
|
403
|
+
throw new InputError(`context.knownFixingRate must be a finite decimal rate (got ${fixing}).`, {
|
|
404
|
+
code: ErrorCode.InputNotFinite,
|
|
405
|
+
context: { field: 'knownFixingRate', value: fixing },
|
|
406
|
+
});
|
|
407
|
+
}
|
|
408
|
+
return fixing;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
function floatingRateNote(specification: FloatingRateNoteSpecification): Bond {
|
|
412
|
+
validateClosedRequest(
|
|
413
|
+
'bonds.floatingRateNote',
|
|
414
|
+
specification,
|
|
415
|
+
FRN_SPEC,
|
|
416
|
+
specificationTeaching('bonds.floatingRateNote', ['issueDate', 'maturityDate', 'frequency']),
|
|
417
|
+
);
|
|
418
|
+
const face = faceOf(specification);
|
|
419
|
+
const dayCount = specification.dayCount ?? 'ACT/360';
|
|
420
|
+
const spread = specification.spread ?? 0;
|
|
421
|
+
const baseSpecification: BaseSpecification = { ...specification, dayCount };
|
|
422
|
+
const schedule = buildSchedule(baseSpecification);
|
|
423
|
+
const last = schedule.length - 1;
|
|
424
|
+
const flowsFor = (context: ProjectionContext): CashFlow[] => {
|
|
425
|
+
const curve = context.forecastCurve;
|
|
426
|
+
if (!curve) {
|
|
427
|
+
throw new InputError(
|
|
428
|
+
'flowsFor: A floating-rate note needs context.forecastCurve to project its coupons.',
|
|
429
|
+
{
|
|
430
|
+
code: ErrorCode.InputMissingField,
|
|
431
|
+
context: { kind: 'frn' },
|
|
432
|
+
},
|
|
433
|
+
);
|
|
434
|
+
}
|
|
435
|
+
return schedule.map((p, i) => {
|
|
436
|
+
const accrual = yearFraction(p.accrualStart, p.accrualEnd, dayCount);
|
|
437
|
+
const forward = projectFrnRate(p, curve, dayCount, context);
|
|
438
|
+
const interest = (forward + spread) * face * accrual;
|
|
439
|
+
const principal = i === last ? face : 0;
|
|
440
|
+
return {
|
|
441
|
+
date: p.accrualEnd,
|
|
442
|
+
paymentDate: p.paymentDate,
|
|
443
|
+
interest,
|
|
444
|
+
principal,
|
|
445
|
+
amount: interest + principal,
|
|
446
|
+
notional: face,
|
|
447
|
+
};
|
|
448
|
+
});
|
|
449
|
+
};
|
|
450
|
+
return makeBond('frn', baseSpecification, schedule, flowsFor);
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
export interface AmortizingBondSpecification extends BaseSpecification {
|
|
454
|
+
amortization: Amortization;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
function amortizing(specification: AmortizingBondSpecification): Bond {
|
|
458
|
+
validateClosedRequest(
|
|
459
|
+
'bonds.amortizing',
|
|
460
|
+
specification,
|
|
461
|
+
AMORTIZING_SPEC,
|
|
462
|
+
specificationTeaching('bonds.amortizing', [
|
|
463
|
+
'issueDate',
|
|
464
|
+
'maturityDate',
|
|
465
|
+
'couponRate',
|
|
466
|
+
'frequency',
|
|
467
|
+
]),
|
|
468
|
+
);
|
|
469
|
+
const face = faceOf(specification);
|
|
470
|
+
const dayCount = specification.dayCount ?? '30/360';
|
|
471
|
+
const baseSpecification: BaseSpecification = { ...specification, dayCount };
|
|
472
|
+
const schedule = buildSchedule(baseSpecification);
|
|
473
|
+
const n = schedule.length;
|
|
474
|
+
|
|
475
|
+
const principalSchedule = (): number[] => {
|
|
476
|
+
const amort = specification.amortization;
|
|
477
|
+
if ('principalByPeriod' in amort) {
|
|
478
|
+
if (amort.principalByPeriod.length !== n) {
|
|
479
|
+
throw new InputError(
|
|
480
|
+
`principalSchedule: principalByPeriod has ${amort.principalByPeriod.length} entries but the schedule has ${n} periods.`,
|
|
481
|
+
{
|
|
482
|
+
code: ErrorCode.InputOutOfRange,
|
|
483
|
+
context: { expected: n, got: amort.principalByPeriod.length },
|
|
484
|
+
},
|
|
485
|
+
);
|
|
486
|
+
}
|
|
487
|
+
const total = amort.principalByPeriod.reduce((s, x) => s + x, 0);
|
|
488
|
+
if (Math.abs(total - face) > 1e-6 * face) {
|
|
489
|
+
throw new InputError(
|
|
490
|
+
`principalSchedule: principalByPeriod sums to ${total}, expected the face value ${face}.`,
|
|
491
|
+
{
|
|
492
|
+
code: ErrorCode.InputOutOfRange,
|
|
493
|
+
context: { total, face },
|
|
494
|
+
},
|
|
495
|
+
);
|
|
496
|
+
}
|
|
497
|
+
return [...amort.principalByPeriod];
|
|
498
|
+
}
|
|
499
|
+
if (amort.type === 'straight') {
|
|
500
|
+
return schedule.map(() => face / n);
|
|
501
|
+
}
|
|
502
|
+
// annuity: solve a level total payment A using each period's actual rate.
|
|
503
|
+
const rates = schedule.map(
|
|
504
|
+
(p) => specification.couponRate * yearFraction(p.accrualStart, p.accrualEnd, dayCount),
|
|
505
|
+
);
|
|
506
|
+
// For equal periods these are all c = couponRate/f; A = face·c/(1−(1+c)^−n). Use period 0's rate.
|
|
507
|
+
const c = rates[0]!;
|
|
508
|
+
let outstanding = face;
|
|
509
|
+
const principals: number[] = [];
|
|
510
|
+
if (c === 0) {
|
|
511
|
+
// No interest ⇒ equal principal.
|
|
512
|
+
return schedule.map(() => face / n);
|
|
513
|
+
}
|
|
514
|
+
const A = (face * c) / (1 - Math.pow(1 + c, -n));
|
|
515
|
+
for (let i = 0; i < n; i++) {
|
|
516
|
+
const interest = outstanding * rates[i]!;
|
|
517
|
+
let principal = A - interest;
|
|
518
|
+
if (i === n - 1) principal = outstanding; // clean up rounding on the final period
|
|
519
|
+
principals.push(principal);
|
|
520
|
+
outstanding -= principal;
|
|
521
|
+
}
|
|
522
|
+
return principals;
|
|
523
|
+
};
|
|
524
|
+
|
|
525
|
+
const flowsFor = (): CashFlow[] => {
|
|
526
|
+
const principals = principalSchedule();
|
|
527
|
+
let outstanding = face;
|
|
528
|
+
return schedule.map((p, i) => {
|
|
529
|
+
const accrual = yearFraction(p.accrualStart, p.accrualEnd, dayCount);
|
|
530
|
+
const interest = specification.couponRate * outstanding * accrual;
|
|
531
|
+
const principal = principals[i]!;
|
|
532
|
+
const notional = outstanding;
|
|
533
|
+
outstanding -= principal;
|
|
534
|
+
return {
|
|
535
|
+
date: p.accrualEnd,
|
|
536
|
+
paymentDate: p.paymentDate,
|
|
537
|
+
interest,
|
|
538
|
+
principal,
|
|
539
|
+
amount: interest + principal,
|
|
540
|
+
notional,
|
|
541
|
+
};
|
|
542
|
+
});
|
|
543
|
+
};
|
|
544
|
+
return makeBond('amortizing', baseSpecification, schedule, flowsFor);
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
export interface InflationLinkedBondSpecification extends BaseSpecification {
|
|
548
|
+
/** Reference index level at issuance (the indexation base). */
|
|
549
|
+
baseIndex: number;
|
|
550
|
+
/** Floor the redeemed principal at par against deflation (TIPS-style). Default false. */
|
|
551
|
+
deflationFloor?: boolean;
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
function inflationLinked(specification: InflationLinkedBondSpecification): Bond {
|
|
555
|
+
validateClosedRequest(
|
|
556
|
+
'bonds.inflationLinked',
|
|
557
|
+
specification,
|
|
558
|
+
INFLATION_LINKED_SPEC,
|
|
559
|
+
specificationTeaching('bonds.inflationLinked', [
|
|
560
|
+
'issueDate',
|
|
561
|
+
'maturityDate',
|
|
562
|
+
'couponRate',
|
|
563
|
+
'frequency',
|
|
564
|
+
]),
|
|
565
|
+
);
|
|
566
|
+
const face = faceOf(specification);
|
|
567
|
+
const dayCount = specification.dayCount ?? 'ACT/ACT';
|
|
568
|
+
const baseSpecification: BaseSpecification = { ...specification, dayCount };
|
|
569
|
+
const schedule = buildSchedule(baseSpecification);
|
|
570
|
+
const last = schedule.length - 1;
|
|
571
|
+
if (!Number.isFinite(specification.baseIndex) || specification.baseIndex <= 0) {
|
|
572
|
+
throw new InputError(
|
|
573
|
+
`inflationLinked: baseIndex must be positive (got ${specification.baseIndex}).`,
|
|
574
|
+
{
|
|
575
|
+
code: ErrorCode.InputOutOfRange,
|
|
576
|
+
context: { field: 'baseIndex', value: specification.baseIndex },
|
|
577
|
+
},
|
|
578
|
+
);
|
|
579
|
+
}
|
|
580
|
+
const flowsFor = (context: ProjectionContext): CashFlow[] => {
|
|
581
|
+
const index = context.referenceIndex;
|
|
582
|
+
if (!index) {
|
|
583
|
+
throw new InputError(
|
|
584
|
+
'flowsFor: An inflation-linked bond needs context.referenceIndex to index its cash flows.',
|
|
585
|
+
{
|
|
586
|
+
code: ErrorCode.InputMissingField,
|
|
587
|
+
context: { kind: 'inflation' },
|
|
588
|
+
},
|
|
589
|
+
);
|
|
590
|
+
}
|
|
591
|
+
return schedule.map((p, i) => {
|
|
592
|
+
const ratio = index(p.accrualEnd) / specification.baseIndex;
|
|
593
|
+
if (!Number.isFinite(ratio) || ratio <= 0) {
|
|
594
|
+
throw new InputError(
|
|
595
|
+
`flowsFor: referenceIndex(${p.accrualEnd}) produced a non-positive index ratio.`,
|
|
596
|
+
{
|
|
597
|
+
code: ErrorCode.InputOutOfRange,
|
|
598
|
+
context: { date: p.accrualEnd, ratio },
|
|
599
|
+
},
|
|
600
|
+
);
|
|
601
|
+
}
|
|
602
|
+
const interest =
|
|
603
|
+
specification.couponRate *
|
|
604
|
+
face *
|
|
605
|
+
yearFraction(p.accrualStart, p.accrualEnd, dayCount) *
|
|
606
|
+
ratio;
|
|
607
|
+
let principal = 0;
|
|
608
|
+
if (i === last) {
|
|
609
|
+
const uplifted = face * ratio;
|
|
610
|
+
principal = specification.deflationFloor ? Math.max(uplifted, face) : uplifted;
|
|
611
|
+
}
|
|
612
|
+
return {
|
|
613
|
+
date: p.accrualEnd,
|
|
614
|
+
paymentDate: p.paymentDate,
|
|
615
|
+
interest,
|
|
616
|
+
principal,
|
|
617
|
+
amount: interest + principal,
|
|
618
|
+
notional: face * ratio,
|
|
619
|
+
};
|
|
620
|
+
});
|
|
621
|
+
};
|
|
622
|
+
return makeBond('inflation', baseSpecification, schedule, flowsFor);
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
/** Bond constructors (spec §14.1). */
|
|
626
|
+
export const bonds = {
|
|
627
|
+
fixedRate,
|
|
628
|
+
zeroCoupon,
|
|
629
|
+
floatingRateNote,
|
|
630
|
+
amortizing,
|
|
631
|
+
inflationLinked,
|
|
632
|
+
};
|
|
633
|
+
|
|
634
|
+
// ---------------------------------------------------------------------------------------------------
|
|
635
|
+
// Pricing & metrics
|
|
636
|
+
// ---------------------------------------------------------------------------------------------------
|
|
637
|
+
|
|
638
|
+
/**
|
|
639
|
+
* Guard the actuarial discount base `1 + y/f`. A yield at or below `−f` (e.g. `y = −2` at annual
|
|
640
|
+
* frequency) drives the base non-positive, which makes `base^(−f·τ)` return NaN or a sign-flipped
|
|
641
|
+
* price (a one-year zero would report `−100`). Reject it rather than emit a bogus number.
|
|
642
|
+
*/
|
|
643
|
+
function actuarialBase(y: number, f: number, functionName: string): number {
|
|
644
|
+
if (!Number.isFinite(y)) {
|
|
645
|
+
throw new InputError(`${functionName}: yield must be finite, got ${y}.`, {
|
|
646
|
+
code: ErrorCode.InputNotFinite,
|
|
647
|
+
context: { yield: y },
|
|
648
|
+
});
|
|
649
|
+
}
|
|
650
|
+
const base = 1 + y / f;
|
|
651
|
+
if (!(base > 0)) {
|
|
652
|
+
throw new InputError(
|
|
653
|
+
`${functionName}: yield ${y} implies a non-positive actuarial base (1 + y/${f} = ${base}); price is undefined. Yields must satisfy y > −${f}.`,
|
|
654
|
+
{ code: ErrorCode.InputOutOfRange, context: { yield: y, frequency: f, base } },
|
|
655
|
+
);
|
|
656
|
+
}
|
|
657
|
+
return base;
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
/**
|
|
661
|
+
* Ceiling on the expanding yield bracket: 1000%. Past this a "yield" is no longer a yield — the
|
|
662
|
+
* price is almost certainly wrong (a typo, the wrong settlement date, or a defaulted bond quoted in
|
|
663
|
+
* points upfront), and reporting a four-digit percentage would dress that up as an answer.
|
|
664
|
+
*/
|
|
665
|
+
const MAXIMUM_YIELD_BRACKET = 10;
|
|
666
|
+
|
|
667
|
+
/**
|
|
668
|
+
* Bracket and solve a yield root, EXPANDING the upper bound until the objective changes sign
|
|
669
|
+
* (doubling from 100%, capped at {@link MAXIMUM_YIELD_BRACKET}).
|
|
670
|
+
*
|
|
671
|
+
* The bracket used to be the hard-coded `[−0.99·f, 1]`. Any distressed bond — a 1-year zero at 40
|
|
672
|
+
* yields 150% — has its root outside it, so Brent found no sign change and the caller was told the
|
|
673
|
+
* solve "did not converge": a true statement that named the wrong cause and suggested a numerical
|
|
674
|
+
* flaw rather than a bracket that never contained the answer. Beyond the cap the error now names
|
|
675
|
+
* the interval actually searched.
|
|
676
|
+
*/
|
|
677
|
+
function solveYieldBracketed(
|
|
678
|
+
objective: (y: number) => number,
|
|
679
|
+
frequency: number,
|
|
680
|
+
functionName: string,
|
|
681
|
+
context: Record<string, unknown>,
|
|
682
|
+
): { value: number; iterations: number } {
|
|
683
|
+
// Yield must exceed −f (so 1 + y/f > 0); bracket just above that singularity.
|
|
684
|
+
const lo = -frequency * 0.99;
|
|
685
|
+
let hi = 1.0;
|
|
686
|
+
const fLo = objective(lo);
|
|
687
|
+
let fHi = objective(hi);
|
|
688
|
+
let expansions = 0;
|
|
689
|
+
while (
|
|
690
|
+
Number.isFinite(fLo) &&
|
|
691
|
+
Number.isFinite(fHi) &&
|
|
692
|
+
fLo * fHi > 0 &&
|
|
693
|
+
hi < MAXIMUM_YIELD_BRACKET
|
|
694
|
+
) {
|
|
695
|
+
hi = Math.min(hi * 2, MAXIMUM_YIELD_BRACKET);
|
|
696
|
+
fHi = objective(hi);
|
|
697
|
+
expansions++;
|
|
698
|
+
}
|
|
699
|
+
const res = brent(objective, lo, hi, { stepTolerance: 1e-12, maximumIterations: 200 });
|
|
700
|
+
if (!res.converged) {
|
|
701
|
+
const asPercent = (y: number): string => `${(y * 100).toFixed(1)}%`;
|
|
702
|
+
throw new ConvergenceError(
|
|
703
|
+
`${functionName}: no yield in the bracket searched — [${asPercent(lo)}, ${asPercent(hi)}] ` +
|
|
704
|
+
`(expanded upward from 100% to at most ${asPercent(MAXIMUM_YIELD_BRACKET)}) — reprices the ` +
|
|
705
|
+
'bond to the target price. A price outside that range is usually a mis-entered price, the ' +
|
|
706
|
+
'wrong settlement date, or a defaulted bond quoted in points upfront rather than on yield.',
|
|
707
|
+
{
|
|
708
|
+
code: ErrorCode.SolverNoConvergence,
|
|
709
|
+
context: {
|
|
710
|
+
...context,
|
|
711
|
+
bracketSearched: [lo, hi],
|
|
712
|
+
bracketExpansions: expansions,
|
|
713
|
+
iterations: res.iterations,
|
|
714
|
+
reason: res.reason,
|
|
715
|
+
},
|
|
716
|
+
},
|
|
717
|
+
);
|
|
718
|
+
}
|
|
719
|
+
return { value: res.value, iterations: res.iterations + expansions };
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
/** Discount a future cash-flow set at yield `y` (actuarial convention) → dirty price. */
|
|
723
|
+
function dirtyFromYield(
|
|
724
|
+
flows: CashFlow[],
|
|
725
|
+
settlementDate: string,
|
|
726
|
+
y: number,
|
|
727
|
+
f: number,
|
|
728
|
+
dayCount: FixedIncomeDayCount,
|
|
729
|
+
): number {
|
|
730
|
+
const base = actuarialBase(y, f, 'priceFromYield');
|
|
731
|
+
let pv = 0;
|
|
732
|
+
for (const cf of flows) {
|
|
733
|
+
const tau = yearFraction(settlementDate, cf.date, dayCount);
|
|
734
|
+
pv += cf.amount * Math.pow(base, -f * tau);
|
|
735
|
+
}
|
|
736
|
+
return pv;
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
/**
|
|
740
|
+
* Conventions echoed on every bond pricing/metrics result (spec §7.4 / WS2.2). Bonds discount either
|
|
741
|
+
* actuarially (`(1 + y/f)^(−f·τ)`) or off a curve, so `compounding` and `dayCount` are widened past
|
|
742
|
+
* the core enums; the rest matches the shared `Assumptions` shape.
|
|
743
|
+
*/
|
|
744
|
+
export type BondAssumptions = Omit<Assumptions, 'dayCount' | 'compounding'> & {
|
|
745
|
+
dayCount: FixedIncomeDayCount;
|
|
746
|
+
/** `actuarial` for yield-based results; `curve` when discounted off a {@link YieldCurve}. */
|
|
747
|
+
compounding: 'actuarial' | 'curve';
|
|
748
|
+
/** Coupon payments per year actually used in discounting. */
|
|
749
|
+
frequency: number;
|
|
750
|
+
/** Settlement date the result was computed as of. */
|
|
751
|
+
settlementDate: string;
|
|
752
|
+
/** Business-day convention baked into the payment schedule. */
|
|
753
|
+
businessDayConvention: BusinessDayConvention;
|
|
754
|
+
};
|
|
755
|
+
|
|
756
|
+
/**
|
|
757
|
+
* The fixed-income twin of core's `plausibilityWarnings`: a coupon rate is a DECIMAL (`0.05` = 5%),
|
|
758
|
+
* so `couponRate: 5` is a 500% coupon. It prices, it solves, and every duration and DV01 downstream
|
|
759
|
+
* is nonsense — with nothing in the output to say so. Informational, never thrown: a 150% coupon is
|
|
760
|
+
* legal in distressed/EM paper, so the threshold is 100% and the verdict is the caller's.
|
|
761
|
+
*/
|
|
762
|
+
function couponRateWarnings(bond: Bond): QuantWarning[] {
|
|
763
|
+
const couponRate = bond.couponRate;
|
|
764
|
+
if (!Number.isFinite(couponRate) || Math.abs(couponRate) <= 1) return [];
|
|
765
|
+
return [
|
|
766
|
+
warning(
|
|
767
|
+
ErrorCode.InputSuspiciousCouponRate,
|
|
768
|
+
`couponRate=${couponRate} implies a ${(couponRate * 100).toFixed(0)}% coupon — couponRate is a ` +
|
|
769
|
+
`decimal; did you mean ${(couponRate / 100).toFixed(4)}?`,
|
|
770
|
+
'info',
|
|
771
|
+
{ couponRate },
|
|
772
|
+
),
|
|
773
|
+
];
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
/** Build the conventions echo for a bond result. */
|
|
777
|
+
function bondAssumptions(
|
|
778
|
+
bond: Bond,
|
|
779
|
+
settlementDate: string,
|
|
780
|
+
compounding: 'actuarial' | 'curve',
|
|
781
|
+
): BondAssumptions {
|
|
782
|
+
return {
|
|
783
|
+
conventionsVersion: CONVENTIONS_VERSION,
|
|
784
|
+
dayCount: bond.dayCount,
|
|
785
|
+
compounding,
|
|
786
|
+
frequency: bond.frequency,
|
|
787
|
+
settlementDate,
|
|
788
|
+
businessDayConvention: bond.businessDayConvention,
|
|
789
|
+
};
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
/**
|
|
793
|
+
* The {@link Computed} envelope specialised to bond results (dx §2.7): `assumptions` is the widened
|
|
794
|
+
* {@link BondAssumptions} — fixed income needs the `ACT/ACT`/`30E/360` day counts and the
|
|
795
|
+
* `actuarial`/`curve` compounding modes that the core enums do not carry. Structurally this IS the
|
|
796
|
+
* core envelope (`value` + `assumptions.conventionsVersion` + `diagnostics.warnings`), so it
|
|
797
|
+
* satisfies `isComputed` and the WS-7.2 conformance sweep.
|
|
798
|
+
*/
|
|
799
|
+
export interface BondComputed<T> {
|
|
800
|
+
value: T;
|
|
801
|
+
assumptions: BondAssumptions;
|
|
802
|
+
diagnostics: Diagnostics;
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
/** A bond facade: the plain call plus an `.explain()` companion returning {@link BondComputed}. */
|
|
806
|
+
export type BondFacade<Args extends unknown[], Out, EOut = Out> = ((
|
|
807
|
+
...callArguments: Args
|
|
808
|
+
) => Out) & {
|
|
809
|
+
explain: (...callArguments: Args) => BondComputed<EOut>;
|
|
810
|
+
};
|
|
811
|
+
|
|
812
|
+
/**
|
|
813
|
+
* Build a bond facade on core `seriesFacade` (label first, shared first-argument guard). The only
|
|
814
|
+
* departure from the stock helper is the envelope's assumptions type: {@link BondAssumptions}
|
|
815
|
+
* widens `dayCount`/`compounding` past the core enums, which `Computed<T, Extra>` cannot express as
|
|
816
|
+
* an `Extra` intersection — the runtime shape is exactly the core envelope, so the casts below are
|
|
817
|
+
* type-level only.
|
|
818
|
+
*/
|
|
819
|
+
/**
|
|
820
|
+
* The bond analytics facades take a Bond INSTANCE (from `bonds.fixedRate(...)` et al.), not a raw
|
|
821
|
+
* spec object — a plain `{ couponRate, … }` would crash on the first method call, so it teaches.
|
|
822
|
+
*/
|
|
823
|
+
function requireBondInstance(bond: unknown, functionName: string): void {
|
|
824
|
+
const b = bond as { futureCashflows?: unknown; accrued?: unknown };
|
|
825
|
+
if (typeof b.futureCashflows !== 'function' || typeof b.accrued !== 'function') {
|
|
826
|
+
throw new InputError(
|
|
827
|
+
`${functionName}: expected a bond built by bonds.fixedRate(...) / bonds.zeroCoupon(...) (a Bond instance with cash-flow methods), not a raw specification object. Build the bond first, then pass it here.`,
|
|
828
|
+
{ code: ErrorCode.InputWrongType, context: { function: functionName, field: 'bond' } },
|
|
829
|
+
);
|
|
830
|
+
}
|
|
831
|
+
// Bonds are structurally typed artifacts. Validate the methods we consume while allowing
|
|
832
|
+
// provenance, identifiers, and downstream risk metadata to decorate the object.
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
/**
|
|
836
|
+
* Curve parameters take a curve INSTANCE (from `curves.fromZeroRates(...)`, `curves.bootstrap(...)`),
|
|
837
|
+
* not a raw pillar list — teach the fix instead of crashing on the first method call.
|
|
838
|
+
*/
|
|
839
|
+
function requireCurveInstance(curve: unknown, functionName: string): void {
|
|
840
|
+
const c = curve as { discount?: unknown; shift?: unknown; pillars?: unknown };
|
|
841
|
+
if (
|
|
842
|
+
typeof c.discount !== 'function' ||
|
|
843
|
+
typeof c.shift !== 'function' ||
|
|
844
|
+
!Array.isArray(c.pillars)
|
|
845
|
+
) {
|
|
846
|
+
throw new InputError(
|
|
847
|
+
`${functionName}: expected a curve built by curves.fromZeroRates(...) / curves.bootstrap(...) (a Curve instance with discount()/shift()), not a raw object. Build the curve first, then pass it here.`,
|
|
848
|
+
{ code: ErrorCode.InputWrongType, context: { function: functionName, field: 'curve' } },
|
|
849
|
+
);
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
function bondFacade<Args extends unknown[], Out>(
|
|
854
|
+
label: string,
|
|
855
|
+
call: (...callArguments: Args) => Out,
|
|
856
|
+
explain: (...callArguments: Args) => BondComputed<Out>,
|
|
857
|
+
): BondFacade<Args, Out> {
|
|
858
|
+
return seriesFacade(
|
|
859
|
+
label,
|
|
860
|
+
call,
|
|
861
|
+
explain as unknown as (...callArguments: Args) => Computed<Out>,
|
|
862
|
+
) as unknown as BondFacade<Args, Out>;
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
export interface PriceFromYieldOptions {
|
|
866
|
+
settlementDate: string;
|
|
867
|
+
/** Annualized yield (decimal). */
|
|
868
|
+
yield: number;
|
|
869
|
+
context?: ProjectionContext;
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
/** {@link PriceFromYieldOptions} keys (Law 12 — mirrors the interface above; keep in sync). */
|
|
873
|
+
const PRICE_FROM_YIELD_OPTIONS_KEYS = ['settlementDate', 'yield', 'context'] as const;
|
|
874
|
+
|
|
875
|
+
export interface BondPrice {
|
|
876
|
+
dirtyPrice: number;
|
|
877
|
+
cleanPrice: number;
|
|
878
|
+
accruedInterest: number;
|
|
879
|
+
assumptions: BondAssumptions;
|
|
880
|
+
diagnostics: Diagnostics;
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
function priceFromYieldValue(bond: Bond, options: PriceFromYieldOptions): BondPrice {
|
|
884
|
+
requireArgumentObject('priceFromYield', 'options', options);
|
|
885
|
+
ensureKnownKeys('priceFromYield', 'options', options, PRICE_FROM_YIELD_OPTIONS_KEYS);
|
|
886
|
+
requireAnalyticsOptionLadders('priceFromYield', options as unknown as Record<string, unknown>);
|
|
887
|
+
requireArgumentObject('priceFromYield', 'bond', bond);
|
|
888
|
+
requireBondInstance(bond, 'priceFromYield');
|
|
889
|
+
const flows = bond.futureCashflows(options.settlementDate, options.context);
|
|
890
|
+
const dirty = dirtyFromYield(
|
|
891
|
+
flows,
|
|
892
|
+
options.settlementDate,
|
|
893
|
+
options.yield,
|
|
894
|
+
bond.frequency,
|
|
895
|
+
bond.dayCount,
|
|
896
|
+
);
|
|
897
|
+
const accruedInterest = bond.accrued(options.settlementDate, options.context);
|
|
898
|
+
return {
|
|
899
|
+
dirtyPrice: dirty,
|
|
900
|
+
cleanPrice: dirty - accruedInterest,
|
|
901
|
+
accruedInterest,
|
|
902
|
+
assumptions: bondAssumptions(bond, options.settlementDate, 'actuarial'),
|
|
903
|
+
diagnostics: { method: 'closed-form', warnings: couponRateWarnings(bond) },
|
|
904
|
+
};
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
/**
|
|
908
|
+
* Dirty/clean price and accrued interest for a bond at a given yield. Facade (dx §2.7): the plain
|
|
909
|
+
* call returns the rich {@link BondPrice}; `.explain()` wraps the same result in the core envelope
|
|
910
|
+
* with the conventions echoed at the top level.
|
|
911
|
+
*/
|
|
912
|
+
export const priceFromYield = bondFacade(
|
|
913
|
+
'priceFromYield',
|
|
914
|
+
priceFromYieldValue,
|
|
915
|
+
(bond: Bond, options: PriceFromYieldOptions): BondComputed<BondPrice> => {
|
|
916
|
+
const price = priceFromYieldValue(bond, options);
|
|
917
|
+
return { value: price, assumptions: price.assumptions, diagnostics: price.diagnostics };
|
|
918
|
+
},
|
|
919
|
+
);
|
|
920
|
+
|
|
921
|
+
export interface YieldFromPriceOptions {
|
|
922
|
+
settlementDate: string;
|
|
923
|
+
/** Either a clean price (default) or a dirty price — set `priceType`. */
|
|
924
|
+
price: number;
|
|
925
|
+
priceType?: 'clean' | 'dirty';
|
|
926
|
+
context?: ProjectionContext;
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
/** {@link YieldFromPriceOptions} keys (Law 12 — mirrors the interface above; keep in sync). */
|
|
930
|
+
const YIELD_FROM_PRICE_OPTIONS_KEYS = ['settlementDate', 'price', 'priceType', 'context'] as const;
|
|
931
|
+
|
|
932
|
+
/**
|
|
933
|
+
* Shared analytics-option ladders: `context: null` used to reach `bond.cashflows(null)` and the
|
|
934
|
+
* settlementDate string flowed unchecked into date arithmetic.
|
|
935
|
+
*/
|
|
936
|
+
function requireAnalyticsOptionLadders(
|
|
937
|
+
functionName: string,
|
|
938
|
+
options: Record<string, unknown>,
|
|
939
|
+
): void {
|
|
940
|
+
const context = options['context'];
|
|
941
|
+
if (context !== undefined && (context === null || typeof context !== 'object')) {
|
|
942
|
+
throw new InputError(
|
|
943
|
+
`${functionName}: context must be a projection-context object when provided. Received ${context === null ? 'null' : typeof context}.`,
|
|
944
|
+
{ code: ErrorCode.InputWrongType, context: { field: 'context' } },
|
|
945
|
+
);
|
|
946
|
+
}
|
|
947
|
+
const settlementDate = options['settlementDate'];
|
|
948
|
+
if (
|
|
949
|
+
settlementDate !== undefined &&
|
|
950
|
+
(typeof settlementDate !== 'string' || settlementDate.length === 0)
|
|
951
|
+
) {
|
|
952
|
+
throw new InputError(
|
|
953
|
+
`${functionName}: settlementDate must be an ISO date string when provided. Received ${settlementDate === null ? 'null' : typeof settlementDate}.`,
|
|
954
|
+
{ code: ErrorCode.InputWrongType, context: { field: 'settlementDate' } },
|
|
955
|
+
);
|
|
956
|
+
}
|
|
957
|
+
// The context MEMBERS the projection consumes (C05: validate consumed fields, teach each type).
|
|
958
|
+
if (context !== undefined) {
|
|
959
|
+
const projection = context as Record<string, unknown>;
|
|
960
|
+
const forecastCurve = projection['forecastCurve'];
|
|
961
|
+
if (
|
|
962
|
+
forecastCurve !== undefined &&
|
|
963
|
+
(forecastCurve === null || typeof forecastCurve !== 'object')
|
|
964
|
+
) {
|
|
965
|
+
throw new InputError(
|
|
966
|
+
`${functionName}: context.forecastCurve must be a yield-curve object when provided. Received ${forecastCurve === null ? 'null' : typeof forecastCurve}.`,
|
|
967
|
+
{ code: ErrorCode.InputWrongType, context: { field: 'context.forecastCurve' } },
|
|
968
|
+
);
|
|
969
|
+
}
|
|
970
|
+
const referenceIndex = projection['referenceIndex'];
|
|
971
|
+
if (referenceIndex !== undefined && typeof referenceIndex !== 'function') {
|
|
972
|
+
throw new InputError(
|
|
973
|
+
`${functionName}: context.referenceIndex must be a function (date => index level) when provided. Received ${referenceIndex === null ? 'null' : typeof referenceIndex}.`,
|
|
974
|
+
{ code: ErrorCode.InputWrongType, context: { field: 'context.referenceIndex' } },
|
|
975
|
+
);
|
|
976
|
+
}
|
|
977
|
+
const knownFixingRate = projection['knownFixingRate'];
|
|
978
|
+
if (
|
|
979
|
+
knownFixingRate !== undefined &&
|
|
980
|
+
(typeof knownFixingRate !== 'number' || !Number.isFinite(knownFixingRate))
|
|
981
|
+
) {
|
|
982
|
+
throw new InputError(
|
|
983
|
+
`${functionName}: context.knownFixingRate must be a finite decimal rate when provided. Received ${knownFixingRate === null ? 'null' : typeof knownFixingRate}.`,
|
|
984
|
+
{ code: ErrorCode.InputWrongType, context: { field: 'context.knownFixingRate' } },
|
|
985
|
+
);
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
/** Pre-coalesce enum ladder: `priceType: null` must never silently quote clean. */
|
|
991
|
+
function resolvePriceType(value: unknown): 'clean' | 'dirty' {
|
|
992
|
+
if (value === undefined) return 'clean';
|
|
993
|
+
if (value !== 'clean' && value !== 'dirty') {
|
|
994
|
+
throw new InputError(
|
|
995
|
+
`resolvePriceType: priceType must be 'clean' | 'dirty' when provided — omit the field for a clean quote. Received ${value === null ? 'null' : JSON.stringify(value)}.`,
|
|
996
|
+
{ code: ErrorCode.InputInvalidEnum, context: { field: 'priceType', received: value } },
|
|
997
|
+
);
|
|
998
|
+
}
|
|
999
|
+
return value;
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
/** Root-find the YTM; returns the solver facts so the explain path can disclose them honestly. */
|
|
1003
|
+
function solveYieldToMaturity(
|
|
1004
|
+
bond: Bond,
|
|
1005
|
+
options: YieldFromPriceOptions,
|
|
1006
|
+
): { value: number; iterations: number } {
|
|
1007
|
+
requireArgumentObject('yieldToMaturity', 'options', options);
|
|
1008
|
+
ensureKnownKeys('yieldToMaturity', 'options', options, YIELD_FROM_PRICE_OPTIONS_KEYS);
|
|
1009
|
+
requireAnalyticsOptionLadders('yieldToMaturity', options as unknown as Record<string, unknown>);
|
|
1010
|
+
// `price` is declared REQUIRED: a null price used to root-find against NaN and report
|
|
1011
|
+
// non-convergence instead of teaching the missing field.
|
|
1012
|
+
requireFiniteFields('yieldToMaturity', options as unknown as Record<string, unknown>, ['price'], {
|
|
1013
|
+
exampleCall: "yieldToMaturity(bond, { price: 98.5, settlementDate: '2026-06-15' })",
|
|
1014
|
+
});
|
|
1015
|
+
requireArgumentObject('yieldToMaturity', 'bond', bond);
|
|
1016
|
+
requireBondInstance(bond, 'yieldToMaturity');
|
|
1017
|
+
const flows = bond.futureCashflows(options.settlementDate, options.context);
|
|
1018
|
+
if (flows.length === 0) {
|
|
1019
|
+
throw new InputError(
|
|
1020
|
+
'solveYieldToMaturity: No cash flows after the settlement date — cannot solve a yield.',
|
|
1021
|
+
{
|
|
1022
|
+
code: ErrorCode.InputOutOfRange,
|
|
1023
|
+
context: { settlementDate: options.settlementDate },
|
|
1024
|
+
},
|
|
1025
|
+
);
|
|
1026
|
+
}
|
|
1027
|
+
const accruedInterest = bond.accrued(options.settlementDate, options.context);
|
|
1028
|
+
const targetDirty =
|
|
1029
|
+
resolvePriceType(options.priceType) === 'dirty'
|
|
1030
|
+
? options.price
|
|
1031
|
+
: options.price + accruedInterest;
|
|
1032
|
+
const f = bond.frequency;
|
|
1033
|
+
const objective = (y: number): number =>
|
|
1034
|
+
dirtyFromYield(flows, options.settlementDate, y, f, bond.dayCount) - targetDirty;
|
|
1035
|
+
return solveYieldBracketed(objective, f, 'yieldToMaturity', {
|
|
1036
|
+
targetPrice: options.price,
|
|
1037
|
+
settlementDate: options.settlementDate,
|
|
1038
|
+
});
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
/**
|
|
1042
|
+
* Solve the yield to maturity that reprices a bond to the observed price (Brent on [−0.99·f, 1]).
|
|
1043
|
+
* Facade (dx §2.7): the plain call returns the bare yield; `.explain()` returns the core envelope
|
|
1044
|
+
* echoing the bond's conventions plus honest solver diagnostics (this is a root-find, so
|
|
1045
|
+
* `converged`/`iterations` are disclosed — a non-converged solve throws rather than returning).
|
|
1046
|
+
*/
|
|
1047
|
+
export const yieldToMaturity = bondFacade(
|
|
1048
|
+
'yieldToMaturity',
|
|
1049
|
+
(bond: Bond, options: YieldFromPriceOptions): number => solveYieldToMaturity(bond, options).value,
|
|
1050
|
+
(bond: Bond, options: YieldFromPriceOptions): BondComputed<number> => {
|
|
1051
|
+
const res = solveYieldToMaturity(bond, options);
|
|
1052
|
+
return {
|
|
1053
|
+
value: res.value,
|
|
1054
|
+
assumptions: bondAssumptions(bond, options.settlementDate, 'actuarial'),
|
|
1055
|
+
diagnostics: {
|
|
1056
|
+
method: 'brent',
|
|
1057
|
+
converged: true,
|
|
1058
|
+
iterations: res.iterations,
|
|
1059
|
+
warnings: couponRateWarnings(bond),
|
|
1060
|
+
},
|
|
1061
|
+
};
|
|
1062
|
+
},
|
|
1063
|
+
);
|
|
1064
|
+
|
|
1065
|
+
export interface YieldMetrics {
|
|
1066
|
+
yield: number;
|
|
1067
|
+
dirtyPrice: number;
|
|
1068
|
+
cleanPrice: number;
|
|
1069
|
+
accruedInterest: number;
|
|
1070
|
+
macaulayDuration: number;
|
|
1071
|
+
modifiedDuration: number;
|
|
1072
|
+
convexity: number;
|
|
1073
|
+
/** Dollar value of a 1bp yield increase (per the bond's face value). */
|
|
1074
|
+
dv01: number;
|
|
1075
|
+
/** Price value of a 1bp move (synonym for DV01 here, per face). */
|
|
1076
|
+
pv01: number;
|
|
1077
|
+
assumptions: BondAssumptions;
|
|
1078
|
+
diagnostics: Diagnostics;
|
|
1079
|
+
}
|
|
1080
|
+
|
|
1081
|
+
/** Input for {@link yieldMetrics}. */
|
|
1082
|
+
export interface YieldMetricsOptions {
|
|
1083
|
+
settlementDate: string;
|
|
1084
|
+
yield: number;
|
|
1085
|
+
context?: ProjectionContext;
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
/** {@link YieldMetricsOptions} keys (Law 12 — mirrors the interface above; keep in sync). */
|
|
1089
|
+
const YIELD_METRICS_OPTIONS_KEYS = ['settlementDate', 'yield', 'context'] as const;
|
|
1090
|
+
|
|
1091
|
+
function yieldMetricsValue(bond: Bond, options: YieldMetricsOptions): YieldMetrics {
|
|
1092
|
+
requireArgumentObject('yieldMetrics', 'options', options);
|
|
1093
|
+
ensureKnownKeys('yieldMetrics', 'options', options, YIELD_METRICS_OPTIONS_KEYS);
|
|
1094
|
+
requireAnalyticsOptionLadders('yieldMetrics', options as unknown as Record<string, unknown>);
|
|
1095
|
+
requireArgumentObject('yieldMetrics', 'bond', bond);
|
|
1096
|
+
requireBondInstance(bond, 'yieldMetrics');
|
|
1097
|
+
const flows = bond.futureCashflows(options.settlementDate, options.context);
|
|
1098
|
+
const f = bond.frequency;
|
|
1099
|
+
const y = options.yield;
|
|
1100
|
+
const base = actuarialBase(y, f, 'yieldMetrics');
|
|
1101
|
+
let pv = 0;
|
|
1102
|
+
let dur = 0; // Σ τ·PV
|
|
1103
|
+
let cvx = 0; // Σ τ(τ+1/f)·PV
|
|
1104
|
+
for (const cf of flows) {
|
|
1105
|
+
const tau = yearFraction(options.settlementDate, cf.date, bond.dayCount);
|
|
1106
|
+
const pvk = cf.amount * Math.pow(base, -f * tau);
|
|
1107
|
+
pv += pvk;
|
|
1108
|
+
dur += tau * pvk;
|
|
1109
|
+
cvx += tau * (tau + 1 / f) * pvk;
|
|
1110
|
+
}
|
|
1111
|
+
const macaulay = pv === 0 ? 0 : dur / pv;
|
|
1112
|
+
const modified = macaulay / base;
|
|
1113
|
+
const convexity = pv === 0 ? 0 : cvx / (pv * base * base);
|
|
1114
|
+
const accruedInterest = bond.accrued(options.settlementDate, options.context);
|
|
1115
|
+
const dv01 = modified * pv * 1e-4;
|
|
1116
|
+
return {
|
|
1117
|
+
yield: y,
|
|
1118
|
+
dirtyPrice: pv,
|
|
1119
|
+
cleanPrice: pv - accruedInterest,
|
|
1120
|
+
accruedInterest,
|
|
1121
|
+
macaulayDuration: macaulay,
|
|
1122
|
+
modifiedDuration: modified,
|
|
1123
|
+
convexity,
|
|
1124
|
+
dv01,
|
|
1125
|
+
pv01: dv01,
|
|
1126
|
+
assumptions: bondAssumptions(bond, options.settlementDate, 'actuarial'),
|
|
1127
|
+
diagnostics: { method: 'closed-form', warnings: couponRateWarnings(bond) },
|
|
1128
|
+
};
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
/**
|
|
1132
|
+
* Full set of yield-based risk metrics at a given yield (actuarial convention). Duration and
|
|
1133
|
+
* convexity are the closed-form analytic sensitivities of the dirty price to a parallel yield move.
|
|
1134
|
+
* Facade (dx §2.7): the plain call returns the rich {@link YieldMetrics}; `.explain()` wraps the
|
|
1135
|
+
* same result in the core envelope with the conventions echoed at the top level.
|
|
1136
|
+
*/
|
|
1137
|
+
export const yieldMetrics = bondFacade(
|
|
1138
|
+
'yieldMetrics',
|
|
1139
|
+
yieldMetricsValue,
|
|
1140
|
+
(bond: Bond, options: YieldMetricsOptions): BondComputed<YieldMetrics> => {
|
|
1141
|
+
const metrics = yieldMetricsValue(bond, options);
|
|
1142
|
+
return { value: metrics, assumptions: metrics.assumptions, diagnostics: metrics.diagnostics };
|
|
1143
|
+
},
|
|
1144
|
+
);
|
|
1145
|
+
|
|
1146
|
+
// ---- curve-based pricing & effective/key-rate risk ----
|
|
1147
|
+
|
|
1148
|
+
/** Dirty price discounting each cash flow on `curve` from the settlement date (single-curve). */
|
|
1149
|
+
function dirtyFromCurve(
|
|
1150
|
+
bond: Bond,
|
|
1151
|
+
curve: YieldCurve,
|
|
1152
|
+
settlementDate: string,
|
|
1153
|
+
context: ProjectionContext,
|
|
1154
|
+
): number {
|
|
1155
|
+
// Single-curve effective risk: floating coupons project off the (possibly shocked) curve itself, so
|
|
1156
|
+
// a curve bump moves coupons and discounting together — that is what gives an FRN ~zero duration.
|
|
1157
|
+
const projectionCtx: ProjectionContext =
|
|
1158
|
+
bond.kind === 'frn' ? { ...context, forecastCurve: curve } : context;
|
|
1159
|
+
const flows = bond.futureCashflows(settlementDate, projectionCtx);
|
|
1160
|
+
const dfSettle = curve.discount(settlementDate);
|
|
1161
|
+
let pv = 0;
|
|
1162
|
+
for (const cf of flows) {
|
|
1163
|
+
pv += cf.amount * (curve.discount(cf.paymentDate) / dfSettle);
|
|
1164
|
+
}
|
|
1165
|
+
return pv;
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1168
|
+
export interface CurvePricingOptions {
|
|
1169
|
+
settlementDate: string;
|
|
1170
|
+
context?: ProjectionContext;
|
|
1171
|
+
/** Yield bump for the finite-difference effective measures (default 1bp). */
|
|
1172
|
+
bump?: number;
|
|
1173
|
+
}
|
|
1174
|
+
|
|
1175
|
+
/** {@link CurvePricingOptions} keys (Law 12 — mirrors the interface above; keep in sync). */
|
|
1176
|
+
const CURVE_PRICING_OPTIONS_KEYS = ['settlementDate', 'context', 'bump'] as const;
|
|
1177
|
+
|
|
1178
|
+
export interface CurveMetrics {
|
|
1179
|
+
dirtyPrice: number;
|
|
1180
|
+
cleanPrice: number;
|
|
1181
|
+
accruedInterest: number;
|
|
1182
|
+
/** Effective duration from a parallel curve shock. */
|
|
1183
|
+
effectiveDuration: number;
|
|
1184
|
+
/** Effective convexity from a parallel curve shock. */
|
|
1185
|
+
effectiveConvexity: number;
|
|
1186
|
+
/** Dollar value of a 1bp parallel curve shift (per face). */
|
|
1187
|
+
dv01: number;
|
|
1188
|
+
/** Per-pillar key-rate durations, aligned to the curve's pillars. */
|
|
1189
|
+
keyRateDurations: { tenorYears: number; date: string; duration: number }[];
|
|
1190
|
+
assumptions: BondAssumptions;
|
|
1191
|
+
diagnostics: Diagnostics;
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1194
|
+
function curveMetricsValue(
|
|
1195
|
+
bond: Bond,
|
|
1196
|
+
curve: YieldCurve,
|
|
1197
|
+
options: CurvePricingOptions,
|
|
1198
|
+
): CurveMetrics {
|
|
1199
|
+
requireArgumentObject('curveMetrics', 'curve', curve);
|
|
1200
|
+
requireCurveInstance(curve, 'curveMetrics');
|
|
1201
|
+
requireArgumentObject('curveMetrics', 'options', options);
|
|
1202
|
+
ensureKnownKeys('curveMetrics', 'options', options, CURVE_PRICING_OPTIONS_KEYS);
|
|
1203
|
+
requireAnalyticsOptionLadders('curveMetrics', options as unknown as Record<string, unknown>);
|
|
1204
|
+
requireArgumentObject('curveMetrics', 'bond', bond);
|
|
1205
|
+
requireBondInstance(bond, 'curveMetrics');
|
|
1206
|
+
if (
|
|
1207
|
+
options.context !== undefined &&
|
|
1208
|
+
(options.context === null || typeof options.context !== 'object')
|
|
1209
|
+
) {
|
|
1210
|
+
throw new InputError(
|
|
1211
|
+
`curveMetrics: context must be a projection-context object when provided. Received ${options.context === null ? 'null' : typeof options.context}.`,
|
|
1212
|
+
{ code: ErrorCode.InputWrongType, context: { field: 'context' } },
|
|
1213
|
+
);
|
|
1214
|
+
}
|
|
1215
|
+
if (
|
|
1216
|
+
options.bump !== undefined &&
|
|
1217
|
+
(typeof options.bump !== 'number' || !Number.isFinite(options.bump))
|
|
1218
|
+
) {
|
|
1219
|
+
throw new InputError(
|
|
1220
|
+
`curveMetrics: bump must be a finite rate shift when provided (1e-4 = one basis point). Received ${options.bump === null ? 'null' : typeof options.bump}.`,
|
|
1221
|
+
{ code: ErrorCode.InputWrongType, context: { field: 'bump' } },
|
|
1222
|
+
);
|
|
1223
|
+
}
|
|
1224
|
+
const context = options.context ?? {};
|
|
1225
|
+
const bump = options.bump ?? 1e-4;
|
|
1226
|
+
const settle = options.settlementDate;
|
|
1227
|
+
const p0 = dirtyFromCurve(bond, curve, settle, context);
|
|
1228
|
+
const pUp = dirtyFromCurve(bond, curve.shift(bump), settle, context);
|
|
1229
|
+
const pDn = dirtyFromCurve(bond, curve.shift(-bump), settle, context);
|
|
1230
|
+
const effectiveDuration = p0 === 0 ? 0 : (pDn - pUp) / (2 * p0 * bump);
|
|
1231
|
+
const effectiveConvexity = p0 === 0 ? 0 : (pUp + pDn - 2 * p0) / (p0 * bump * bump);
|
|
1232
|
+
const dv01 = effectiveDuration * p0 * 1e-4;
|
|
1233
|
+
const keyRateDurations = curve.pillars.map((pillar, i) => {
|
|
1234
|
+
const up = dirtyFromCurve(bond, curve.bumpPillar(i, bump), settle, context);
|
|
1235
|
+
const dn = dirtyFromCurve(bond, curve.bumpPillar(i, -bump), settle, context);
|
|
1236
|
+
return {
|
|
1237
|
+
tenorYears: pillar.tenorYears,
|
|
1238
|
+
date: pillar.date,
|
|
1239
|
+
duration: p0 === 0 ? 0 : (dn - up) / (2 * p0 * bump),
|
|
1240
|
+
};
|
|
1241
|
+
});
|
|
1242
|
+
const accruedInterest = bond.accrued(settle, context);
|
|
1243
|
+
return {
|
|
1244
|
+
dirtyPrice: p0,
|
|
1245
|
+
cleanPrice: p0 - accruedInterest,
|
|
1246
|
+
accruedInterest,
|
|
1247
|
+
effectiveDuration,
|
|
1248
|
+
effectiveConvexity,
|
|
1249
|
+
dv01,
|
|
1250
|
+
keyRateDurations,
|
|
1251
|
+
assumptions: bondAssumptions(bond, settle, 'curve'),
|
|
1252
|
+
diagnostics: { method: 'finite-difference', warnings: couponRateWarnings(bond) },
|
|
1253
|
+
};
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1256
|
+
/**
|
|
1257
|
+
* Price a bond against a discount curve and report effective/key-rate risk from curve shocks.
|
|
1258
|
+
* Facade (dx §2.7): the plain call returns the rich {@link CurveMetrics}; `.explain()` wraps the
|
|
1259
|
+
* same result in the core envelope with the conventions echoed at the top level.
|
|
1260
|
+
*/
|
|
1261
|
+
export const curveMetrics = bondFacade(
|
|
1262
|
+
'curveMetrics',
|
|
1263
|
+
curveMetricsValue,
|
|
1264
|
+
(bond: Bond, curve: YieldCurve, options: CurvePricingOptions): BondComputed<CurveMetrics> => {
|
|
1265
|
+
const metrics = curveMetricsValue(bond, curve, options);
|
|
1266
|
+
return { value: metrics, assumptions: metrics.assumptions, diagnostics: metrics.diagnostics };
|
|
1267
|
+
},
|
|
1268
|
+
);
|
|
1269
|
+
|
|
1270
|
+
/** The options shape `priceMultiCurve` accepts (Law 12 — mirrors the parameter type; keep in sync). */
|
|
1271
|
+
const MULTI_CURVE_PRICING_OPTIONS_KEYS = [
|
|
1272
|
+
'settlementDate',
|
|
1273
|
+
'discountCurve',
|
|
1274
|
+
'forecastCurve',
|
|
1275
|
+
'knownFixingRate',
|
|
1276
|
+
] as const;
|
|
1277
|
+
|
|
1278
|
+
/**
|
|
1279
|
+
* Price a bond with separate discount and forecast curves (multi-curve framework, no shock).
|
|
1280
|
+
*
|
|
1281
|
+
* `knownFixingRate` is the FRN in-progress coupon's observed reset — see
|
|
1282
|
+
* {@link ProjectionContext.knownFixingRate}. It is surfaced here because this is the multi-curve
|
|
1283
|
+
* pricing front door: without it, an FRN settled between two coupon dates could not be priced
|
|
1284
|
+
* through the function most callers reach for.
|
|
1285
|
+
*/
|
|
1286
|
+
export function priceMultiCurve(
|
|
1287
|
+
bond: Bond,
|
|
1288
|
+
options: {
|
|
1289
|
+
settlementDate: string;
|
|
1290
|
+
discountCurve: YieldCurve;
|
|
1291
|
+
forecastCurve?: YieldCurve;
|
|
1292
|
+
knownFixingRate?: number;
|
|
1293
|
+
},
|
|
1294
|
+
): BondPrice {
|
|
1295
|
+
// The bond is an OPEN structural artifact (manifest policy, C05): consumed fields run their
|
|
1296
|
+
// ladders, decoration is preserved. The options request stays closed.
|
|
1297
|
+
validateClosedRequest('priceMultiCurve', bond, PRICE_MULTI_CURVE_BOND_SPEC, {
|
|
1298
|
+
argumentName: 'bond',
|
|
1299
|
+
open: true,
|
|
1300
|
+
exampleCall: ANALYTICS_EXAMPLE,
|
|
1301
|
+
});
|
|
1302
|
+
validateClosedRequest('priceMultiCurve', options, PRICE_MULTI_CURVE_OPTIONS_SPEC, {
|
|
1303
|
+
argumentName: 'options',
|
|
1304
|
+
exampleCall: ANALYTICS_EXAMPLE,
|
|
1305
|
+
});
|
|
1306
|
+
requireArgumentObject('priceMultiCurve', 'options', options);
|
|
1307
|
+
ensureKnownKeys('priceMultiCurve', 'options', options, MULTI_CURVE_PRICING_OPTIONS_KEYS);
|
|
1308
|
+
requireArgumentObject('priceMultiCurve', 'bond', bond);
|
|
1309
|
+
requireBondInstance(bond, 'priceMultiCurve');
|
|
1310
|
+
// A missing/raw discountCurve would die on the first discount() call — teach at the boundary.
|
|
1311
|
+
requireArgumentObject('priceMultiCurve', 'options.discountCurve', options.discountCurve);
|
|
1312
|
+
requireCurveInstance(options.discountCurve, 'priceMultiCurve');
|
|
1313
|
+
if (options.forecastCurve !== undefined) {
|
|
1314
|
+
requireCurveInstance(options.forecastCurve, 'priceMultiCurve');
|
|
1315
|
+
}
|
|
1316
|
+
const context: ProjectionContext = {
|
|
1317
|
+
...(options.forecastCurve ? { forecastCurve: options.forecastCurve } : {}),
|
|
1318
|
+
...(options.knownFixingRate !== undefined ? { knownFixingRate: options.knownFixingRate } : {}),
|
|
1319
|
+
};
|
|
1320
|
+
const flows = bond.futureCashflows(options.settlementDate, context);
|
|
1321
|
+
const dfSettle = options.discountCurve.discount(options.settlementDate);
|
|
1322
|
+
let pv = 0;
|
|
1323
|
+
for (const cf of flows) {
|
|
1324
|
+
pv += cf.amount * (options.discountCurve.discount(cf.paymentDate) / dfSettle);
|
|
1325
|
+
}
|
|
1326
|
+
const accruedInterest = bond.accrued(options.settlementDate, context);
|
|
1327
|
+
return {
|
|
1328
|
+
dirtyPrice: pv,
|
|
1329
|
+
cleanPrice: pv - accruedInterest,
|
|
1330
|
+
accruedInterest,
|
|
1331
|
+
assumptions: bondAssumptions(bond, options.settlementDate, 'curve'),
|
|
1332
|
+
diagnostics: { method: 'closed-form', warnings: couponRateWarnings(bond) },
|
|
1333
|
+
};
|
|
1334
|
+
}
|
|
1335
|
+
|
|
1336
|
+
// ---- yield to call ----
|
|
1337
|
+
|
|
1338
|
+
export interface CallFeature {
|
|
1339
|
+
/** First/earliest call date. */
|
|
1340
|
+
callDate: string;
|
|
1341
|
+
/**
|
|
1342
|
+
* Call (redemption) price. Default: the OUTSTANDING notional at the call date, derived from the
|
|
1343
|
+
* bond's cash-flow schedule — the face value for a bullet bond, the un-amortized balance for an
|
|
1344
|
+
* amortizing bond. Pass explicitly for premium calls (e.g. 102) or when the outstanding balance
|
|
1345
|
+
* is not derivable from the schedule.
|
|
1346
|
+
*/
|
|
1347
|
+
callPrice?: number;
|
|
1348
|
+
}
|
|
1349
|
+
|
|
1350
|
+
/**
|
|
1351
|
+
* Yield to call: the yield that reprices the bond to the observed price assuming it is redeemed at the
|
|
1352
|
+
* call date for the call price. Builds a synthetic bond truncated at the call date: scheduled coupons
|
|
1353
|
+
* AND amortization payments before the call date are received as contracted; at the call date the
|
|
1354
|
+
* issuer repays the call price in place of any scheduled principal.
|
|
1355
|
+
*/
|
|
1356
|
+
interface YieldToCallSolved {
|
|
1357
|
+
value: number;
|
|
1358
|
+
iterations: number;
|
|
1359
|
+
/** The redemption actually used at the call date (explicit `callPrice`, or the outstanding notional). */
|
|
1360
|
+
resolvedCallPrice: number;
|
|
1361
|
+
accruedInterest: number;
|
|
1362
|
+
priceType: 'clean' | 'dirty';
|
|
1363
|
+
}
|
|
1364
|
+
|
|
1365
|
+
function solveYieldToCall(
|
|
1366
|
+
functionName: string,
|
|
1367
|
+
bond: Bond,
|
|
1368
|
+
call: CallFeature,
|
|
1369
|
+
options: YieldFromPriceOptions,
|
|
1370
|
+
): YieldToCallSolved {
|
|
1371
|
+
validateClosedRequest(functionName, bond, YIELD_TO_CALL_BOND_SPEC, {
|
|
1372
|
+
argumentName: 'bond',
|
|
1373
|
+
open: true,
|
|
1374
|
+
exampleCall: ANALYTICS_EXAMPLE,
|
|
1375
|
+
});
|
|
1376
|
+
validateClosedRequest(functionName, call, YIELD_TO_CALL_CALL_SPEC, {
|
|
1377
|
+
argumentName: 'call',
|
|
1378
|
+
exampleCall: ANALYTICS_EXAMPLE,
|
|
1379
|
+
});
|
|
1380
|
+
validateClosedRequest(functionName, options, YIELD_TO_CALL_OPTIONS_SPEC, {
|
|
1381
|
+
argumentName: 'options',
|
|
1382
|
+
exampleCall: ANALYTICS_EXAMPLE,
|
|
1383
|
+
});
|
|
1384
|
+
requireBondInstance(bond, functionName);
|
|
1385
|
+
const context = options.context ?? {};
|
|
1386
|
+
const future = bond.futureCashflows(options.settlementDate, context);
|
|
1387
|
+
// Every scheduled flow up to (and including) the call date is received as-is — zeroing pre-call
|
|
1388
|
+
// principal would silently misprice amortizing callables (their principal comes back early).
|
|
1389
|
+
const flows = future
|
|
1390
|
+
.filter((cf) => compareDates(cf.date, call.callDate) <= 0)
|
|
1391
|
+
.map((cf) => ({ ...cf }));
|
|
1392
|
+
let resolvedCallPrice: number;
|
|
1393
|
+
const callFlow = flows.find((cf) => cf.date === call.callDate);
|
|
1394
|
+
if (callFlow) {
|
|
1395
|
+
// Redemption replaces the scheduled principal at the call date: the issuer repays the WHOLE
|
|
1396
|
+
// balance outstanding over that period (`notional`) — the face value for a bullet bond.
|
|
1397
|
+
const callPrice = call.callPrice ?? callFlow.notional;
|
|
1398
|
+
resolvedCallPrice = callPrice;
|
|
1399
|
+
callFlow.principal = callPrice;
|
|
1400
|
+
callFlow.amount = callFlow.interest + callPrice;
|
|
1401
|
+
} else {
|
|
1402
|
+
// Call between coupon dates: the outstanding balance is the notional accruing over the period
|
|
1403
|
+
// containing the call date — the next scheduled flow's notional.
|
|
1404
|
+
const next = future.find((cf) => compareDates(cf.date, call.callDate) > 0);
|
|
1405
|
+
const callPrice = call.callPrice ?? next?.notional;
|
|
1406
|
+
if (callPrice === undefined) {
|
|
1407
|
+
throw new InputError(
|
|
1408
|
+
`${functionName}: cannot derive the outstanding notional at the call date ${call.callDate} ` +
|
|
1409
|
+
'(no scheduled cash flow on or after it) — pass an explicit call.callPrice.\n' +
|
|
1410
|
+
" e.g. yieldToCall(bond, { callDate: '2031-01-01', callPrice: 100 }, options)",
|
|
1411
|
+
{ code: ErrorCode.InputMissingField, context: { callDate: call.callDate } },
|
|
1412
|
+
);
|
|
1413
|
+
}
|
|
1414
|
+
// A mid-period call still pays the coupon ACCRUED since the last coupon date — the issuer
|
|
1415
|
+
// cannot redeem and keep the interest the holder has already earned. Omitting it silently
|
|
1416
|
+
// understated every mid-period YTC (a 6% par bond called a month after a coupon solved to 0%:
|
|
1417
|
+
// pay 100, receive 100, earn nothing). `bond.accrued` is the same partial-period computation
|
|
1418
|
+
// the settlement accrued uses, so the day count and the projected coupon match by construction.
|
|
1419
|
+
resolvedCallPrice = callPrice;
|
|
1420
|
+
const accruedAtCall = bond.accrued(call.callDate, context);
|
|
1421
|
+
flows.push({
|
|
1422
|
+
date: call.callDate,
|
|
1423
|
+
paymentDate: call.callDate,
|
|
1424
|
+
interest: accruedAtCall,
|
|
1425
|
+
principal: callPrice,
|
|
1426
|
+
amount: callPrice + accruedAtCall,
|
|
1427
|
+
notional: next?.notional ?? callPrice,
|
|
1428
|
+
});
|
|
1429
|
+
}
|
|
1430
|
+
if (flows.length === 0) {
|
|
1431
|
+
throw new InputError(
|
|
1432
|
+
`${functionName}: No cash flows up to the call date — cannot solve yield to call.`,
|
|
1433
|
+
{
|
|
1434
|
+
code: ErrorCode.InputOutOfRange,
|
|
1435
|
+
context: { callDate: call.callDate },
|
|
1436
|
+
},
|
|
1437
|
+
);
|
|
1438
|
+
}
|
|
1439
|
+
const accruedInterest = bond.accrued(options.settlementDate, context);
|
|
1440
|
+
const targetDirty =
|
|
1441
|
+
resolvePriceType(options.priceType) === 'dirty'
|
|
1442
|
+
? options.price
|
|
1443
|
+
: options.price + accruedInterest;
|
|
1444
|
+
const f = bond.frequency;
|
|
1445
|
+
const objective = (y: number): number =>
|
|
1446
|
+
dirtyFromYield(flows, options.settlementDate, y, f, bond.dayCount) - targetDirty;
|
|
1447
|
+
const solved = solveYieldBracketed(objective, f, functionName, {
|
|
1448
|
+
targetPrice: options.price,
|
|
1449
|
+
callDate: call.callDate,
|
|
1450
|
+
settlementDate: options.settlementDate,
|
|
1451
|
+
});
|
|
1452
|
+
return {
|
|
1453
|
+
value: solved.value,
|
|
1454
|
+
iterations: solved.iterations,
|
|
1455
|
+
resolvedCallPrice,
|
|
1456
|
+
accruedInterest,
|
|
1457
|
+
priceType: resolvePriceType(options.priceType),
|
|
1458
|
+
};
|
|
1459
|
+
}
|
|
1460
|
+
|
|
1461
|
+
/** {@link yieldToCall}.explain assumptions: the bond conventions plus the call/price basis echo. */
|
|
1462
|
+
export type YieldToCallAssumptions = BondAssumptions & {
|
|
1463
|
+
callDate: string;
|
|
1464
|
+
/** Whether `options.price` was read as a clean or dirty price. */
|
|
1465
|
+
priceType: 'clean' | 'dirty';
|
|
1466
|
+
};
|
|
1467
|
+
|
|
1468
|
+
export type YieldToCallFacade = ((
|
|
1469
|
+
bond: Bond,
|
|
1470
|
+
call: CallFeature,
|
|
1471
|
+
options: YieldFromPriceOptions,
|
|
1472
|
+
) => number) & {
|
|
1473
|
+
explain: (
|
|
1474
|
+
bond: Bond,
|
|
1475
|
+
call: CallFeature,
|
|
1476
|
+
options: YieldFromPriceOptions,
|
|
1477
|
+
) => Omit<Computed<number>, 'assumptions'> & { assumptions: YieldToCallAssumptions };
|
|
1478
|
+
};
|
|
1479
|
+
|
|
1480
|
+
/**
|
|
1481
|
+
* Yield to a call date (H05): the plain call returns the scalar; `.explain()` mirrors
|
|
1482
|
+
* `yieldToMaturity.explain()` — solver facts in diagnostics, the resolved call price and
|
|
1483
|
+
* settlement accrued in the decomposition, and the call/price basis echoed in assumptions.
|
|
1484
|
+
*/
|
|
1485
|
+
export const yieldToCall = bondFacade(
|
|
1486
|
+
'yieldToCall',
|
|
1487
|
+
(bond: Bond, call: CallFeature, options: YieldFromPriceOptions): number =>
|
|
1488
|
+
solveYieldToCall('yieldToCall', bond, call, options).value,
|
|
1489
|
+
((bond: Bond, call: CallFeature, options: YieldFromPriceOptions) => {
|
|
1490
|
+
const solved = solveYieldToCall('yieldToCall.explain', bond, call, options);
|
|
1491
|
+
return {
|
|
1492
|
+
value: solved.value,
|
|
1493
|
+
assumptions: {
|
|
1494
|
+
...bondAssumptions(bond, options.settlementDate, 'actuarial'),
|
|
1495
|
+
callDate: call.callDate,
|
|
1496
|
+
priceType: solved.priceType,
|
|
1497
|
+
},
|
|
1498
|
+
diagnostics: {
|
|
1499
|
+
method: 'brent',
|
|
1500
|
+
converged: true,
|
|
1501
|
+
iterations: solved.iterations,
|
|
1502
|
+
decomposition: {
|
|
1503
|
+
resolvedCallPrice: solved.resolvedCallPrice,
|
|
1504
|
+
accruedInterest: solved.accruedInterest,
|
|
1505
|
+
},
|
|
1506
|
+
warnings: couponRateWarnings(bond),
|
|
1507
|
+
},
|
|
1508
|
+
};
|
|
1509
|
+
}) as unknown as (
|
|
1510
|
+
bond: Bond,
|
|
1511
|
+
call: CallFeature,
|
|
1512
|
+
options: YieldFromPriceOptions,
|
|
1513
|
+
) => BondComputed<number>,
|
|
1514
|
+
) as unknown as YieldToCallFacade;
|