How OKX calculates the liquidation price
OKX measures tiers by the number of contracts you hold, not by position value, and the rate of your tier applies to the whole position. According to OKX, a position is liquidated when its equity falls to the maintenance margin plus the liquidation fee, which is charged at the taker rate. The calculator converts contracts to coins using each swap's contract value, for example 0.01 BTC per BTC-USDT-SWAP contract.
Liquidation price = (M − s × Q × E) ÷ (Q × (MMR + fee) − s × Q)M is the isolated margin, Q the size in coins, E the entry price, s is +1 for a long and −1 for a short, MMR the rate of your tier and fee the liquidation (taker) fee, 0.05% by default.
Worked example
Long 1 BTC (100 contracts) at 60,000 USDT with 20x isolated margin, so 3,000 USDT of margin. Assume the position is in a 0.40% tier.
(3,000 − 60,000) ÷ (1 × 0.0045 − 1) = 57,257.66 USDT.
Because the tier is set by contract count, a large position doesn't change tier as the price moves, unlike exchanges that measure tiers by value.
Want to see the same position on other exchanges? Compare liquidation prices across all 8 exchanges.
Isolated or cross margin
In isolated mode only the margin assigned to the position can be lost, so the liquidation price depends on that margin alone. Adding margin to an isolated position moves its liquidation price further away. In cross mode the whole wallet balance backs your positions, which pushes the liquidation price further away but puts the whole balance at risk.
How to move the liquidation price further away
- Use lower leverage, which locks more margin into an isolated position.
- Add margin to an isolated position after opening it.
- Trade a smaller size, which can also keep you in a lower tier.
- In cross mode, keep more balance in the futures wallet.
Frequently asked questions
Why do liquidation calculators disagree?
Most calculators use one maintenance margin rate for every coin and size, and one formula for every exchange. In reality each exchange sets tiers per contract and uses its own formula. This calculator loads each contract's tiers from the exchange's API and applies that exchange's published formula.
Is liquidation based on the mark price or the last price?
All of these exchanges trigger liquidation on the mark price, which follows a price index across several markets. The last traded price can briefly go past your liquidation price without liquidating you, and the reverse can also happen.
Do fees and funding change my liquidation price?
The result uses the margin you enter. Funding payments and fees add to or take from your margin while the position is open, and that moves the liquidation price. Recalculate with your current margin if a position stays open for a long time.
Can I use this for several positions in cross mode?
Not exactly. Cross mode here assumes one open position. With several positions, the unrealized profit and loss and maintenance margin of the others also count, so the real liquidation price on OKX will differ.
How current is the tier data?
Tiers are pulled from each exchange's API on a schedule, and the time of the last update is shown at the bottom of every page. Exchanges change tiers from time to time, so check the tier table against the exchange before a large trade.