UNPKG

@railpath/finance-toolkit

Version:

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

47 lines (46 loc) 1.3 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.PortfolioRebalancingResultSchema = void 0; const zod_1 = require("zod"); exports.PortfolioRebalancingResultSchema = zod_1.z.object({ /** * New portfolio weights after rebalancing */ newWeights: zod_1.z.array(zod_1.z.number()), /** * Trade amounts for each asset (positive = buy, negative = sell) */ tradeAmounts: zod_1.z.array(zod_1.z.number()), /** * Trade amounts as percentage of portfolio value */ tradePercentages: zod_1.z.array(zod_1.z.number()), /** * Total absolute trade amount */ totalTradeAmount: zod_1.z.number(), /** * Total transaction costs */ totalTransactionCosts: zod_1.z.number(), /** * Portfolio value after transaction costs */ portfolioValueAfterCosts: zod_1.z.number(), /** * Number of assets that need rebalancing */ assetsToRebalance: zod_1.z.number(), /** * Rebalancing method used */ method: zod_1.z.enum(['proportional', 'fixed']), /** * Whether rebalancing was actually needed */ rebalancingNeeded: zod_1.z.boolean(), /** * Portfolio turnover (sum of absolute trades / 2) */ turnover: zod_1.z.number(), });