{"uid":"cap_htvHqGuvbCF1y_KvmKE-k","slug":"api-quantoracle-dev-4b1d5d60","name":"QuantOracle Crypto Liquidation Price Calculator","description":"QuantOracle: crypto/liquidation-price","url":"https://api.quantoracle.dev/v1/crypto/liquidation-price","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"leverage":{"type":"number","title":"Leverage","description":"Leverage multiplier"},"direction":{"enum":["long","short"],"type":"string","title":"Direction","description":"Position direction"},"collateral":{"type":"number","title":"Collateral","description":"Collateral amount in USD"},"entry_price":{"type":"number","title":"Entry Price","description":"Position entry price"},"position_size":{"type":"number","title":"Position Size","description":"Total position size in USD"},"funding_accumulated":{"type":"number","title":"Funding Accumulated","default":0,"description":"Accumulated funding payments (negative = paid)"},"maintenance_margin_rate":{"type":"number","title":"Maintenance Margin Rate","default":0.005,"description":"Maintenance margin rate (e.g. 0.005 = 0.5%)"}}},"responseSchema":null,"example":{"request":{"leverage":10,"direction":"long","collateral":1000,"entry_price":50000,"position_size":10000,"maintenance_margin_rate":0.005},"response":{"ms":8.1,"_meta":{"url":"https://quantoracle.dev","docs":"https://api.quantoracle.dev/docs","calculator":"https://quantoracle.dev/crypto-liquidation-calculator","powered_by":"QuantOracle"},"direction":"long","live_data":{"note":"Holding a perp? Funding erodes collateral over time and shifts this liq price. Pull the current rate from /v1/live/funding-rates ($0.005).","watch":"This position is 9.5% from liquidation. QuantOracle Watch re-checks it every 60s (funding-adjusted) and webhooks you at warn/critical thresholds: POST /v1/watch/position ($5 per 30 days via x402) — free 48h trial: POST /v1/watch/trial.","funding":"/v1/live/funding-rates"},"distance_pct":9.5,"safe_price_range":{"max":150000,"min":45250},"liquidation_price":45250,"effective_leverage":10,"max_loss_before_liq":950,"margin_ratio_current":0.1}},"exampleRequest":{"leverage":10,"direction":"long","collateral":1000,"entry_price":50000,"position_size":10000,"maintenance_margin_rate":0.005},"tags":["x402"],"displayCostAmount":"0.002","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.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_nkbMYl9l0c3KJe5J5a1Xe","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":"Calculates the liquidation price for a leveraged crypto position given entry price, collateral, position size, leverage, direction, and maintenance margin rate","exampleAgentPrompt":"What's my liquidation price if I open a long BTC position at $65,000 entry with $1,000 collateral, $10,000 position size, 10x leverage, and a 0.5% maintenance margin rate?","exampleUseCases":null,"resultDescription":"Returns the exact liquidation price, the percentage distance from entry to liquidation, a safe price range (min and max), the maximum dollar loss before liquidation, current margin ratio, effective leverage, and direction — all computed in about 11ms.","failureModes":["Missing required fields (leverage, direction, collateral, entry_price, position_size, maintenance_margin_rate) returns 400 error","Invalid direction value (not 'long' or 'short') returns validation error","Zero or negative collateral or position size returns error","Leverage value out of acceptable range returns error","Payment failure via x402 protocol returns 402 Payment Required"],"whenToPreferThis":"Use this endpoint when you need a precise, fast calculation of the liquidation price for a single leveraged crypto position — especially when building risk dashboards, trade validators, or position-sizing tools where you need the exact liquidation level and supporting metrics like safe price range and max loss.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T00:57:03.200Z","isFirstParty":false}