{"uid":"cap_DKjCH8Rib6Zefs3hZIA-e","slug":"agent402-uk-sharpe-ratio-calculator-9ae1332e","name":"Agent402 UK – Sharpe Ratio Calculator","description":"Don't burn tokens on deterministic work. Go/no-go jobs first: payout preflight, text firewall (PII/secrets), budget check — then rails, calendars, finmath. x402 USDC on Base. UK + global. agent402.co.uk — not agent402.tools. $0.001–$0.002 USDC on Base. No API keys.","url":"https://agent402.co.uk/v1/math/sharpe","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"returns":{"type":"array","description":"Period returns"},"risk_free":{"type":"number","description":"Risk-free per period"}}},"responseSchema":{"type":"json","example":{"mean":0.00125,"stdev":0.0152,"sharpe":0.122}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","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":"down","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_dWHinrGC78-R4x4JW5MbM","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Computes the Sharpe ratio from a series of period returns and a risk-free rate, quantifying risk-adjusted investment performance.","exampleAgentPrompt":"Calculate the Sharpe ratio for this return series: [0.01, 0.02, -0.005, 0.015, 0.008, -0.003, 0.012], using a risk-free rate of 0.0004 per period.","exampleUseCases":[{"title":"Portfolio strategy backtesting evaluation","prompt":"I've backtested a momentum strategy and got these monthly returns: [0.03, 0.01, -0.02, 0.04, 0.005, -0.01, 0.02, 0.015]. The monthly risk-free rate is 0.0025. Can you calculate the Sharpe ratio so I can see how well it performs on a risk-adjusted basis?"},{"title":"Comparing two investment funds","prompt":"I want to compare two funds. Fund A has these quarterly returns: [0.04, 0.02, -0.01, 0.05] and Fund B has [0.03, 0.03, 0.02, 0.03]. Assume a quarterly risk-free rate of 0.005. What's the Sharpe ratio for each?"},{"title":"Algorithmic trading system performance check","prompt":"My algo trading bot produced these daily returns over the past two weeks: [0.002, -0.001, 0.003, 0.001, -0.002, 0.004, 0.0015, -0.0005, 0.002, 0.001]. Using a daily risk-free rate of 0.0001, compute the Sharpe ratio for me."}],"resultDescription":"Returns a numeric Sharpe ratio representing the excess return per unit of risk (standard deviation) for the provided return series, adjusted by the given risk-free rate per period.","failureModes":["Empty or single-element returns array causes division-by-zero or undefined standard deviation","Non-numeric values in the returns array cause validation errors","Missing required 'returns' field results in a 400 bad request","Extremely large or small float values may cause numerical instability","Incorrect risk_free rate units (e.g. annual instead of per-period) will produce a misleading but non-error result"],"whenToPreferThis":"Choose this endpoint when you need a quick, serverless computation of the Sharpe ratio without setting up a local financial library. It is ideal for agents performing portfolio analysis, strategy comparison, or backtesting pipelines where risk-adjusted performance needs to be quantified on demand. Prefer it over Black-Scholes (options pricing) or IRR endpoints when the task is specifically about return-series risk efficiency rather than option valuation or cash flow analysis.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T08:26:32.474Z","isFirstParty":false}