{"uid":"cap_LMQSti3H-rlfzKQZaLM0z","slug":"defi-collateralized-loan-health-liquidation-calculator-685cfd0b","name":"DeFi Collateralized Loan Health & Liquidation Calculator","description":"Collateralized DeFi loan (Aave/Compound style): health factor, current LTV, collateral liquidation price, drop it can withstand, extra borrowing room and how much to repay or add to reach a 1.5 health factor.","url":"https://api.vextorium.com/calculadora-liquidacion-prestamo-pago?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method","bodyType","body"],"properties":{"body":{"required":["colateral_cantidad","colateral_precio","deuda_usd"],"properties":{"deuda_usd":{"type":"number"},"ltv_max_pct":{"type":"number","description":"Default 80"},"colateral_precio":{"type":"number"},"colateral_cantidad":{"type":"number"},"umbral_liquidacion_pct":{"type":"number","description":"Default 82.5"}}},"type":{"type":"string","const":"http"},"method":{"enum":["POST"],"type":"string"},"bodyType":{"enum":["json","form-data","text"],"type":"string"}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":["object","null"],"properties":{"nota":{"type":["string","null"]},"estado":{"type":["string","null"]},"deuda_usd":{"type":["number","null"]},"factor_salud":{"type":["number","null"]},"ltv_actual_pct":{"type":["number","null"]},"para_factor_1_5":{"type":["object","null"],"properties":{"devolver_usd":{"type":["number","null"]},"o_anadir_colateral":{"type":["number","null"]}}},"precio_liquidacion":{"type":["number","null"]},"puede_pedir_mas_usd":{"type":["number","null"]},"valor_colateral_usd":{"type":["number","null"]},"caida_soportable_pct":{"type":["number","null"]}}}}}}},"responseSchema":{"type":"json","example":{"nota":"Cálculo con un solo colateral y deuda estable. Cada protocolo y activo tiene su propio umbral de liquidación.","estado":"vigilar","deuda_usd":3000,"factor_salud":1.485,"ltv_actual_pct":55.56,"para_factor_1_5":{"devolver_usd":30,"o_anadir_colateral":0.02020202},"precio_liquidacion":1818.18181818,"puede_pedir_mas_usd":1320,"valor_colateral_usd":5400,"caida_soportable_pct":32.66}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.003","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"registry","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.003/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_40O-2-TW9GrIVGf7s8WTp","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.003","costPer":"request","priority":0,"asset":null,"unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Calculates health factor, current LTV, liquidation price, and how much to repay or add as collateral to reach a safe 1.5 health factor for an Aave/Compound-style DeFi loan.","exampleAgentPrompt":"I have a DeFi loan with 2 ETH as collateral at $2,700 each and I owe $3,000 — can you calculate my health factor, liquidation price, and how much I'd need to repay or add to reach a 1.5 health factor?","exampleUseCases":[{"title":"Pre-liquidation risk check for ETH collateral","prompt":"I'm using 3 ETH at $2,500 each as collateral and I have a $4,000 debt on a DeFi protocol — tell me my health factor, at what ETH price I'd get liquidated, and how much I need to repay to get my health factor up to 1.5."},{"title":"Checking available borrowing room on existing position","prompt":"I've got 1.5 ETH posted as collateral at $2,800 each and I owe $2,000 — how much more can I safely borrow, and how much could the collateral price drop before I get liquidated?"},{"title":"Portfolio risk monitoring for DeFi agent","prompt":"My Aave-style position has 5 ETH collateral priced at $1,900 each, a debt of $6,500, with a max LTV of 80% and liquidation threshold of 82.5% — what's my current health factor and what's the minimum amount I need to add as collateral to reach a health factor of 1.5?"}],"resultDescription":"Returns a JSON object with: health factor, loan status (e.g. 'vigilar'/'safe'), current LTV percentage, collateral value in USD, liquidation price per collateral unit, maximum price drop the position can withstand as a percentage, additional borrowing capacity in USD, and the amount to repay (USD) or collateral to add to restore the health factor to exactly 1.5. Includes a note about single-collateral/single-debt assumptions.","failureModes":["Missing required fields (colateral_cantidad, colateral_precio, deuda_usd) results in validation error","Zero or negative collateral price or debt causes division errors or nonsensical results","LTV or liquidation threshold values outside realistic protocol ranges may yield misleading outputs","Network timeout or service unavailability returns no response"],"whenToPreferThis":"Use this endpoint when you need a fast, protocol-agnostic calculation of DeFi loan risk metrics (health factor, LTV, liquidation price) without querying a live blockchain. Ideal for agents monitoring collateralized positions, alerting users before liquidation, or computing rebalancing actions. It targets Aave/Compound-style single-collateral, single-debt positions and handles edge cases like near-1.5 health factor recovery calculations. If you need on-chain real-time price feeds, combine with a Chainlink oracle endpoint first.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-12T18:50:23.618Z","isFirstParty":false,"canonicalSlug":"defi-collateralized-loan-health-liquidation-calculator-685cfd0b"}