UNPKG

@railpath/finance-toolkit

Version:

Production-ready finance library for portfolio construction, risk analytics, quantitative metrics, and ML-based regime detection

20 lines (19 loc) 708 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.TimeWeightedReturnOptionsSchema = void 0; const zod_1 = require("zod"); exports.TimeWeightedReturnOptionsSchema = zod_1.z.object({ /** * Array of portfolio values at the end of each period */ portfolioValues: zod_1.z.array(zod_1.z.number().positive()).min(2), /** * Array of cash flows (positive for inflows, negative for outflows) * Must have same length as portfolioValues */ cashFlows: zod_1.z.array(zod_1.z.number()).min(2), /** * Annualization factor (e.g., 252 for daily, 12 for monthly) */ annualizationFactor: zod_1.z.number().positive().default(252), });