# market2000.xyz Portfolio Optimizer

> market2000.xyz Portfolio Optimizer is a paid API for AI agents from market2000.xyz, paid per call via x402, $0.05/call, status unknown (last checked 2026-09-15).

Optimizes a portfolio allocation across given stock tickers to maximize Sharpe ratio or other objectives, returning weights, risk metrics, and benchmark comparisons

## Facts

- Endpoint: GET https://market2000.xyz/optimize_portfolio
- Price: $0.05/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/market2000-xyz-portfolio-optimizer-b9ac422b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_YHKnQPjRDqUod9_Yvez8G

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability market2000-xyz-portfolio-optimizer-b9ac422b
```

Example prompt: Optimize my portfolio across AAPL, MSFT, NVDA, and SPY over the past 1 year to maximize the Sharpe ratio, using a 4% risk-free rate, and tell me what weights to hold along with the expected return and volatility.

## When to prefer this

Choose this endpoint when you need quantitative mean-variance portfolio optimization (Sharpe-maximizing or similar) for a custom list of tickers with explicit risk metrics output. Prefer it over generic financial data APIs when you want a ready-made allocation recommendation rather than raw price data, and when you need a benchmark equal-weight comparison alongside the optimized result.

## Known failure modes

- Invalid or unrecognized ticker symbols — endpoint may return an error or omit the ticker
- Insufficient historical data for the requested period — may return partial results or error
- Payment failure via x402 — call rejected if USDC payment on Base is not confirmed
- Too few tickers provided — optimizer may fail to construct a meaningful portfolio
- Network or upstream data provider outage — stale or unavailable price data

## How this service works

An origin the crawlers already index. We count what AI agents try to buy, what they are refused, and what the AI companies take without sending anyone back. Sold per call in USDC.

## Output

Returns optimal portfolio allocation weights per ticker, Sharpe ratio, expected annual return, and annual volatility for the optimized portfolio, plus a benchmark equal-weight comparison showing its Sharpe ratio, volatility, and expected return — along with the optimization objective used, period, and risk-free rate assumed.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "queryParams"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "tickers"
     ],
     "properties": {
      "period": {
       "enum": [
        "6mo",
        "1y",
        "2y",
        "3y",
        "5y"
       ],
       "type": "string",
       "description": "Historical data window used to estimate returns and covariance (default: 1y)"
      },
      "tickers": {
       "type": "string",
       "description": "Comma-separated list of 2–30 ticker symbols (e.g. 'AAPL,MSFT,NVDA,SPY')"
      },
      "objective": {
       "enum": [
        "max_sharpe",
        "min_volatility",
        "max_return"
       ],
       "type": "string",
       "description": "Optimization objective (default: max_sharpe)"
      },
      "risk_free_rate": {
       "type": "number",
       "description": "Annual risk-free rate for Sharpe calculation (default: 0.04 = 4%)"
      }
     }
    }
   }
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "objective",
      "period",
      "tickers_used",
      "allocation",
      "metrics"
     ],
     "properties": {
      "cached": {
       "type": "boolean"
      },
      "period": {
       "type": "string"
      },
      "metrics": {
       "type": "object",
       "properties": {
        "sharpe_ratio": {
         "type": "number"
        },
        "annual_volatility": {
         "type": "number"
        },
        "expected_annual_return": {
         "type": "number"
        }
       }
      },
      "objective": {
       "type": "string"
      },
      "allocation": {
       "type": "object",
       "description": "Ticker → optimal weight (0–1)"
      },
      "fetched_at": {
       "type": "string"
      },
      "tickers_used": {
       "type": "array",
       "items": {
        "type": "string"
       }
      },
      "correlation_matrix": {
       "type": "object"
      },
      "benchmark_equal_weight": {
       "type": "object"
      }
     }
    }
   }
 
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "cached": false,
  "period": "1y",
  "metrics": {
   "sharpe_ratio": 1.402,
   "annual_volatility": 0.194,
   "expected_annual_return": 0.312
  },
  "objective": "max_sharpe",
  "allocation": {
   "SPY": 0.33,
   "AAPL": 0.54,
   "NVDA": 0.13
  },
  "fetched_at": "2026-06-07T10:00:00Z",
  "tickers_used": [
   "AAPL",
   "MSFT",
   "NVDA",
   "SPY"
  ],
  "risk_free_rate": 0.04,
  "benchmark_equal_weight": {
   "sharpe_ratio": 1.08,
   "annual_volatility": 0.213,
   "expected_annual_return": 0.271
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/market2000-xyz-portfolio-optimizer-b9ac422b/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from market2000.xyz](https://www.zero.xyz/host/market2000.xyz/llms.txt)
