Your numbers
What it says
Ready to go further
Next: see how the same idea works on a margin account
Liquidation on futures and a margin call on a forex account follow the same pattern. The margin call guide shows it with a bot that adds to losing trades.
What is included
- The calculator, with your own numbers
- The formula written out
- A worked example you can reproduce
- Where grid, martingale and DCA bots break the maths
Who it is for
- People running or testing a trading bot
- Anyone sizing a position or checking costs
- Readers learning how the numbers work
- Not advice, and not for placing trades
Key facts
- Long liquidation = entry x (1 - 1/L + m). Short liquidation = entry x (1 + 1/L - m). L is leverage and m is the maintenance margin rate as a decimal.
- The price move that wipes out the initial margin is 1/L. Liquidation comes a little sooner, by the maintenance margin rate, because the exchange closes the position before the margin hits zero.
- This is a simplified model for learning the shape. Real exchanges differ in fees, funding, cross margin, tiered maintenance rates and how liquidation is carried out.
- Do not trade on this number. Use your exchange's own liquidation price, which accounts for what this model leaves out.
- Every example number on this page is made up and is not a quote from any exchange.
How the calculator works
In a perpetual futures contract on isolated margin, you post a fixed amount of margin for one position, and the most you can lose on that position is that margin. Leverage of 10x means the margin is one tenth of the position value. A fall in price of 10 percent therefore uses up all of it on a long. The exchange does not wait for that: it closes the position when the remaining margin falls to the maintenance margin, a small safety slice.
Short liquidation = entry x (1 + 1/L - m)
Price move that wipes out the margin = 1/L
L = leverage, m = maintenance margin rate as a decimal (0.5 percent = 0.005)
A worked example
Take a made-up long position entered at $50,000 with 10x leverage and a maintenance margin rate of 0.5 percent. The buffer is 1/10 - 0.005 = 0.095, so liquidation is at 50,000 x (1 - 0.095) = $45,250, a fall of 9.5 percent. The price that would wipe out the whole margin is $45,000, a fall of 10 percent. The 0.5 percent gap between them is the maintenance margin.
At 20x the buffer is 0.05 - 0.005 = 0.045, so liquidation is at $47,750, only 4.5 percent below the entry. A short at 10x is liquidated at 50,000 x (1 + 0.095) = $54,750, a rise of 9.5 percent. Calculated by us on 27 Oct 2026, exact arithmetic on made-up inputs.
What this model leaves out
Be clear about the limits. Real exchanges differ, and this is an approximation to learn the shape. They typically add some or all of the following, and each moves the real number:
- Fees. Opening and closing fees reduce the margin that is left to absorb the move.
- Funding. Perpetual contracts exchange a funding payment between longs and shorts on a schedule. Paid funding eats margin over time.
- Cross margin. If the whole account backs the position, as opposed to isolated margin, the liquidation price depends on every other position and on the balance.
- Tiered maintenance rates. Bigger positions often face a higher maintenance margin rate, so the liquidation price comes closer as the position grows.
- Insurance and liquidation mechanics. Some positions are closed in steps, some at a mark price rather than the last trade, and a fast move can close the position beyond the liquidation price.
Futures grid bots and liquidation
A futures grid bot places buy and sell orders at set price levels on a leveraged contract. Each fill adds to the position, so the average entry and the size change as price moves. A long grid that keeps buying on the way down has a bigger position at lower prices, and the liquidation price moves closer to the current price with every fill, not further away. The leverage setting on the bot is therefore only the start of the story. The effective leverage grows as the grid fills.
That is why a grid can look calm through a small range and then be liquidated in a move to its bottom edge. If the lowest grid level sits above the liquidation price, the grid can finish its range intact. If it sits below, the position is closed at the exchange before the grid gets there. The page on futures grid liquidation works through a grid with real arithmetic.
It is the same mechanism as a margin call on a forex account, with one difference. On futures the position is closed automatically at liquidation, while a forex broker may warn first. The margin call guide covers the forex version and the margin calculator works it out for a position.
Checks before using leverage on a bot
- Find the exchange's own liquidation price for the biggest position the bot can build, not the first order.
- Check where the bot's lowest (or highest) level sits against that price.
- Read the exchange's maintenance margin tiers for your position size.
- Leave extra margin as a buffer if the bot allows it, and know what happens when funding is negative for you.
Keep Going
Related Tools and Guides
Keep exploring
FAQ
Frequently Asked Questions
Is this the same as my exchange's liquidation price?
No. It is a simplified model. Exchanges include fees, funding, tiered maintenance rates, and sometimes cross margin and a mark price. Always use the number your exchange shows, and expect it to differ from this one.
What is the maintenance margin?
It is the minimum margin the exchange requires to keep a position open, as a percent of the position value. When your margin falls to that level, the position is closed. The rate is set by the exchange and often rises with position size.
What is the difference between isolated and cross margin?
On isolated margin only the margin set aside for the position is at risk. On cross margin the whole account balance backs the position, so it can survive longer but can also lose more than you meant to put in.
Why is a short liquidated above the entry price?
A short loses money when price rises, so its liquidation price is above the entry. The formula flips the sign. The distance is the same percent in the opposite direction, in this simplified model.
Does lower leverage make me safe?
It moves the liquidation price farther away, which helps. It does not remove the risk of loss, and it does nothing about a bot that keeps adding to the position as price moves against it.
Are the numbers on this page real?
Example numbers are made up to show how the maths works, and the page says so. A figure only counts as exact when the page says it was calculated on a stated date. Nothing you enter in a calculator leaves your browser.
Can I use this to decide whether to run a bot?
It can show whether a bot's numbers hold together and how much an account can lose. It cannot say what the market will do, and it is not advice. Use it to ask better questions, then read the terms of your own broker or exchange.
Is this financial advice?
No. It is a calculator and general education. It does not know your exchange, your contract or your situation.
Know the Risk Before You Run It
Free calculators and guides, added every week. Leave your details and we will email you when new ones go up.
Trading carries a risk of loss