{"uid":"cap_vu4nTWG1LSBeaggsykJDt","slug":"crypto-liquidation-price-calculator-16cba429","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/v1/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_NTdCEOMivmd0_0jIlPg6D","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 and distance-to-liquidation for a long or short leveraged perpetual futures position given entry price, leverage, and maintenance margin rate.","exampleAgentPrompt":"What's the liquidation price for my long BTC position entered at $65,000 with 10x leverage and a 0.5% maintenance margin rate?","exampleUseCases":[{"title":"Risk check before opening a trade","prompt":"I'm about to open a 20x leveraged short on ETH at an entry price of $3,200 with a 0.4% maintenance margin rate — what price will I get liquidated at and how far is that from my entry?"},{"title":"Comparing leverage levels for safety","prompt":"If I go long on SOL at $150 with a 0.5% maintenance margin, what's my liquidation price at 5x leverage vs 15x leverage so I can decide which is safer?"},{"title":"DeFi portfolio risk monitoring","prompt":"My cross-margin perp position is long BNB entered at $580 at 8x leverage with a 0.3% maintenance margin rate — tell me my liquidation price and how many dollars away I am from it right now."}],"resultDescription":"Returns the calculated liquidation price for the leveraged position and the distance (absolute or percentage) between the entry price and the liquidation price, allowing traders to assess their risk exposure.","failureModes":["Invalid or missing entry price — returns error if entry price is zero or negative","Leverage value out of range — error if leverage is less than 1x or unrealistically high","Missing position direction — error if long/short is not specified","Invalid maintenance margin rate — error if rate is zero, negative, or greater than 1","Malformed request body — 400 error if required fields are absent or wrong type"],"whenToPreferThis":"Choose this endpoint when you need a fast, deterministic calculation of the liquidation price for a single perpetual futures position given known entry price, leverage, and maintenance margin parameters. Ideal for trading bots, risk dashboards, or AI agents that need to evaluate position risk without connecting to a full exchange API. Prefer this over exchange-specific APIs when you want a neutral, lightweight computation without authentication overhead.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-13T19:02:22.559Z","isFirstParty":false}