{"uid":"cap_SM-uhyyIdnAS95uqEHjO3","slug":"crypto-liquidation-price-calculator-4a83a722","name":"Crypto Liquidation Price Calculator","description":"Liquidation price for a long/short leveraged (perp) position from entry, leverage and maintenance-margin rate; returns liquidation price and distance to it.","url":"https://api.24klabs.ai/api/crypto-liquidation-price","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"side":{"type":"string"},"leverage":{"type":"number"},"entry_price":{"type":"number"},"maintenance_margin_rate":{"type":"number"}}},"responseSchema":{"type":"json","example":{"distance_pct":-9.5,"liquidation_price":27150}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.003","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.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_78lHqF4xi0V5t9I9vkNCQ","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.003","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 long or short leveraged perpetual futures position given entry price, leverage, and maintenance margin rate, and returns the distance to liquidation.","exampleAgentPrompt":"What's the liquidation price if I open a 10x long BTC position at an entry price of $65,000 with a maintenance margin rate of 0.5%?","exampleUseCases":[{"title":"Pre-trade liquidation risk check","prompt":"I'm about to open a 20x short on ETH at $3,400 with a 0.5% maintenance margin rate — what's my liquidation price and how far away is it from my entry?"},{"title":"Portfolio risk monitoring for open perp positions","prompt":"I have a 5x long position on SOL entered at $145 with a 0.4% maintenance margin rate. Can you calculate my liquidation price so I know how much downside buffer I have?"},{"title":"Leverage comparison before entering a trade","prompt":"If I enter a BTC long at $60,000, what's the liquidation price at 3x leverage versus 10x leverage, assuming a 0.5% maintenance margin rate?"}],"resultDescription":"Returns the computed liquidation price for the specified leveraged position and the distance (in price units or percentage) from the entry price to the liquidation level, allowing traders to assess their downside or upside risk exposure.","failureModes":["Missing required fields (entry price, leverage, position direction, or maintenance margin rate) returns a validation error","Leverage value of zero or negative causes a computation error","Maintenance margin rate outside valid range (e.g. >100%) may return an error or nonsensical result","Invalid position direction string (not 'long' or 'short') returns a bad request error","Network timeout or service unavailability returns a 5xx error"],"whenToPreferThis":"Use this endpoint when you need a fast, on-demand computation of the liquidation price for a single leveraged perpetual futures position without connecting to a live exchange API. It is ideal for pre-trade risk checks, building trading dashboards, or embedding liquidation math into automated agents managing crypto portfolios. Prefer this over manual formula implementation or exchange-specific APIs when you want a simple, exchange-agnostic calculation based solely on entry price, leverage, and maintenance margin rate.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-13T19:02:14.532Z","isFirstParty":false}