{"uid":"cap_3gnQjZ9KvZ6UwDGzM_9lF","slug":"investing-math-two-asset-portfolio-risk-return-c68b8292","name":"Investing Math: Two-Asset Portfolio Risk & Return","description":"Return and volatility of a two-asset mix from each asset's return, volatility and correlation, plus the lowest-risk weight.","url":"https://invest-math.x402tookit.com/portfolio-risk?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"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"]},"volatilityPct":{"type":["null","number"]},"expectedReturnPct":{"type":["null","number"]},"minVarianceVolPct":{"type":["null","number"]},"returnPerUnitRisk":{"type":["null","number"]},"minVarianceWeightAPct":{"type":["null","number"]},"weightedAverageVolPct":{"type":["null","number"]},"diversificationBenefitPts":{"type":["null","number"]}}}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.02","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.02/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_GLmAtsI4Ry0m5D69DaZj6","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.02","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Computes the expected return, volatility, and minimum-variance weight for a two-asset portfolio given each asset's return, volatility, and their correlation.","exampleAgentPrompt":"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?","exampleUseCases":[{"title":"60/40 stock-bond risk check","prompt":"I have a portfolio that's 60% S&P 500 (expected return 9%, vol 18%) and 40% US Treasury bonds (expected return 3.5%, vol 6%), with a correlation of 0.05 between them. What's the blended expected return and volatility, and what allocation to stocks would minimize my total risk?"},{"title":"Crypto-gold diversification analysis","prompt":"I'm thinking of mixing Bitcoin (expected return 40%, yearly volatility 80%) with gold (expected return 6%, vol 15%), with a correlation of -0.2. If I put 30% in Bitcoin and 70% in gold, what's the portfolio's expected return and risk, and how much diversification benefit do I get?"},{"title":"Finding minimum-variance blend of two ETFs","prompt":"I want to combine a growth ETF (expected return 12%, volatility 22%) with a dividend ETF (expected return 7%, volatility 10%), and they have a correlation of 0.6. Can you calculate the risk and return for a 50/50 split and also tell me the weight in the growth ETF that minimizes total portfolio volatility?"}],"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-30T00:30:15.668Z","isFirstParty":false,"canonicalSlug":"investing-math-two-asset-portfolio-risk-return-c68b8292"}