{"uid":"cap__HH_3nNbwwBdXV1cdKrwJ","slug":"saylor-innovations-defi-health-factor-calculator-945c6adf","name":"Saylor Innovations DeFi Health Factor Calculator","description":"Aave-style lending health factor from collateral, debt and liquidation threshold: status, liquidation price, drop to liquidation, repay or add needed for a target.","url":"https://saylorinnovations.com/api/defi/health-factor?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["collateral_usd","debt_usd","liquidation_threshold_percent"],"properties":{"debt_usd":{"type":"string","description":"borrowed value in USD"},"ltv_percent":{"type":"string","description":"optional max LTV for borrow headroom"},"collateral_usd":{"type":"string","description":"collateral value in USD"},"collateral_price":{"type":"string","description":"optional collateral unit price for the liquidation price"},"liquidation_threshold_percent":{"type":"string","description":"asset liquidation threshold, e.g. 82.5"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string","const":"json"},"example":{"type":"object","required":["health_factor","status"],"properties":{"note":{"type":"string","description":"Plain-language caveat about how to read and use the result"},"source":{"type":"string","description":"Where the data or formula comes from"},"status":{"type":"string","description":"Risk label: liquidatable, critical, risky, moderate or healthy"},"debt_usd":{"type":"number","description":"Borrowed value used"},"health_factor":{"type":"number","description":"Collateral times threshold divided by debt; below 1 is liquidatable"},"collateral_usd":{"type":"number","description":"Collateral value used"},"max_borrow_usd":{"type":["number","null"],"description":"Maximum borrow at the supplied LTV"},"collateral_price":{"type":["number","null"],"description":"Collateral unit price supplied"},"liquidation_price":{"type":["number","null"],"description":"Collateral unit price at which the position is liquidated"},"borrow_headroom_usd":{"type":["number","null"],"description":"Additional borrow available before hitting the max LTV"},"current_ltv_percent":{"type":"number","description":"Debt divided by collateral, in percent"},"target_health_factor":{"type":"number","description":"Safety target used for the repay and top-up figures"},"repay_to_reach_target_usd":{"type":"number","description":"Debt to repay to reach the target health factor"},"liquidation_threshold_percent":{"type":"number","description":"Liquidation threshold of the collateral, in percent"},"liquidation_collateral_value_usd":{"type":"number","description":"Collateral value at which the position is liquidated"},"add_collateral_to_reach_target_usd":{"type":"number","description":"Collateral to add to reach the target health factor"},"safe_additional_borrow_at_target_usd":{"type":"number","description":"Additional borrow that still keeps the health factor at the target"},"collateral_drop_to_liquidation_percent":{"type":"number","description":"How far the collateral can fall before liquidation, in percent"}}}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","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":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_-gB4GfTuWwndxHOf8z3pu","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Computes an Aave-style lending health factor from collateral value, debt, and liquidation threshold, returning risk status, liquidation price, and repayment/collateral targets.","exampleAgentPrompt":"My DeFi position has $12,000 in collateral, $7,500 in debt, and a liquidation threshold of 82.5% — can you calculate my health factor, tell me if I'm at risk, and show me the collateral price at which I'd get liquidated?","exampleUseCases":[{"title":"Pre-borrow risk check on Aave","prompt":"I have $20,000 in ETH collateral and $9,000 in debt with a liquidation threshold of 80% — what's my current health factor and how much more can I safely borrow before I'm in danger?"},{"title":"Monitoring position near liquidation","prompt":"My collateral is worth $5,500 USD, I owe $4,800, and the liquidation threshold is 82.5%. Am I about to get liquidated, and if so how much do I need to repay to get to a safe health factor?"},{"title":"Liquidation price for a specific asset","prompt":"I have $15,000 collateral in ETH priced at $2,500 per coin, $8,000 in debt, and an 80% liquidation threshold — at what ETH price would my position get liquidated?"}],"resultDescription":"Returns a health factor number (below 1 means liquidatable), a risk status label (healthy/moderate/risky/critical/liquidatable), the collateral USD and debt USD used, optional liquidation unit price, how far the collateral price can drop before liquidation, the repayment amount or additional collateral needed to reach a target health factor, max borrow USD at the supplied LTV, borrow headroom, plus a plain-language note and data source citation.","failureModes":["Missing required query parameters (collateral_usd, debt_usd, liquidation_threshold_percent) returns an error","Non-numeric string values for numeric fields cause parsing errors","Zero debt value may cause division-by-zero or undefined health factor","Liquidation price cannot be computed if collateral_price is not supplied","Extremely large or small values may yield edge-case outputs"],"whenToPreferThis":"Use this endpoint when you need a quick, formula-based Aave-style health factor computation from raw collateral and debt USD values without connecting to an on-chain node. Prefer it over blockchain RPC calls when the user already knows their position values and wants instant risk assessment, status labeling, and liquidation price targets in a single lightweight API call. It is especially useful for DeFi portfolio monitoring agents that periodically check position health.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-30T00:38:38.100Z","isFirstParty":false,"canonicalSlug":"saylor-innovations-defi-health-factor-calculator-945c6adf"}