{"uid":"cap_est7l9X6oCEap1DZN-fEB","slug":"treasury-portfolio-risk-analyzer-1d84cf79","name":"Treasury Portfolio Risk Analyzer","description":"Treasury Risk Analyzer — Deterministic treasury/portfolio risk analysis: volatility, Sharpe/Sortino/Calmar, VaR/CVaR, concentration (HHI), risk contribution, correlated stress scenarios.","url":"https://portfolio-risk-analyzer-g9ao.onrender.com/treasury-risk?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"returns":{"type":"object","additionalProperties":{"type":"array","items":{"type":"number"}}},"weights":{"type":"object","additionalProperties":{"type":"number"}},"baseCurrency":{"type":"string","default":"USD"},"riskFreeRate":{"type":"number","default":0},"periodsPerYear":{"type":"number","default":252},"sectorExposure":{"type":"object","additionalProperties":{"type":"number"}},"stressScenarios":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"shocks":{"type":"object","additionalProperties":{"type":"number"}}}}},"benchmarkReturns":{"type":"array","items":{"type":"number"}},"confidenceLevels":{"type":"array","items":{"type":"number"},"default":[0.95,0.99]},"currencyExposure":{"type":"object","additionalProperties":{"type":"number"}},"geographyExposure":{"type":"object","additionalProperties":{"type":"number"}},"minimumAcceptableReturn":{"type":"number","default":0}}},"responseSchema":{"type":"json","example":{"status":"success","warnings":["Some implied stress shocks were set to 0 because the historical relationship with the shocked sym..."],"portfolio":{"assets":5,"base_currency":"USD"},"timestamp":"2026-11-05T06:08:41.989Z","analysis_id":"76a84772-6734-4c27-88df-26702f37be08","stress_test":[{"name":"EUR -10% vs USD","propagation":{},"directShocks":{},"impliedShocks":{},"excludedDrivers":[],"portfolioImpact":-0.02854865948571069,"directOnlyImpact":-0.025,"unmatchedSymbols":[]}],"risk_metrics":{"hhi":0.2958000000000001,"beta":null,"calmar_ratio":0.02604240703810475,"max_drawdown":-0.06069587440031432,"sharpe_ratio":0.06906128441729663,"sortino_ratio":0.09688576748812007,"value_at_risk":{"0.95":{},"0.99":{}},"annualized_return":0.001580666666666668,"expected_shortfall":{"0.95":{},"0.99":{}},"annualized_volatility":0.02288788400047168,"diversification_ratio":1.257848902454925,"correlation_to_benchmark":null,"annualized_downside_deviation":0.01631474578410586},"concentration":{"asset":{"hhi":0.2958000000000001,"effectiveCount":3.380662609871534},"currency":{"hhi":0.4950000000000001,"effectiveCount":2.02020202020202}},"risk_contribution":{"USDC":0.00005250741794303742,"SUKUK":-0.01387419668716468,"EURCASH":0.810126104389689,"GBPCASH":0.2036955848795325,"USDCASH":0},"risk_classification":{"level":"LOW","score":13}}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.1","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.1/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.1","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.1","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_A7EMaa6tBX0pCmJgKXgiW","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.1","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Performs deterministic treasury/portfolio risk analysis including volatility, Sharpe/Sortino/Calmar ratios, VaR/CVaR, concentration (HHI), risk contribution, and correlated stress scenario testing.","exampleAgentPrompt":"Run a full treasury risk analysis on my portfolio — I have three assets (BTC, ETH, USDC) with weights 0.5, 0.3, 0.2 and daily returns data, using a risk-free rate of 0.05, 252 trading periods per year, and stress test against a 2008-style financial crisis scenario where BTC drops 40% and ETH drops 35%.","exampleUseCases":[{"title":"Crypto treasury stress test","prompt":"Analyze the risk of my crypto treasury: BTC at 50% weight, ETH at 30%, and stablecoins at 20%. I have 6 months of daily returns for each. Use a 5% risk-free rate, 252 periods per year, and run a stress scenario called 'crypto winter' where BTC drops 60% and ETH drops 55%. Give me VaR at 95% and 99% confidence and the Sharpe ratio."},{"title":"Multi-asset concentration analysis","prompt":"I want to check if my portfolio is too concentrated. I hold equities at 60%, bonds at 25%, and commodities at 15%, and I have their daily return histories. Can you calculate the HHI concentration score, Sortino ratio using a 0% minimum acceptable return, and each asset's risk contribution?"},{"title":"Quarterly treasury risk report","prompt":"Run a risk analysis on our company treasury portfolio — we hold USD at 40%, EUR at 35%, and GBP at 25% with monthly returns over the last year. Set periods per year to 12, risk-free rate to 0.04, and give me volatility, Calmar ratio, CVaR at 95% and 99%, and stress test results for a dollar strengthening scenario where EUR drops 10% and GBP drops 8%."}],"resultDescription":"Returns a structured risk report including: annualized volatility, Sharpe ratio, Sortino ratio, Calmar ratio, Value at Risk (VaR) and Conditional VaR (CVaR) at specified confidence levels, Herfindahl-Hirschman Index (HHI) for concentration, per-asset risk contributions, and profit/loss estimates for each named stress scenario.","failureModes":["Missing or mismatched returns/weights keys causing validation error","Insufficient data points in returns arrays for meaningful statistical computation","Weights not summing to 1.0 causing normalization issues","Invalid confidence levels (must be between 0 and 1)","Stress scenario shocks referencing asset keys not present in returns","All-zero or constant returns arrays causing division-by-zero in ratio calculations","Network timeout on the Render.com cold-start container"],"whenToPreferThis":"Choose this endpoint when you need deterministic, reproducible quantitative risk metrics for a treasury or investment portfolio — particularly when you need multiple risk measures in a single call (volatility, Sharpe/Sortino/Calmar, VaR/CVaR, concentration, stress scenarios). Prefer this over general-purpose analytics when you need structured financial risk output ready for treasury reporting or risk dashboards, and when you want correlated multi-asset stress testing alongside concentration analysis in one response.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-30T12:34:21.688Z","isFirstParty":false,"canonicalSlug":"treasury-portfolio-risk-analyzer-1d84cf79"}