# Investing Math: Two-Asset Portfolio Risk & Return

> Investing Math: Two-Asset Portfolio Risk & Return is a paid API for AI agents from invest-math.x402tookit.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-30).

Computes the expected return, volatility, and minimum-variance weight for a two-asset portfolio given each asset's return, volatility, and their correlation.

## Facts

- Endpoint: GET https://invest-math.x402tookit.com/portfolio-risk?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-30
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/investing-math-two-asset-portfolio-risk-return-c68b8292
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_3gnQjZ9KvZ6UwDGzM_9lF

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 investing-math-two-asset-portfolio-risk-return-c68b8292
```

Example prompt: I'm holding 60% in stocks (expected return 9%, volatility 18%) and 40% in bonds (expected return 4%, volatility 6%), with a correlation of 0.1 — can you calculate the portfolio's expected return and volatility, and tell me what weight in stocks would minimize total risk?

## When to prefer this

Choose this endpoint when you need a fast, deterministic computation of two-asset portfolio statistics — expected return, volatility, and minimum-variance weight — without connecting to live market data. Ideal for scenario analysis, educational tools, or pre-trade allocation checks where the user already has estimates for returns, volatilities, and correlation. Prefer it over general financial data APIs when you need the minimum-variance optimization result and the diversification benefit metric explicitly returned.

## Known failure modes

- Missing required query parameters (weightA, returnAPct, returnBPct, volAPct, volBPct, correlation) return an error
- Correlation outside [-1, 1] range may produce invalid or undefined results
- weightA outside [0, 100] range may cause incorrect blending
- Payment not included or insufficient USDC causes 402 Payment Required response
- Negative volatility inputs are mathematically invalid and may trigger an error or undefined output

## How this service works

Return and volatility of a two-asset mix from each asset's return, volatility and correlation, plus the lowest-risk weight.

## Output

Returns the portfolio's expected return (%), total volatility (%), the minimum-variance weight for asset A (%), the weighted-average volatility before diversification, the diversification benefit in percentage points, and a return-per-unit-risk ratio. Also echoes back the input weights for both assets.

## 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"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "weightA",
      "returnAPct",
      "returnBPct",
      "volAPct",
      "volBPct",
      "correlation"
     ],
     "properties": {
      "volAPct": {
       "type": "number",
       "description": "Yearly volatility of A in percent"
      },
      "volBPct": {
       "type": "number",
       "description": "Yearly volatility of B in percent"
      },
      "weightA": {
       "type": "number",
       "description": "Share of asset A in percent, 0 to 100 (B is the rest)"
      },
      "returnAPct": {
       "type": "number",
       "description": "Expected yearly return of A in percent"
      },
      "returnBPct": {
       "type": "number",
       "description": "Expected yearly return of B in percent"
      },
      "correlation": {
       "type": "number",
       "description": "Correlation of A and B, -1 to 1"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "asOf": {
       "type": [
        "null",
        "string"
       ]
      },
      "source": {
       "type": [
        "null",
        "string"
       ]
      },
      "reasons": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "summary": {
       "type": [
        "null",
        "string"
       ]
      },
      "verdict": {
       "type": [
        "null",
        "string"
       ]
      },
      "degraded": {
       "type": [
        "boolean",
        "null"
       ]
      },
      "disclaimer": {
       "type": [
        "null",
        "string"
       ]
      },
      "notChecked": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "weightAPct": {
       "type": [
        "null",
        "number"
       ]
      },
      "weightBPct": {
       "type": [
        "null",
        "number"
      
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/investing-math-two-asset-portfolio-risk-return-c68b8292/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from invest-math.x402tookit.com](https://www.zero.xyz/host/invest-math.x402tookit.com/llms.txt)
