# Portfolio Stats Return, risk and drawdown statistics computed on a price or return series that you supply. ## How to pay Machine-payable over x402. USDC on: Base (eip155:8453), Solana (solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp), Polygon (eip155:137), Arbitrum One (eip155:42161). No accounts. No API keys. No signup. The paying wallet is the account. ## Machine-readable - OpenAPI: https://portfolio-stats.x402tookit.com/openapi.json - x402 manifest: https://portfolio-stats.x402tookit.com/.well-known/x402 - Catalog (free): https://portfolio-stats.x402tookit.com/catalog - Health (free): https://portfolio-stats.x402tookit.com/health - Uptime (free): https://portfolio-stats.x402tookit.com/uptime ## Endpoints (10) ### GET /cagr — $0.02 Compound annual growth rate from start and end values over years, or dates, or periods. Arithmetic on your numbers, not advice. Params: startValue: number, endValue: number, years?: number, startDate?: string, endDate?: string, periods?: number, periodsPerYear?: integer Example: https://portfolio-stats.x402tookit.com/cagr?startValue=100&endValue=200&years=5 ### GET /correlation-beta — $0.02 Correlation, beta, R-squared and alpha of one return or price series against another you supply. Not advice. Params: a: string, b: string, kind?: string, unit?: string, periodsPerYear?: integer Example: https://portfolio-stats.x402tookit.com/correlation-beta?a=%5B0.012%2C-0.008%2C0.02%2C0.005%2C-0.015%2C0.01%5D&b=%5B0.01%2C-0.005%2C0.015%2C0.004%2C-0.01%2C0.006%5D&kind=returns ### GET /equity-curve — $0.02 Equity-curve summary of a price or return series you supply: CAGR, volatility, Sharpe, drawdown, best and worst period. Params: prices?: string, returns?: string, unit?: string, periodsPerYear?: integer, riskFreeRatePct?: number, startValue?: number Example: https://portfolio-stats.x402tookit.com/equity-curve?prices=%5B100%2C104%2C101%2C108%2C112%2C106%2C115%5D&periodsPerYear=12&riskFreeRatePct=2 ### GET /kelly — $0.02 Kelly criterion fraction for a stated win probability and payoff, with growth rate and overbet threshold. NOT advice. Params: p: number, b: number, a?: number, fractionOfKelly?: number Example: https://portfolio-stats.x402tookit.com/kelly?p=0.6&b=1 ### GET /max-drawdown — $0.02 Maximum drawdown of a price or return series you supply, with peak, trough and recovery indices or dates. Params: prices?: string, returns?: string, unit?: string, periodsPerYear?: integer, dates?: string Example: https://portfolio-stats.x402tookit.com/max-drawdown?prices=%5B100%2C120%2C90%2C110%2C130%2C104%5D&dates=2024-01-31%2C2024-02-29%2C2024-03-31%2C2024-04-30%2C2024-05-31%2C2024-06-30 ### GET /returns — $0.02 Simple and log returns from a price series you supply, with cumulative return. Educational arithmetic, not advice. Params: prices: string Example: https://portfolio-stats.x402tookit.com/returns?prices=%5B100%2C110%2C99%2C108.9%5D ### GET /rolling — $0.02 Rolling mean return and rolling annualized volatility over a window, from a price or return series you supply. Params: prices?: string, returns?: string, unit?: string, periodsPerYear?: integer, window: integer Example: https://portfolio-stats.x402tookit.com/rolling?returns=%5B0.01%2C-0.02%2C0.03%2C0.00%2C0.02%2C-0.01%5D&window=3 ### GET /sharpe-sortino — $0.02 Sharpe and Sortino ratios on a price or return series you supply, with your risk-free rate. Not advice. Params: prices?: string, returns?: string, unit?: string, periodsPerYear?: integer, riskFreeRatePct?: number Example: https://portfolio-stats.x402tookit.com/sharpe-sortino?returns=%5B0.02%2C-0.01%2C0.03%2C0.01%2C-0.02%2C0.015%5D&riskFreeRatePct=2&periodsPerYear=12 ### GET /value-at-risk — $0.02 ILLUSTRATIVE historical and parametric Value-at-Risk and expected shortfall from a return series you supply. Not advice. Params: prices?: string, returns?: string, unit?: string, periodsPerYear?: integer, confidencePct?: number, portfolioValue?: number Example: https://portfolio-stats.x402tookit.com/value-at-risk?returns=%5B-0.02%2C-0.01%2C0%2C0.01%2C0.02%2C0.015%2C-0.005%2C0.008%2C-0.012%2C0.004%5D&confidencePct=95&portfolioValue=10000 ### GET /volatility — $0.02 Annualized volatility (sample standard deviation of returns) from a price or return series you supply. Not advice. Params: prices?: string, returns?: string, unit?: string, periodsPerYear?: integer Example: https://portfolio-stats.x402tookit.com/volatility?returns=%5B0.01%2C-0.02%2C0.015%2C0.005%2C-0.01%5D&periodsPerYear=252 ## Terms EDUCATIONAL ARITHMETIC ON THE NUMBERS YOU SUPPLY. This service never fetches market data, never knows what any asset is, and never recommends buying, selling, holding or sizing anything. It is NOT investment, tax, legal or financial advice, and past or supplied returns do not predict future results. Value-at-Risk, Kelly and every ratio are illustrative formulas with well-known limits (normality, stationarity, estimation error), provided as is with no warranty.