{"uid":"cap_z1xMAbnEOloZ5wfcntHrT","slug":"finmath-max-drawdown-calculator-9984a9bd","name":"finmath Max Drawdown 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/max_drawdown","method":"POST","headers":{},"bodySchema":{"type":"object","required":["values"],"properties":{"values":{"type":"array","description":"values"}}},"responseSchema":{"type":"object","required":["result","meta"],"properties":{"meta":{"type":"object"},"result":{}}},"example":{"request":{"values":[100,95,110,85,120,90,105,80,115,100]},"response":{"meta":{"tool":"max_drawdown","disclaimer":"Deterministic calculation utility. Not financial, investment, or trading advice.","deterministic":true},"result":{"peak_index":4,"max_drawdown":-0.3333333333333333,"trough_index":7}}},"exampleRequest":{"values":[100,95,110,85,120,90,105,80,115,100]},"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_LhcnrR9Bg7Z9F5UJdrpbX","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 maximum drawdown of a time series of portfolio or asset values","exampleAgentPrompt":"Calculate the maximum drawdown for this portfolio value series: [100, 120, 95, 110, 85, 105, 130, 90, 115] — I need the exact peak-to-trough percentage decline.","exampleUseCases":null,"resultDescription":"Returns a result object containing the maximum drawdown value (typically as a decimal or percentage representing the worst peak-to-trough decline) and a meta object with additional computation details such as peak index, trough index, and methodology information.","failureModes":["Missing 'values' array in request body returns validation error","Empty array or single-element array may return zero or error","Non-numeric values in array cause computation failure","Insufficient funds (USDC) triggers HTTP 402 payment required","Network timeout on workers.dev edge if request is malformed"],"whenToPreferThis":"Use this endpoint when you need exact, deterministic maximum drawdown computation without relying on LLM arithmetic. Prefer it over asking an LLM to compute drawdown directly, as LLMs are prone to arithmetic errors on numerical sequences. Best for portfolio risk analysis, strategy backtesting, and regulatory reporting where precision matters.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-13T18:48:53.695Z","isFirstParty":false}