{"uid":"cap_uyn0FloZC6eZPfqeeqqpK","slug":"api-quantoracle-dev-d114d464","name":"QuantOracle Risk Stress-Test","description":"QuantOracle: risk/stress-test","url":"https://api.quantoracle.dev/v1/risk/stress-test","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"positions":{"type":"array","items":{"type":"object","title":"Position","required":["asset","value"],"properties":{"beta":{"type":"number","title":"Beta","default":1,"description":"Market beta of the position"},"asset":{"type":"string","title":"Asset","description":"Asset name"},"value":{"type":"number","title":"Value","description":"Current position value in USD"},"duration":{"type":"number","title":"Duration","default":0,"description":"Bond duration (for fixed income)"}}},"title":"Positions","description":"Array of portfolio positions"},"scenarios":{"type":"array","items":{"type":"object","title":"Scenario","required":["name"],"properties":{"name":{"type":"string","title":"Name","description":"Scenario name"},"vol_shock_pct":{"type":"number","title":"Vol Shock Pct","default":0,"description":"Volatility shock as percentage"},"rate_shock_bps":{"type":"number","title":"Rate Shock Bps","default":0,"description":"Interest rate shock in basis points"},"market_shock_pct":{"type":"number","title":"Market Shock Pct","default":0,"description":"Equity market shock as percentage"}}},"title":"Scenarios","description":"Array of stress scenarios to evaluate"}}},"responseSchema":null,"example":{"request":{"positions":[{"beta":1.2,"asset":"AAPL","value":100000},{"asset":"BND","value":50000,"duration":5.5}],"scenarios":[{"name":"market_crash","vol_shock_pct":25,"market_shock_pct":-15},{"name":"rate_shock","rate_shock_bps":50}]},"response":{"ms":10.75,"_meta":{"url":"https://quantoracle.dev","docs":"https://api.quantoracle.dev/docs","powered_by":"QuantOracle"},"results":[{"pnl_pct":-17,"scenario":"market_crash","per_asset":[{"pnl":-18000,"asset":"AAPL","pnl_pct":-18},{"pnl":-7500,"asset":"BND","pnl_pct":-15}],"total_pnl":-25500},{"pnl_pct":-0.9167,"scenario":"rate_shock","per_asset":[{"pnl":0,"asset":"AAPL","pnl_pct":0},{"pnl":-1375,"asset":"BND","pnl_pct":-2.75}],"total_pnl":-1375}],"best_scenario":"rate_shock","worst_scenario":"market_crash","portfolio_value":150000}},"exampleRequest":{"positions":[{"beta":1.2,"asset":"AAPL","value":100000},{"asset":"BND","value":50000,"duration":5.5}],"scenarios":[{"name":"market_crash","vol_shock_pct":25,"market_shock_pct":-15},{"name":"rate_shock","rate_shock_bps":50}]},"tags":["x402"],"displayCostAmount":"0.008","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.008/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.008","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.008","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_TY8y5dvFs0sik_Q-bmJ26","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.008","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Runs stress-test scenarios on a financial portfolio to estimate potential losses and risk exposures under adverse market conditions","exampleAgentPrompt":"Run a stress test on my portfolio — I'm holding 40% BTC, 30% ETH, 20% SPY, and 10% gold — and simulate what happens under a severe crypto market crash scenario with a -60% shock to crypto assets and -20% to equities.","exampleUseCases":null,"resultDescription":"Returns quantitative stress-test results including estimated portfolio loss (absolute and percentage), per-asset contribution to losses, scenario-specific P&L breakdown, and risk exposure metrics under the specified adverse market conditions.","failureModes":["Invalid or missing portfolio weights that don't sum to 100% — returns validation error","Unrecognized asset tickers or unsupported instruments — returns asset not found error","Malformed stress scenario parameters or unsupported shock types — returns parameter error","Payment not settled or insufficient USDC balance — returns 402 Payment Required","Server overload or computation timeout for very large portfolios — returns 503 or timeout error"],"whenToPreferThis":"Use this endpoint when you need to quantitatively assess portfolio downside risk under user-defined or historical adverse scenarios. Prefer it over general analytics when the specific goal is stress testing — i.e., applying hypothetical market shocks to estimate losses — rather than descriptive statistics, option pricing, or regime classification. Particularly useful for risk management workflows, pre-trade analysis, and regulatory-style scenario analysis.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T00:51:12.820Z","isFirstParty":false}