@railpath/finance-toolkit
Version:
Production-ready finance library for portfolio construction, risk analytics, quantitative metrics, and ML-based regime detection
37 lines (36 loc) • 1.21 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PortfolioRebalancingOptionsSchema = void 0;
const zod_1 = require("zod");
exports.PortfolioRebalancingOptionsSchema = zod_1.z.object({
/**
* Current portfolio weights
*/
currentWeights: zod_1.z.array(zod_1.z.number()).min(2),
/**
* Target portfolio weights
*/
targetWeights: zod_1.z.array(zod_1.z.number()).min(2),
/**
* Current portfolio value
*/
portfolioValue: zod_1.z.number().positive(),
/**
* Rebalancing method
* - 'proportional': Scale all weights proportionally
* - 'fixed': Rebalance to exact target weights
*/
method: zod_1.z.enum(['proportional', 'fixed']).default('fixed'),
/**
* Minimum trade size (as percentage of portfolio value)
*/
minTradeSize: zod_1.z.number().min(0).max(1).default(0.001), // 0.1% default
/**
* Transaction costs (as percentage of trade value)
*/
transactionCosts: zod_1.z.number().min(0).max(1).default(0), // 0% default
/**
* Whether to consider transaction costs in calculations
*/
includeTransactionCosts: zod_1.z.boolean().default(false),
});