# Portfolio Sharpe Optimization AI Agent Connect

> Deterministic capital allocation engine for maximizing Sharpe ratio in prediction markets.

## Overview
- **Category:** finance
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_YldwIfyfbSPhdtZRlu17wOZOzpLiLEdAUSopvMnW/ai-agent-connect
- **Tags:** markowitz, sharpe-ratio, portfolio-management, prediction-markets, capital-allocation

## Description

This MCP server provides a deterministic capital allocation engine designed for prediction market participants. It uses Markowitz mean-variance optimization to calculate the exact weights needed to maximize the Sharpe ratio across multiple bets. Users can utilize `optimize_weights` to find optimal capital distribution, `get_efficient_frontier` to visualize risk-return trade-offs, and `analyze_risk_profile` to estimate maximum drawdown and receive automated rebalancing triggers when positions exceed 20% of the total portfolio.

## Tools

### analyze_risk_profile
Estimates the potential downside and provides rebalancing instructions

### get_efficient_frontier
Generates a series of optimal portfolios to visualize the trade-off between risk and return

### optimize_weights
Calculates the exact capital allocation required to maximize the portfolio's Sharpe ratio

## Prompt Examples

**Prompt:** 
```
Calculate the optimal weights for these three markets: EVs of 0.15, 0.20, and 0.10; variances of 0.05, 0.06, and 0.04; a correlation matrix of [[1,0,0],[0,1,0],[0,0,1]]; and 1000 total capital.
```

**Response:** 
```
The optimal allocation for your $1000 capital is: Market 1: $350.50, Market 2: $420.25, Market 3: $229.25. This configuration maximizes your Sharpe ratio based on the provided parameters.
```

**Prompt:** 
```
What is my expected maximum drawdown if my current weights are {'market_a': 500, 'market_b': 500} with EVs of [0.1, 0.12], variances of [0.05, 0.05], and zero correlation?
```

**Response:** 
```
Based on your current holdings and market statistics, the estimated maximum drawdown is 8.4%.
```

**Prompt:** 
```
Show me the efficient frontier for markets with EVs [0.2, 0.3], variances [0.04, 0.09], and a correlation of 0.2.
```

**Response:** 
```
The efficient frontier has been calculated. The minimum variance portfolio offers an expected return of 0.22 with a volatility of 0.18, while the maximum return portfolio offers 0.30 with a volatility of 0.32.
```

## Frequently Asked Questions

**How does the optimizer determine capital allocation?**
The engine uses Markowitz mean-variance optimization to solve for weights that maximize the Sharpe ratio, considering the expected values, variances, and correlations of all provided markets.

**What triggers a rebalancing action?**
A rebalance action is automatically suggested via `analyze_risk_profile` if any single position grows to exceed 20% of the total portfolio value due to market price appreciation.

**Can I visualize the risk-return trade-off?**
Yes, you can use the `get_efficient_frontier` tool to generate a series of optimal portfolios that map the relationship between volatility and expected return.
