What this calculator answers
This is a crypto futures calculator for USDT-margined perpetual futures. You enter your margin, the leverage, an entry price and an exit price, and choose long or short. It returns the profit or loss after fees, the return on your margin (ROE), the estimated liquidation price and how far it is from your entry, the size of the position, and the quantity of coins.
It models one position on isolated margin with a linear contract, where profit is paid in the same dollar-like currency as your margin. It does not cover stock index futures, commodity futures or other contracts that are worked out from a tick value. Those need a different calculation.
Under Advanced options you can add a trading fee and change the maintenance margin rate. Fees are left at 0 until you enter them.
How profit, ROE and position size are calculated
Your margin is the money you put into the position. The leverage multiplies it into a bigger position. The position size N is the margin M times the leverage L. The quantity Q is that position size divided by the entry price E, so it is the number of coins the position holds.
The gross profit or loss G is the quantity times the price change. For a long it is Q times the exit price X minus E. For a short the two prices swap, because a short gains when the price falls. The fees F are the fee rate f times the quantity times the entry price plus the exit price, which is the fee charged once when you open and once when you close. The net result R is G minus F.
ROE, written r here, is R divided by the margin. Because the position is L times bigger than the margin, a price move changes ROE L times as much. This is the reason leverage makes both gains and losses larger.
N = M × L, Q = N / E, G = ±Q × (X − E), F = f × Q × (E + X), R = G − F, r = R / M
How the liquidation price is estimated
On isolated margin, the exchange closes the position when your equity in it falls to the maintenance margin. Your equity is the margin plus the unrealised profit or loss. The maintenance margin is the maintenance margin rate k times the position’s value at that moment.
This page finds the price where those two amounts are equal. For a long, the equity at price P is M plus Q times P minus E, and the maintenance margin is k times Q times P. Setting them equal and solving gives the formula for a long:
P = E × (1 − 1/L) / (1 − k)
For a short the gain has the opposite sign, and the same steps give:
P = E × (1 + 1/L) / (1 + k)
The distance d is the gap between the entry price and the liquidation price as a share of the entry price. These are the formulas that come out of the exchange’s general liquidation formula for one isolated position when nothing else is in the account and the maintenance amount is zero. Fees are not part of the liquidation price here. Fees and funding payments reduce the margin, so a real liquidation can come before the estimated price shown here.
A long at 1 times leverage has no liquidation price, because the position is not borrowed and the price would have to reach zero. The page shows “None” for it. A short at 1 times leverage can still be liquidated, because there is no upper limit on the price.
A worked example
Take a long with a margin of $1,000, leverage of 10, an entry price of $60,000 and an exit price of $63,000, with no fees and a maintenance margin rate of 0.5%. The position size is $10,000.00 and the quantity is 0.166667 coins. The profit is $500.00, which is a 50% return on margin. The estimated liquidation price is $54,271.36, which is 9.55% below the entry.
The same prices as a short give the opposite result. The short loses $500.00 (-$500.00) on the move from $60,000 to $63,000, which is -50% on margin, and its estimated liquidation price is $65,671.64, which is 9.45% above the entry.
Now add a trading fee of 0.05% on each side to the long. The fees come to $10.25, so the profit after fees is $489.75 and the return on margin is 48.98%. The fee is charged on the position value, not on the margin, so it takes a larger share of the margin than it would on an unleveraged trade.
These numbers only show the arithmetic. They are not a suggestion to use any leverage, margin or fee.
Why calculators differ by a few dollars
Calculators do not all take the maintenance margin at the same place. Some take it on the entry position value, which gives a liquidation price of E times (1 − 1/L + k). That version is simple, but the exchange checks the maintenance margin on the position at the price where liquidation happens, and the position is worth less there for a long.
This page takes the maintenance margin on the position value at the liquidation price, which gives the divisor 1 − k shown above. With 1 BTC at $70,000, 10 times leverage and a rate of 0.5%, this page gives $63,316.58, which is 9.55% below the entry. The simpler version gives 63,350. That is a difference of about 0.05%.
Neither number is your exchange’s figure. The exchange adds its own margin tiers, uses the mark price and may include fees. If you want to compare tools, compare the formula they state as well as the result.
What high leverage does to the distance
The liquidation price moves toward the entry price as leverage goes up. At 10 times leverage the distance in the first example is 9.55%. At the maximum of 125 times leverage, a long from $60,000 with a 0.5% rate has an estimated liquidation price of $59,819.10, which is only 0.3% below the entry.
At that distance, an ordinary price wiggle is as big as the whole cushion. This is the arithmetic of the formula and it is not a prediction about any market. The calculator accepts any combination where the rate is below 100 divided by the leverage, because above that the position would be liquidated the moment it opens.
When the exit is beyond liquidation
If you enter an exit price that lies past the liquidation price, the page shows a warning. Take the first example with the exit at $50,000 instead of $63,000. The straight arithmetic gives -$1,666.67 and a return on margin of -166.67%, which is a bigger loss than the whole margin.
On a real exchange that cannot happen on isolated margin. The position would be closed at the liquidation price, before the exit was reached, and the loss is limited to the margin (before fees and any extra liquidation charge). The page still shows the arithmetic, so you can see how far past the liquidation price the exit was, but the warning is the part that tells you what would have occurred.
An exit exactly at the liquidation price counts as liquidated.
What the result does not include
This is an estimate for a single isolated position. It does not include:
- funding payments between longs and shorts
- the exchange’s margin tiers, where a larger position has a higher rate
- the difference between the mark price and the last traded price
- liquidation fees or the exchange’s insurance fund
- cross margin, where other balances back the position
- auto-deleveraging
- partial closes or adding margin later
Check your exchange’s own calculator and its margin table for the figure that applies to your account. To size a position from the risk you are willing to take, use the position size calculator. To see the result of a plain spot trade, with no leverage, use the crypto profit calculator.
FAQ
Why is my exchange's liquidation price different?
Exchanges use their own margin tiers, the mark price instead of the last traded price, fees and funding, and sometimes a slightly different formula. This page uses one maintenance margin rate and the notional at the liquidation price, so it is an estimate. Your exchange's figure is the one that counts.
What is the maintenance margin rate?
It is the share of the position's value that the exchange requires you to keep as equity. When your equity falls to that amount, the position is closed. The 0.5% on this page is only a starting value, because your exchange sets the real rate by position size.
What are tiered maintenance margin rates?
Larger positions usually get a higher rate. An exchange publishes a table of position sizes and their rates. This page uses a single rate for the whole position, so for a large position, look up the rate in your exchange's table and type it in.
Does the calculator include funding?
No. Funding is a payment between longs and shorts on a schedule. It changes your equity while the position is open, so it also moves the real liquidation price. This page leaves it out.
What is the difference between isolated and cross margin?
With isolated margin, only the margin you put into the position is at risk, and the position is closed when that margin is used up. With cross margin, the rest of your account balance backs the position too. This page models isolated margin.
What is ROE and how is it different from the price move?
ROE is the return on margin, which is the profit or loss after fees divided by your margin. Without fees it equals the price move times the leverage, so a 5% move at 10 times leverage is a 50% return on margin.
Why does it say my position would have been liquidated?
Your exit price is at or beyond the liquidation price. On a real exchange the position would have been closed at the liquidation price, before it reached your exit, and the margin would be gone. The profit or loss shown there only continues the arithmetic.