{"uid":"cap_JI18Sgdo-ncG1dbnH8mIy","slug":"finmath-sharpe-ratio-calculator-6ce47c61","name":"finmath Sharpe Ratio Calculator","description":"Deterministic finance and crypto math for AI agents: TradFi (NPV, IRR, XIRR, Black-Scholes + Greeks, bonds, VaR, Sharpe) and DeFi (impermanent loss, perp liquidation, funding, Uniswap v3, health factor, cost basis). Exact, model-free arithmetic that LLMs get wrong — priced per call in USDC.","url":"https://finmath.qzqh5rrbkz.workers.dev/v1/beta","method":"POST","headers":{},"bodySchema":{"type":"object","required":["asset_returns","benchmark_returns"],"properties":{"asset_returns":{"type":"array","description":"asset_returns"},"benchmark_returns":{"type":"array","description":"benchmark_returns"}}},"responseSchema":{"type":"object","required":["result","meta"],"properties":{"meta":{"type":"object"},"result":{}}},"example":{"request":{"asset_returns":[0.05,0.03,-0.02,0.04,0.06],"benchmark_returns":[0.04,0.02,-0.01,0.03,0.05]},"response":{"meta":{"tool":"beta","disclaimer":"Deterministic calculation utility. Not financial, investment, or trading advice.","deterministic":true},"result":1.3396226415094337}},"exampleRequest":{"asset_returns":[0.05,0.03,-0.02,0.04,0.06],"benchmark_returns":[0.04,0.02,-0.01,0.03,0.05]},"tags":["x402"],"displayCostAmount":"0.002","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","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.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_Oze4ZsyY1jjkmfKwByccJ","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 (risk-adjusted return) by comparing asset returns against benchmark returns using exact deterministic arithmetic.","exampleAgentPrompt":"Calculate the Sharpe ratio for my strategy — asset monthly returns were [0.04, 0.02, -0.01, 0.03, 0.05] and the benchmark returns were [0.01, 0.01, 0.01, 0.01, 0.01]. Use exact deterministic math, not an LLM estimate.","exampleUseCases":null,"resultDescription":"Returns a result object containing the computed Sharpe ratio (risk-adjusted return relative to benchmark) along with a meta object containing computation details such as method used and input validation info.","failureModes":["Missing asset_returns or benchmark_returns arrays returns a 400 validation error","Mismatched array lengths between asset and benchmark returns may cause computation error","Empty arrays may return a null or undefined result","Non-numeric values in return arrays will cause a parsing or computation failure","Payment not included or insufficient USDC causes a 402 Payment Required response"],"whenToPreferThis":"Choose this endpoint when you need exact, deterministic Sharpe ratio computation rather than relying on an LLM's approximate arithmetic. Ideal for agents doing portfolio analysis, strategy backtesting, or risk-adjusted return comparisons where numerical precision matters. Prefer this over LLM self-computation whenever the result feeds a financial decision.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T18:57:56.551Z","isFirstParty":false}