{"uid":"cap_ZmKv-dFj_CCeaZOnNz3Yf","slug":"finmath-health-factor-calculator-cb3174b0","name":"finmath Health Factor 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/health_factor","method":"POST","headers":{},"bodySchema":{"type":"object","required":["debt_value","collateral_value","liquidation_threshold"],"properties":{"debt_value":{"type":"number","description":"debt_value"},"collateral_value":{"type":"number","description":"collateral_value"},"liquidation_threshold":{"type":"number","description":"liquidation_threshold"}}},"responseSchema":{"type":"object","required":["result","meta"],"properties":{"meta":{"type":"object"},"result":{}}},"example":{"request":{"debt_value":5000,"collateral_value":10000,"liquidation_threshold":0.75},"response":{"meta":{"tool":"health_factor","disclaimer":"Deterministic calculation utility. Not financial, investment, or trading advice.","deterministic":true},"result":{"liquidatable":false,"health_factor":1.5}}},"exampleRequest":{"debt_value":5000,"collateral_value":10000,"liquidation_threshold":0.75},"tags":["x402"],"displayCostAmount":"0.001","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.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_T6qB3pW4RmDxa_VMds5EY","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Computes the DeFi health factor for a collateralized lending position given debt value, collateral value, and liquidation threshold","exampleAgentPrompt":"What's the health factor on my DeFi lending position? I have $5000 in collateral, $2000 in debt, and my liquidation threshold is 0.8.","exampleUseCases":null,"resultDescription":"Returns a numeric health factor result along with metadata. A health factor above 1.0 indicates a safe position; below 1.0 means the position is eligible for liquidation. The result is computed with exact arithmetic, not LLM approximation.","failureModes":["Missing required fields (debt_value, collateral_value, or liquidation_threshold) returns a 400 error","Zero or negative collateral_value may produce division errors or undefined results","Payment failure via x402 protocol returns 402 Payment Required","Invalid number types for input fields cause schema validation errors","Extremely large or small numbers may produce precision edge cases"],"whenToPreferThis":"Use this endpoint when you need exact, deterministic health factor arithmetic for a DeFi lending position and cannot trust LLM-approximated math. Ideal for agents monitoring collateralized positions on protocols like Aave or Compound, or when building liquidation alerting systems. Prefer this over manual calculation when correctness and reproducibility are critical.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T18:53:41.726Z","isFirstParty":false}