Calculators
Leverage liquidation price calculator API
Compute the liquidation price of a leveraged perp position: long = entry·(1 − 1/L + mmr), short = entry·(1 + 1/L − mmr) where mmr is the maintenance margin rate — plus the price-move buffer to liquidation. Deterministic risk math. Answers 'where do I get liquidated at 10x','liquidation price for a short','how far is my liq price'.
Price$0.01per request
MethodPOST
Route/v1/calc/cryptocalc-liquidation-price
StatusLive
MIME typeapplication/json
Rate limit120/minute
CacheNo cache
calccryptodefiliquidationleverageperpsmarginrisk
API URL
Integration docshttps://x402.hexl.dev/v1/calc/cryptocalc-liquidation-priceExample request
{
"entryPrice": 30000,
"leverage": 10,
"side": "long"
}Example response
{
"formula": "liq = entry·(1 − 1/L + mmr)",
"side": "long",
"entryPrice": 30000,
"leverage": 10,
"maintenanceMarginPct": 0.5,
"liquidationPrice": 27150,
"priceMovePct": -9.5,
"bufferPct": 9.5,
"interpretation": "moderate-risk"
}Input schema
{
"type": "object",
"required": [
"entryPrice",
"leverage"
],
"properties": {
"entryPrice": {
"type": "number",
"examples": [
30000
]
},
"leverage": {
"type": "number",
"description": "leverage multiple, >=1",
"examples": [
10
]
},
"side": {
"type": "string",
"enum": [
"long",
"short"
],
"examples": [
"long"
]
},
"maintenanceMargin": {
"type": "number",
"description": "maintenance margin rate (decimal)",
"examples": [
0.005
]
}
}
}Output schema
{
"type": "object",
"additionalProperties": true
}