# StockWaves Portfolio Optimizer

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

Optimizes a multi-asset portfolio by computing target position weights from per-asset signal strength, confidence, volatility, and regime inputs

## Facts

- Endpoint: POST https://stockwaves.net/api/portfolio/optimize
- Price: $0.05/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/stockwaves-portfolio-optimizer-0a021777
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_n86WPe5HjFplAErGB9-Ia

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 stockwaves-portfolio-optimizer-0a021777 -d '<json body>'
```

Example prompt: Optimize my portfolio: I'm long SPY with a strong signal of 0.8 and 70% confidence in a trend regime, neutral on QQQ at 0.1 with 50% confidence in a quiet regime, and short GLD at -0.6 with 80% confidence — cap each position at 40% of gross, enforce a gross limit of 1.0, and enable the correlation penalty.

## When to prefer this

Use this endpoint when you have a set of directional signals (alpha) across multiple assets and need to translate them into optimized position weights respecting risk constraints like gross/net exposure limits, per-symbol caps, and volatility adjustments. Ideal for quant agents running signal-to-portfolio pipelines across equities, crypto, or macro instruments, especially when regime metadata and confidence scores are available to improve sizing quality.

## Known failure modes

- Missing required 'assets' array returns 400 validation error
- 'target' values outside [-1,1] range may be rejected or clamped
- Assets array exceeding 50 items returns validation error
- Payment failure via x402/USDC returns 402 Payment Required
- Malformed config keys ignored silently or return 400
- Empty assets array returns validation error

## How this service works

Stateless portfolio optimizer — bring your own signals, get risk-constrained weights. POST {assets:[{symbol,target,confidence?,vol?,regime?}], config?} → optimized portfolio targets via inverse-vol weighting, confidence/conviction scaling, same-family correlation penalty, gross/net + per-symbol caps, regime haircut. Pure compute, no account data.

## Output

Returns optimized portfolio weights or allocations for each submitted asset symbol, respecting gross/net exposure limits, per-symbol caps, and optional adjustments for volatility, confidence, and regime. The output translates raw directional signals into actionable position sizes ready for execution.

## Example request

```json
{
 "assets": [
  {
   "vol": 0.15,
   "regime": "trend",
   "symbol": "SPY",
   "target": 0.5,
   "confidence": 0.8
  },
  {
   "vol": 0.18,
   "regime": "trend",
   "symbol": "QQQ",
   "target": 0.3,
   "confidence": 0.7
  },
  {
   "vol": 0.2,
   "regime": "chop",
   "symbol": "IWM",
   "target": -0.2,
   "confidence": 0.6
  }
 ],
 "config": {
  "net_limit": 0.8,
  "vol_power": 0.5,
  "gross_limit": 1,
  "decision_power": 1,
  "per_symbol_cap": 0.5,
  "confidence_power": 1,
  "min_trade_target": 0.05,
  "correlation_penalty_enabled": true
 }
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "assets": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "symbol",
     "target"
    ],
    "properties": {
     "vol": {
      "type": "number"
     },
     "regime": {
      "type": "string"
     },
     "symbol": {
      "type": "string"
     },
     "target": {
      "type": "number"
     },
     "confidence": {
      "type": "number"
     }
    }
   }
  },
  "config": {
   "type": "object"
  }
 }
}
```

## More

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