portfolio-construction

Optimize portfolio allocation weights under turnover, liquidity, and mandate constraints.

Updated Feb 10, 2026
One-click install
npx skills add https://github.com/GhostOf0days/codex-quant-skills --skill portfolio-construction
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: portfolio-construction
Source: https://github.com/GhostOf0days/codex-quant-skills/tree/main/portfolio-construction
Command: npx skills add https://github.com/GhostOf0days/codex-quant-skills --skill portfolio-construction

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill addresses the challenge of creating practical investment portfolios that align with complex real-world constraints, moving beyond theoretical optimization to deliver tradeable allocations.

Core Features & Use Cases

  • Constraint-Aware Optimization: Optimizes portfolio weights while respecting turnover, liquidity, and mandate limitations.
  • Pre-Trade Analysis: Includes adjustments for transaction costs and market impact.
  • Robust Validation: Features diagnostics for risk, turnover, liquidity, and rebalance stability.
  • Use Case: When tasked with rebalancing an existing portfolio to incorporate new alpha signals while minimizing trading costs and adhering to specific investor mandates, this Skill provides the framework for a compliant and efficient execution.

Quick Start

Run the portfolio construction diagnostics script with the input file 'input.csv' and save the output to 'diagnostics.json'.

Frequently Asked Questions about portfolio-construction

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I optimize portfolio weights under turnover and liquidity constraints?

Portfolio optimization under turnover and liquidity constraints adjusts allocation weights by respecting mandate limitations and liquidity thresholds. It balances target allocations against realistic trading boundaries to ensure the resulting portfolio remains implementable without exceeding risk or compliance parameters.

What is pre-trade transaction cost analysis in portfolio construction?

Pre-trade transaction cost analysis in portfolio construction estimates the market impact and direct costs of proposed trades before execution. It adjusts target allocation weights to account for these costs, ensuring that the optimized portfolio retains its expected value after realistic trading expenses are applied.

How do I rebalance an existing portfolio with new alpha signals while minimizing trading costs?

Rebalancing with new alpha signals while minimizing trading costs involves running constraint-aware optimization that respects turnover limits and mandate compliance. The process applies pre-trade impact adjustments to align the new signals with your existing positions, reducing unnecessary churn and lowering execution costs.

Can I run portfolio risk attribution and factor exposure diagnostics using Python scripts?

Yes, you can run portfolio risk attribution and factor exposure diagnostics using deterministic Python scripts. These scripts process input CSV files to evaluate risk distribution across factors and generate a JSON output file containing detailed compliance and stability metrics for the constructed portfolio.

Does mandate compliance affect liquidity optimization during portfolio rebalancing?

Mandate compliance directly affects liquidity optimization by enforcing regulatory and investor-specific rules during weight allocation. The optimization process ensures that liquidity thresholds and turnover limits are met simultaneously with mandate constraints, preventing violations while maintaining efficient execution.

What are the limitations of theoretical portfolio optimization without transaction cost adjustments?

Theoretical portfolio optimization without transaction cost adjustments often produces untradeable allocations that ignore market impact and liquidity constraints. It can lead to excessive turnover and mandate violations, whereas constraint-aware optimization provides stable, compliant portfolios validated through pre-trade diagnostics.