portfolio-optimizer

Calculate optimal portfolio weights from expected returns and covariance matrices.

12|13|Updated Dec 4, 2025
One-click install
npx skills add https://github.com/Snowflake-Labs/sfguide-agentic-ai-for-asset-management --skill portfolio-optimizer-snowflake-labs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: portfolio-optimizer
Source: https://github.com/Snowflake-Labs/sfguide-agentic-ai-for-asset-management/tree/main/data/skills/portfolio-optimizer
Command: npx skills add https://github.com/Snowflake-Labs/sfguide-agentic-ai-for-asset-management --skill portfolio-optimizer-snowflake-labs

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires numpy, and includes scripts (resource) components.

What problem does it solve?

This skill solves the complex challenge of balancing investment portfolios by automating the calculation of optimal asset allocations based on specific risk-return objectives and constraints.

Core Features & Use Cases

  • Objective-Based Optimization: Calculate weights for maximum Sharpe ratio, minimum variance, or risk parity.
  • Constraint Management: Apply real-world investment constraints such as position caps, sector limits, and ESG requirements.
  • Use Case: A portfolio manager needs to rebalance a fund to minimize volatility while ensuring no single stock exceeds a 5% weight and the total tech sector exposure remains under 30%.

Quick Start

Use the portfolio-optimizer skill to calculate the maximum Sharpe ratio portfolio weights given the current expected returns and covariance matrix while applying a 5 percent position cap.

Frequently Asked Questions about portfolio-optimizer

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

FAQPage Schema
How do I optimize portfolio weights for maximum Sharpe ratio with position caps?

Portfolio optimization for maximum Sharpe ratio calculates asset weights using expected returns and covariance matrices while applying position caps. You can constrain individual asset exposure to specific percentage limits to enforce risk controls across the final allocation.

What is the best way to calculate efficient frontiers for institutional asset management?

Calculating efficient frontiers for institutional asset management involves deriving risk-adjusted allocations based on expected returns and covariance matrices. This approach supports complex financial constraints including sector limits and ESG scoring requirements to model target allocations.

Can I apply sector limits and ESG requirements when calculating minimum variance portfolios?

Calculating minimum variance portfolios supports applying sector limits and ESG scoring requirements. You can balance investment portfolios by automating optimal asset allocations based on specific risk-return objectives alongside these real-world investment constraints.

Do I need numpy to run portfolio optimization routines for risk parity?

Numpy is required to execute mathematical optimization routines for portfolio optimization. Risk parity calculations and other objective-based allocations depend on numpy to process covariance matrices and derive target portfolio metrics.

How does portfolio optimization handle complex financial constraints like position caps?

Portfolio optimization handles complex financial constraints by applying position caps and sector limits during weight calculation. It automates the balancing of investment portfolios to ensure allocations respect specific risk-return objectives and institutional mandates.