{"uid":"cap_V41FTz4E7OcsQHz9sW5a-","slug":"api-quantoracle-dev-b912cb48","name":"QuantOracle Portfolio Health","description":"QuantOracle: /v1/portfolio/health","url":"https://api.quantoracle.dev/v1/portfolio/health","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method","bodyType","body"],"properties":{"body":{"type":"object","title":"PortfolioHealthIn","required":["holdings"],"properties":{"holdings":{"type":"array","items":{"type":"object","title":"PortfolioHoldingItem","required":["asset","value","target_weight","returns"],"properties":{"beta":{"type":"number","title":"Beta","default":1,"description":"Market beta (for stress test)"},"asset":{"type":"string","title":"Asset","description":"Asset name"},"value":{"type":"number","title":"Value","description":"Current market value"},"returns":{"type":"array","items":{"type":"number"},"title":"Returns","minItems":5,"description":"Daily returns for this asset"},"duration":{"type":"number","title":"Duration","default":0,"description":"Bond duration (for rate stress)"},"target_weight":{"type":"number","title":"Target Weight","description":"Target allocation weight (%)"}}},"title":"Holdings","minItems":2,"description":"Portfolio holdings"},"min_trade_usd":{"type":"number","title":"Min Trade Usd","default":100,"description":"Minimum trade size in USD"},"risk_free_rate":{"type":"number","title":"Risk Free Rate","default":0.05,"description":"Annual risk-free rate"},"rebalance_threshold_pct":{"type":"number","title":"Rebalance Threshold Pct","default":5,"description":"Drift threshold to trigger rebalance (%)"}}},"type":{"type":"string","const":"http"},"method":{"enum":["POST","PUT","PATCH"],"type":"string"},"bodyType":{"enum":["json","form-data","text"],"type":"string"}},"additionalProperties":false}}},"responseSchema":null,"example":{"request":{"holdings":[{"asset":"AAPL","value":40000,"returns":[0.05,0.03,-0.02,0.07,0.04],"target_weight":0.4},{"asset":"TLT","value":30000,"returns":[0.02,0.01,0.03,-0.01,0.02],"target_weight":0.3},{"asset":"GLD","value":30000,"returns":[0.01,0.04,0.02,-0.03,0.05],"target_weight":0.3}]},"response":{"ms":23.56,"risk":{"sharpe":31.087,"var_95":0.007,"max_drawdown":0,"annualized_vol":0.1866,"current_drawdown":0,"annualized_return":5.8464},"_meta":{"url":"https://quantoracle.dev","docs":"https://api.quantoracle.dev/docs","powered_by":"QuantOracle"},"n_periods":5,"rebalance":{"drifts":[{"asset":"AAPL","drift_pct":39.6,"target_weight":0.4,"current_weight":40},{"asset":"TLT","drift_pct":29.7,"target_weight":0.3,"current_weight":30},{"asset":"GLD","drift_pct":29.7,"target_weight":0.3,"current_weight":30}],"trades":[{"asset":"AAPL","action":"SELL","amount":39600},{"asset":"TLT","action":"SELL","amount":29700},{"asset":"GLD","action":"SELL","amount":29700}],"max_drift_pct":39.6,"needs_rebalance":true},"correlation":{"assets":["AAPL","TLT","GLD"],"matrix":[[1,-0.7748,-0.4441],[-0.7748,1,0.6563],[-0.4441,0.6563,1]],"volatilities":{"GLD":0.4944,"TLT":0.2407,"AAPL":0.5336}},"stress_test":[{"pnl":-40000,"pnl_pct":-40,"scenario":"2008 Crisis"},{"pnl":-10000,"pnl_pct":-10,"scenario":"Rate Hike +200bps"},{"pnl":-15000,"pnl_pct":-15,"scenario":"Flash Crash -15%"}],"portfolio_value":100000}},"exampleRequest":{"holdings":[{"asset":"AAPL","value":40000,"returns":[0.05,0.03,-0.02,0.07,0.04],"target_weight":0.4},{"asset":"TLT","value":30000,"returns":[0.02,0.01,0.03,-0.01,0.02],"target_weight":0.3},{"asset":"GLD","value":30000,"returns":[0.01,0.04,0.02,-0.03,0.05],"target_weight":0.3}]},"tags":["x402"],"displayCostAmount":"0.04","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","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.04/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.04","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.04","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_1zVwluCxdWMjIYLiHfltr","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.04","costPer":"request","priority":0,"asset":null,"unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Analyzes the overall health of a financial portfolio, returning risk metrics, diversification scores, and actionable diagnostics.","exampleAgentPrompt":"Run a portfolio health check on my current holdings: 40% BTC, 30% ETH, 20% SOL, and 10% USDC — give me the health score, diversification metrics, and any concentration warnings.","exampleUseCases":null,"resultDescription":"Returns a portfolio health score along with risk metrics, diversification analysis, concentration flags, and actionable diagnostics highlighting weaknesses or imbalances in the submitted portfolio.","failureModes":["Invalid or missing asset identifiers returns a 400 error","Weights that do not sum to 100% may trigger a validation error","Unsupported asset types return an error indicating unrecognized symbols","Empty or null portfolio payload returns a 422 unprocessable entity","Payment failure or insufficient USDC balance returns a 402 error"],"whenToPreferThis":"Use this endpoint when you need a holistic health assessment of a portfolio rather than a single metric. It is ideal for diagnosing diversification issues, concentration risk, and overall portfolio quality in one call. Prefer this over the risk/full-analysis endpoint when you want a summarized health score with diagnostics rather than deep-dive risk decomposition.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T00:47:20.303Z","isFirstParty":false}