CryptoPerks Guide

Home › Guides › Liquidation price

OKX Liquidation Price: How It's Calculated, with Worked Examples

Disclosure: this site uses affiliate links. If you sign up with our OKX code, we earn a share of the trading fees you pay; your 20% rebate is not reduced. Details.

OKX referral code · 20% fee rebateAffiliate link
Join OKX ↗

You get 20% of your trading fees back with this code; the site owner earns a commission at no extra cost to you. Not for residents of restricted regions (incl. U.S., Canada). Rewards vary by region and are not guaranteed. Independent guide, not an official OKX site.

Short answer: OKX liquidates a futures position when its maintenance margin ratio falls to 100% or below, and it measures this with the mark price, not the last traded price. For an isolated USDT-margined long, OKX's formula is (margin − position value at entry) ÷ (position size × (maintenance margin rate + fee rate − 1)). In practice the distance to liquidation is roughly 1 ÷ leverage, minus the maintenance margin and fee rates: about 9.5% at 10x, about 1.5% at 50x and under 0.5% at 100x in our example below. This page shows the arithmetic so you can check it yourself before you risk money.

This is a deep dive into the math only. For how to practise without money, see OKX demo trading; for what fees cost, see OKX fees explained. Futures and leverage are not available in every country, and this is not financial advice.

OKX liquidation rules at a glance

ItemWhat OKX says
When liquidation startsWhen the maintenance margin ratio is at or below 100%. OKX warns from 300%, and says it may change that warning level.
Which price countsThe mark price only, not the last traded price. The mark price blends spot indexes from several exchanges plus a basis.
Margin ratio (isolated)(Margin balance + position PnL) ÷ (maintenance margin + liquidation fees).
Maintenance margin rate (MMR)Set by position tier: larger positions sit in higher tiers with a higher MMR and a lower maximum leverage. See Position tiers on the trading page.
How it happensIn stages: futures positions are cut by two tiers per step and the ratio is rechecked. If it is still at or below 100% at the lowest tiers, the rest is closed at the mark price.
Fees on liquidationA liquidation fee at the taker rate of your fee tier, plus a "liquidation clearance fee" equal to the maintenance margin at the moment of trigger.
What you can loseIsolated: that position's margin. Cross: all margin in that currency in the trading account. The funding account isn't affected.
Beyond your marginA security fund covers negative balances. If it can't, auto-deleveraging (ADL) reduces profitable positions on the other side.
RegionDerivatives are restricted in some countries, for example the UK, Australia, Brazil and South Korea, per OKX's disclosure. See OKX supported countries.

Last verified: November 13, 2026, against the OKX help articles listed under Official sources. Rules, tiers and fee rates change and can differ by region; if your account shows something different, OKX is right.

The formula OKX publishes

OKX's forced-liquidation FAQ gives these formulas for isolated futures. M is the margin balance, F the contract face value, n the number of contracts, P the average entry price, mmr the maintenance margin rate of your tier, and fee the fee rate. F × n is simply your position size in coins.

ContractLongShort
USDT-margined(M − F·n·P) ÷ (F·n·(mmr + fee − 1))(M + F·n·P) ÷ (F·n·(mmr + fee + 1))
Crypto-marginedF·n·(mmr + fee + 1) ÷ (M + F·n/P)F·n·(mmr + fee − 1) ÷ (M − F·n/P)

Why the shortcut works: at leverage L, your margin is about position value ÷ L. Liquidation comes when the loss has eaten the margin down to the maintenance margin plus fees. So the price can move about 1/L − (mmr + fee) against you. Leverage sets the first term, which is why it dominates everything else.

Worked example: the same trade at seven leverage levels

Illustrative numbers only, not live OKX data. A long and a short of 0.1 BTC on a USDT-margined perpetual, entry 60,000 USDT, so the position is worth 6,000 USDT. We assume an MMR of 0.5% and a fee rate of 0.05%; check the real MMR for your size under Position tiers and your fee rate in your account. Isolated margin, no extra margin added, funding ignored.

LeverageMargin postedLong liquidation priceDrop that liquidates the longShort liquidation priceRise that liquidates the short
2x3,000 USDT30,166−49.7%89,508+49.2%
3x2,000 USDT40,221−33.0%79,562+32.6%
5x1,200 USDT48,266−19.6%71,606+19.3%
10x600 USDT54,299−9.5%65,639+9.4%
20x300 USDT57,315−4.5%62,655+4.4%
50x120 USDT59,125−1.5%60,865+1.4%
100x60 USDT59,729−0.45%60,269+0.45%

Check one row by hand. 10x long: M = 600. (600 − 0.1 × 60,000) ÷ (0.1 × (0.005 + 0.0005 − 1)) = −5,400 ÷ −0.09945 ≈ 54,299 USDT, a 9.5% drop. Crypto can move that much in a day, and 0.45% is ordinary noise within minutes. Note also that the position, and so the profit or loss per dollar of price move, is the same in every row: leverage only changes how much margin stands between you and liquidation.

Liquidation costs more than the margin "running out". OKX's FAQ says the liquidation clearance fee equals the maintenance margin at the moment of trigger, on top of a taker-rate liquidation fee. So when an isolated position is fully liquidated, expect most or all of its margin to be gone, not a small remainder.

How to check a liquidation price before you open a trade

  1. Find your MMR. On the futures trading page, open Position tiers for the contract and find the tier for the size you plan. A bigger position can sit in a higher tier with a higher MMR.
  2. Find your fee rate. Your taker rate is shown in your account; see OKX fees explained.
  3. Use OKX's own calculator. OKX points users to the futures Calculator, which has a Liquidation price option. Enter the same inputs as your planned trade.
  4. Check it with the formula above. If your number and OKX's differ by a lot, find out why before trading (see "Common problems" below).
  5. Compare it with your stop. Your stop-loss must sit well before the liquidation price. If it doesn't, cut size or leverage, not the stop.
  6. Practise in demo first. Open the same position in demo trading and compare the liquidation price OKX shows with your own.

Position sizing: the number that matters more than leverage

Illustrative numbers. Say your account is 2,000 USDT and you decide to risk at most 1% (20 USDT) on one trade, with a stop 2% from entry. Position size = 20 ÷ 0.02 = 1,000 USDT. Fees for a taker round trip at 0.05% per side add about 1 USDT, so the loss at the stop is about 21 USDT whatever leverage you pick.

Leverage on that 1,000 USDT positionMargin lockedRough liquidation distanceStop (2%) hit before liquidation?
2x500 USDT~49%Yes, by a wide margin
10x100 USDT~9.5%Yes
50x20 USDT~1.5%No: liquidation comes first, with liquidation fees

The lesson: decide the risk in USDT first, then the size, and only then check that the liquidation price sits far beyond the stop. Note that a stop is an order, not a promise: in a fast market it can fill worse than its trigger price.

How fees compound with leverage and trade frequency

Futures fees are charged on the position value, not on your margin. Illustrative numbers: 1,000 USDT of margin at 10x is a 10,000 USDT position. At a 0.05% taker rate, each side costs 5 USDT, so a round trip costs 10 USDT, which is 1% of your margin.

Round trips per dayFees per dayAs % of 1,000 USDT marginFees per 30 days30 days after a 20% rebate
220 USDT2%600 USDT480 USDT
550 USDT5%1,500 USDT1,200 USDT
20200 USDT20%6,000 USDT4,800 USDT

Funding payments, slippage and spread come on top. Fees also shrink your margin balance between trades, which moves later liquidation prices closer. The 20% rebate with code 33746534 lowers the fee line; it doesn't turn a losing pattern into a winning one. Run your own numbers in the OKX fee calculator.

Common problems: what if…?

Why is OKX's liquidation price different from my calculation?

The usual causes: your position sits in a different tier with a different MMR; your fee rate differs from the one you assumed; you use cross margin, where the whole trading-account balance in that currency counts (so the price moves whenever your balance or other positions change); funding or fees have changed the margin balance; or your average entry price differs from the price you had in mind after several fills.

Why was I liquidated when the chart never reached my liquidation price?

The chart you watched probably showed the last traded price. OKX liquidates on the mark price, which you can switch to on the candlestick chart. A position can also be partly reduced in stages before it is fully closed, so the first fill may come earlier than you expected.

What if I add margin to an isolated position?

A larger M moves the liquidation price away. In the table above, adding 600 USDT to the 10x long (M = 1,200) moves liquidation from about 54,299 to about 48,266, the same as 5x. But you also put twice as much money at risk on the same trade; adding margin to rescue a losing trade is a common way to lose more.

What if I use cross margin instead?

The liquidation price is usually further away, because more balance supports the position, but OKX says all the margin in that currency in your trading account may be lost, and unfilled orders, including bot orders, are cancelled on liquidation. Isolated margin limits the loss to one position; cross shares the risk across all of them.

Can a bot or script get liquidated?

Yes. Futures grid bots and API scripts use the same margin rules. A script can open leveraged positions faster than you notice a bug, which is why the checks below belong in code.

A read-only liquidation-distance check in Python

This builds on the script in your first OKX API script: save that as okx_first.py in the same folder. It runs against demo (that script sets DEMO = True), only reads data and never places an order. It warns when liquidation is close and creates the STOP kill-switch file when the daily max loss is hit. Use a read-only key kept in environment variables.

# liq_watch.py: read-only, demo only. Needs okx_first.py from our first-script guide.
import os, time
from okx_first import call, KILL_FILE

MIN_DISTANCE = 0.15         # warn if liquidation is closer than 15% of the mark price
DAILY_MAX_LOSS_USDT = 50    # create the STOP file after this drawdown
start_equity = None

while not os.path.exists(KILL_FILE):
    res = call("GET", "/api/v5/account/positions?instType=SWAP", private=True)
    if res.get("code") != "0":
        print("error", res.get("code"), res.get("msg"))
        time.sleep(30)
        continue
    for p in res["data"]:
        mark, liq = float(p["markPx"] or 0), float(p["liqPx"] or 0)
        if mark and liq:
            dist = abs(mark - liq) / mark
            print(f"{p['instId']} {p['mgnMode']} {p['lever']}x mark {mark} liq {liq} distance {dist:.1%}")
            if dist < MIN_DISTANCE:
                print("Liquidation is close: reduce size by hand.")
    bal = call("GET", "/api/v5/account/balance?ccy=USDT", private=True)
    if bal.get("code") == "0":
        equity = float(bal["data"][0]["totalEq"] or 0)
        start_equity = start_equity or equity
        if start_equity - equity > DAILY_MAX_LOSS_USDT:
            open(KILL_FILE, "w").close()   # halts every script that checks for STOP
            print("Daily max loss reached: STOP file created. Review positions by hand.")
    time.sleep(30)

Fields markPx, liqPx, mgnMode and lever come from OKX's Get positions endpoint; liqPx can be empty when there is no liquidation price to show. Check the API v5 docs if a field changes.

Risk section: read before you use leverage

Honest limits of this page

If you're not signed up yet, our OKX referral code guide explains what code 33746534 gives you.

Official sources

Checked on November 13, 2026: OKX help articles Forced liquidation FAQ (updated October 5, 2026; trigger, mark price, staged liquidation, fees, isolated vs cross, liquidation price formulas), Futures margin calculation rules (updated October 8, 2026; initial margin and margin ratio formulas), Tiered maintenance margin ratio rules (updated August 11, 2026), What is the leverage gradient MMR system? (updated August 11, 2026; 300% warning level), Forced Liquidation FAQ (US) (updated August 27, 2026; liquidation price calculator), and the OKX API v5 documentation (Get positions).

FAQ

What does liquidation price mean on OKX?

It is the mark price at which your position's maintenance margin ratio would fall to 100%, the point where OKX starts forced liquidation. It moves when your margin, position size, tier or fee rate changes.

Does OKX use the last price or the mark price for liquidation?

The mark price. OKX says forced liquidation only looks at the mark price, which blends spot indexes from several exchanges plus a basis, so a brief spike in the last traded price alone shouldn't trigger it.

How far can the price move before I'm liquidated at 10x?

Roughly 1 divided by the leverage, minus the maintenance margin and fee rates. With an illustrative 0.5% MMR and 0.05% fee, that is about 9.5% at 10x, 4.5% at 20x and 1.5% at 50x for an isolated position. Check your real numbers with OKX's calculator.

What is the maintenance margin rate on OKX?

It is the minimum margin, as a share of the position, needed to keep the position open. OKX sets it by position tier: larger positions get a higher rate and a lower maximum leverage. You can see the tiers under Position tiers on the trading page.

Does adding margin lower my liquidation risk?

On an isolated position, adding margin moves the liquidation price further away, but it also puts more money at risk on the same trade. Reducing position size lowers risk without adding exposure.

Is isolated or cross margin safer for liquidation?

Neither is safe. Isolated limits the loss to the margin of that one position. Cross usually puts liquidation further away, but OKX says all margin in that currency in the trading account may be lost.

What fees does OKX charge when a position is liquidated?

According to OKX's FAQ, a liquidation fee at the taker rate of your fee tier, plus a liquidation clearance fee equal to the maintenance margin at the moment liquidation is triggered. Larger tiers mean larger fees.

Can I lose more than my margin on OKX futures?

In isolated mode OKX says only that position's margin is lost, and its security fund covers negative balances. In cross mode, all the margin in that currency in your trading account can be lost. Your funding account isn't affected.

Last reviewed: . OKX changes its products, fees and rules by region and over time. If anything here differs from what OKX shows in your account, OKX is right. See how we check information.

Join OKX