{"uid":"cap_Yeike2JI8eYlwotWNcfV4","slug":"finmath-value-at-risk-var-cb96c37f","name":"finmath Value at Risk (VaR)","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/value_at_risk","method":"POST","headers":{},"bodySchema":{"type":"object","required":["returns"],"properties":{"method":{"type":"string","description":"method"},"returns":{"type":"array","description":"returns"},"confidence":{"type":"number","description":"confidence"}}},"responseSchema":{"type":"object","required":["result","meta"],"properties":{"meta":{"type":"object"},"result":{}}},"example":{"request":{"method":"historical","returns":[0.02,-0.01,0.03,-0.02,0.015,0.025,-0.005,0.01],"confidence":0.95},"response":{"meta":{"tool":"value_at_risk","disclaimer":"Deterministic calculation utility. Not financial, investment, or trading advice.","deterministic":true},"result":{"var":0.016499999999999997,"method":"historical","confidence":0.95}}},"exampleRequest":{"method":"historical","returns":[0.02,-0.01,0.03,-0.02,0.015,0.025,-0.005,0.01],"confidence":0.95},"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_2el26WWiUdFv5a3rzGHBk","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 Value at Risk (VaR) for a portfolio given a list of historical returns and a confidence level using exact deterministic arithmetic","exampleAgentPrompt":"Calculate the 95% confidence Value at Risk using the historical method for these daily portfolio returns: [0.01, -0.02, 0.015, -0.03, 0.005, -0.04, 0.02, -0.01, 0.008, -0.025].","exampleUseCases":null,"resultDescription":"Returns a result object containing the computed VaR value (e.g. the maximum expected loss at the specified confidence level) and a meta object with calculation details such as method used, number of observations, and confidence level applied.","failureModes":["Missing or empty returns array returns a 400 validation error","Non-numeric values in the returns array cause a parsing error","Confidence level outside 0-1 range returns a validation error","Invalid method string returns an error indicating unsupported method","Insufficient returns data points may yield unreliable or error results","Payment not included or insufficient USDC triggers a 402 Payment Required response"],"whenToPreferThis":"Use this endpoint when you need exact, deterministic VaR calculations rather than relying on an LLM's approximate arithmetic. Ideal for risk management workflows, portfolio analysis, compliance reporting, or any scenario where precise quantitative risk measurement is required. Prefer this over general-purpose LLM math when accuracy and reproducibility matter, especially for financial reporting or automated trading systems.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T18:48:39.554Z","isFirstParty":false}