{"uid":"cap__gRQEmkOIFJYK7gqYBdv0","slug":"investing-math-period-return-statistics-28d337f1","name":"Investing Math – Period Return Statistics","description":"Performance stats from period returns: average, volatility, Sharpe, Sortino, compound growth and max drawdown.","url":"https://invest-math.x402tookit.com/return-stats?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":["returnsPct"],"properties":{"returnsPct":{"type":"string","description":"Period returns in percent, comma separated, at least 3"},"riskFreePct":{"type":"number","description":"Annual risk-free rate in percent, default 0"},"periodsPerYear":{"type":"integer","description":"12 monthly (default), 52 weekly, 252 daily, 4 quarterly, 1 yearly"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"asOf":{"type":["null","string"]},"sharpe":{"type":["null","number"]},"source":{"type":["null","string"]},"cagrPct":{"type":["null","number"]},"periods":{"type":["null","number"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"sortino":{"type":["null","number"]},"summary":{"type":["null","string"]},"verdict":{"type":["null","string"]},"degraded":{"type":["boolean","null"]},"disclaimer":{"type":["null","string"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"winRatePct":{"type":["null","number"]},"bestPeriodPct":{"type":["null","number"]},"meanReturnPct":{"type":["null","number"]},"maxDrawdownPct":{"type":["null","number"]},"totalReturnPct":{"type":["null","number"]},"worstPeriodPct":{"type":["null","number"]},"annualisedMeanPct":{"type":["null","number"]},"volatilityPerPeriodPct":{"type":["null","number"]},"annualisedVolatilityPct":{"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_YcRP_K8Gkotfu4rJ99sRo","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 performance statistics from a series of period returns: mean, volatility, Sharpe ratio, Sortino ratio, CAGR, max drawdown, win rate, and more.","exampleAgentPrompt":"Calculate the performance stats for my monthly portfolio returns — 2.1, -1.3, 3.4, 0.8, -2.0, 1.5, 4.2, -0.5, 2.8, 1.1, -1.8, 3.0 — using a 4% annual risk-free rate and 12 periods per year. I want the Sharpe, Sortino, CAGR, max drawdown, and volatility.","exampleUseCases":[{"title":"Evaluating a stock strategy backtest","prompt":"I have monthly returns from my momentum strategy backtest: 1.2, -0.8, 2.5, 3.1, -1.5, 0.9, 4.0, -2.2, 1.7, 0.4, 3.3, -0.6. Can you calculate the Sharpe ratio, Sortino ratio, annualised volatility, and max drawdown using a 4.5% risk-free rate and 12 periods per year?"},{"title":"Comparing weekly trading returns","prompt":"Here are my weekly trading returns for the past quarter: 0.5, -0.3, 1.1, 0.8, -1.2, 2.0, -0.4, 0.9, 1.5, -0.7, 0.2, 1.3, -0.9. Run the full stats with 52 periods per year and 0% risk-free rate — I want to see CAGR, win rate, Sharpe, and max drawdown."},{"title":"Reviewing daily returns for a hedge fund pitch","prompt":"I need to summarize the risk-adjusted performance of a strategy for a fund pitch. The daily returns are: 0.15, -0.22, 0.31, 0.05, -0.18, 0.42, -0.11, 0.28, 0.09, -0.35, 0.19, 0.23. Use 252 periods per year and a 5% annual risk-free rate and give me Sharpe, Sortino, CAGR, and volatility."}],"resultDescription":"A JSON object with comprehensive performance metrics including: mean return per period, annualised mean, volatility per period, annualised volatility, Sharpe ratio, Sortino ratio, CAGR (cagrPct), max drawdown, total return, win rate, best and worst period, plus a summary verdict and any warnings about data quality (degraded flag, reasons, disclaimer).","failureModes":["Fewer than 3 returns provided — endpoint requires at least 3 data points","Non-numeric values in returnsPct string cause parsing errors","Invalid periodsPerYear value (e.g. 0 or negative) causes computation failure","Missing required returnsPct parameter returns an error response","Sortino ratio may be null if there are no negative periods (no downside deviation)"],"whenToPreferThis":"Use this endpoint when you need a comprehensive suite of investment performance metrics computed from a raw list of period returns in a single call. It is ideal for backtesting analysis, strategy evaluation, or portfolio reporting where you need risk-adjusted ratios (Sharpe, Sortino), growth metrics (CAGR), and drawdown figures together. Prefer it over manual calculation or multi-step pipelines when your data is already in percent-return series form.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-30T00:34:28.519Z","isFirstParty":false,"canonicalSlug":"investing-math-period-return-statistics-28d337f1"}