The profit and loss algorithm for perpetual contracts is never as simple as it appears on the exchange interface.
It involves a multi-variable game: funding rates, mark prices, forced liquidation mechanisms, and the logic for displaying unrealized profit and loss. Users may believe they are "holding profits," but in reality, they may be in a high-risk zone. And what you might think is a "minor floating loss" is simply that the liquidation model has been activated, but has not yet been implemented.
We attempt to examine the calculation principles and psychological impact of floating profit and loss, attempting to clarify: What is the true basis for determining profit and loss, and what are the algorithmic traps?
Reading Guide
If you have any of the following questions, we recommend starting with Chapter 1;
-
Did you know that perpetual contracts are divided into forward and inverse contracts?
If you have any of the following questions, we recommend starting with Chapter 2:
-
Why do my positions appear to be profitable, but after closing them, the profit isn't as much as shown on the front end? I might even end up losing money after adding fees and funding?
-
When I opened my position, my margin was sufficient to support a 10% fluctuation. But three days later, I was forced to close my position after a 5% fluctuation?
If you have no questions above, please like and forward this article before leaving.🤣🤣
Chapter 1: Profit and Loss Calculation Mechanism
Perpetual contracts, the most popular instrument in the crypto derivatives market, allow traders to speculate on asset prices without an expiration date. Understanding how profit and loss (PnL) is calculated is the cornerstone of successful trading. The profit and loss calculation logic varies depending on the contract type, primarily falling into two categories: USDT-margined (forward contracts) and coin-margined (inverse contracts). 1.1 USDT-margined (forward) contracts: Standard linear model USDT-margined contracts, also known as forward contracts, use stablecoins (such as USDT or USDC) as margin and settlement currencies. Their intuitive and linear profit and loss calculations make them the current mainstream choice. Currently, most major exchanges (such as Binance and Bybit) primarily offer USDT-margined contracts. Their intuitive PnL structure and ease of automated fund management make them a popular choice among both retail and institutional investors.
1.1.1 Unrealized PnL
Unrealized PnL refers to the floating profit or loss during the holding period and is a core indicator used by exchanges to assess liquidation risk.
-
Key Element - Mark Price:Unrealized profit and loss are calculated based on the Mark Price, not the last traded price. The Mark Price is a composite index designed to reflect the "true" fair value of an asset, smoothing short-term price fluctuations and preventing market manipulation. It is typically composed of an index price (a weighted average of prices across major spot exchanges) and a funding rate basis to prevent unnecessary forced liquidations due to price fluctuations on a single exchange.
-
Calculation formula:
-
Unrealized profit and loss of long positions = (Mark Price - Average Opening Price) × Number of positions held
-
1.1.2 Realized Profit and Loss (Realized PnL)
Realized PnL is the final locked-in PnL after a position is closed. It includes all costs incurred during the transaction.
-
Calculation formula:Realized P/L = (Closing price - Average opening price) × Closing amount - Transaction fee - Funding incurred during the holding period
-
Key variable - Notional Value: A core pitfall for traders is confusing margin with notional value. The notional value of a contract is the total value of the position, calculated as price x quantity. Trading fees and funding charges are calculated based on the notional value of the position, not the amount of margin.
For example, a trader uses $100 in margin to open a long position with 100x leverage, controlling a position with a notional value of $10,000. If the taker fee is 0.06%, the trader's opening fee is not 0.06% of the margin (i.e., $0.06), but 0.06% of the notional value, i.e., $10,000 * 0.0006 = $6.
Similarly, a 0.01% funding fee is not $0.01, but $10,000 * 0.0001 = $1. This shows that high leverage dramatically amplifies the erosion of various fees on a trader's actual margin. Even in a sideways market, this continuous "slow bleed" significantly increases the risk of forced liquidation.
1.2 Coin-Margined (Inverse) Contracts: Non-Linear Return Structure
Coin-margined contracts, also known as inverse contracts, use the cryptocurrency being traded (such as BTC or ETH) as margin and settlement currency. The profit and loss calculation for this type of contract is nonlinear because the value of the margin itself fluctuates with market prices.
-
Profit and Loss Calculation: The profit and loss formula is based on the number of contracts (usually denominated in USD, such as $1 or $100 per contract) and the inverse of the price. This structure is also known as a "nonlinear inverse contract."
-
Calculation formula:
-
Long position profit and loss (in currency) = (Closing price - Opening price) * Position quantity - Handling fee
-
Asymmetric Risk Analysis: This non-linear payoff structure creates an asymmetric risk exposure for traders, a critical yet often overlooked pitfall. When traders go long on BTC/USD inverse contracts, as BTC prices rise, their BTC-denominated profits become more valuable when converted to USD, creating a convex, accelerating profit curve. Conversely, when the BTC price falls, while the BTC-denominated losses increase in volume, the BTC used as margin also depreciates. This dual effect means that for long positions, a 10% drop in market price will result in a loss of more than 10% in USD value, triggering forced liquidation more quickly than with linear contracts. For short positions, the opposite is true: a 10% price increase results in a less than 10% USD loss, making the risk of forced liquidation relatively low. This inherent convexity is a primary risk for long traders in bear markets, but also a structural advantage for long-term holders in accumulating the underlying asset in bull markets. This is why it's also known as a "hoarding" contract.
Chapter 2: Visible Profits, Invisible Losses—The Hidden Risks of Perpetual Contracts
We'll use a common forward contract as an example. Beyond basic profit and loss calculations, perpetual contract trading involves many hidden costs and risks, which are the main cause of unexpected losses for traders.
2.1 Mark Price vs. Last Traded Price: The Biggest Pitfall
Exchanges use the mark price to calculate unrealized profit and loss and trigger liquidations, while traders' orders are executed at the last traded price. While this dual-price system is a necessary mechanism to prevent market manipulation, it also poses significant risks for traders who focus solely on the last traded price on the chart.
-
Scenario 1: Unnecessary Stop-Loss.
During periods of extreme market volatility, a large malicious order or a "fat finger" error can cause the last traded price to instantly display an extremely long lower shadow. If a trader's stop-loss order is triggered based on the last traded price, their position may be unnecessarily closed out. At this point, the Mark Price, which is the average price across multiple data sources, may have minimal fluctuations, leaving the position far below the actual forced liquidation risk threshold.
Example: A 1-minute candlestick chart of a certain cryptocurrency experiences a spike, shocking retail investors
Trader A goes long on BTC at $31,500, with a stop-loss at $30,800. Under normal market conditions, the price fluctuates slightly between $31,400 and $31,600. However, a large sell order suddenly appears, causing the price to plummet to $30,780, where it remains for only two seconds before rebounding to $31,500.
At this time:
-
Due to integration with multiple exchange data, the mark price remains above $31,400;
-
Actually, it is not close to the forced liquidation zone.
-
However, when A saw the price of $30,900, he already set a market stop-loss.
Result: Trader A was completely driven out of the market by the liquidity shock. The market didn't change, but his own emotions drove him out. Scenario 2: Unexpected Forced Liquidation. The opposite scenario can also occur. A trader observes the stability of the latest traded price on their trading platform and believes their position is safe. However, if prices on other major spot exchanges that contribute to the index price collectively decline, the index price and the mark price will drop rapidly. Even if the latest traded price on the current exchange does not change significantly, a forced liquidation will still be triggered if the mark price hits the forced liquidation line.
-
Case Study: Platform Price Stable, Account Sudden Liquidation
Trader B shorted ETH and observed the market stabilizing at $2,000 on a small exchange. Their short position still had a safety margin based on this price.
However, the index price used by the system includes spot markets such as Binance, OKX, and Coinbase. At this point, prices on these platforms plummeted to $1,900, causing the mark price to fall below the liquidation level.
Result: Even though he was watching "his own exchange," his account was still instantly liquidated.
Traders can't just focus on the "candles in front of them"; they must keep a close eye on the "thermometer behind the scenes"—the mark price is the "death line."
2.2 Funding: Chronic Loss of Investment Under High Leverage
Funding is the fee that long and short positions in perpetual contracts regularly exchange to anchor the spot price. Its real danger lies in its interaction with high leverage. Funding fees are calculated based on the full notional value of the position, not the trader's deposited margin. High-frequency funding fees compound under leverage. For example, at 0.01% every 8 hours, the daily holding cost is 0.03%. Ten consecutive days would reduce margin by nearly 0.3%. For a 50x leveraged position, this translates to a 15% erosion of actual capital (0.3% * 50). In sideways markets, these fees are an invisible time killer.
Case Study: Real-World Calculation of Chronic Bleeding
Trader C takes a long position of 100,000 USDT in BTC, using 50x leverage and only investing $2,000 in margin.
-
The funding fee is 0.01% every 8 hours, or 0.03% per day;
-
After holding for 10 days, the cumulative funding rate is 0.3%;
Conclusion:
-
If the market is sideways, he may not seem to have lost money, but the funding fee is "bleeding" every day;
-
The higher the leverage, the longer the time, and the more volatile the market is, the greater the chronic damage caused by the funding fee.
"High leverage + volatile market + prolonged trading" = an invisible meat grinder.
2.3 Cascading Liquidations and Trading Slippage
When a large leveraged position is liquidated, it triggers a massive market order to close the position. This can trigger a domino effect, with one liquidation triggering another, resulting in a "cascading liquidation" or "market squeeze." In an illiquid market, a large number of market orders issued by the liquidation engine can quickly consume the order book depth, causing significant slippage and pushing the price further toward liquidation. This rapid price movement can trigger liquidations of concentrated leveraged positions at the next price level, creating a self-reinforcing negative feedback loop. Example: "Slippage Hell Day" on May 19, 20xx On that day, Bitcoin plummeted from $42,000 to $30,000 in less than an hour. The following chain reaction occurred:
-
Long, highly leveraged positions were forced to close;
-
The system issued a large number of market orders;
-
Order books are torn apart, resulting in massive slippage;
-
More leveraged long stop-losses or liquidations are triggered;
-
Deeper price decline → new round of liquidations → vicious cycle.
Trader D set a stop-loss at $38,000 when going long. However, due to liquidity being completely wiped out, the system's market stop-loss was ultimately executed at $34,500.
This is how slippage kills. It's not that you're willing to lose so much, but rather that the system doesn't give you a choice when it loses control.
Note: Setting a "Stop-Loss Limit" can partially prevent slippage; choosing a platform with good liquidity and a large order book depth is particularly important.
2.4 Auto-Deleveraging (ADL): The Winner's Curse
Auto-Deleveraging is a last resort risk control measure when the insurance fund is depleted. It forcibly closes the most profitable opposite positions in the market to offset the losses of bankrupt traders. Traditionally, profit-makers are the winners; however, under the ADL mechanism, these profit-makers may become victims, passively shouldering the risk of a systemic market collapse. This is a structural injustice and a form of centralized design that reverses fate.
Case Study: A Short Seller's "Windfall Dream" Collapses Instantly
Trader E shorted LUNA during the market crash, opening at $20. The price plummeted to $1, resulting in a 95% profit on his short position. However, the crash caused numerous long positions to be liquidated and bankrupted, depleting the insurance fund and triggering an automatic liquidation (ADL) system.
E's short position was automatically closed at $2.5, instead of the market price of $1.
Result:
-
Profits have shrunk significantly;
-
Unable to reopen the position;
-
You can only watch the market continue to collapse, powerless to do anything.
From heaven to earth is just a matter of the system's judgment; your "spoils" are instantly taken away by the system to "clean up the mess."
Chapter 3: Practical Exercise: The Lifecycle of a BTCUSDT Transaction
This chapter will use a complete transaction example to integrate all the aforementioned concepts.
3.1 Position Establishment and Initial Calculation
-
Scenario: A trader on Binance decides to open a 1 BTC long position with 20x leverage when the BTC price is $60,000.
-
Initial calculation:
-
Nominal value: 1BTC× $60,000= $ 60,000
-
Maintenance Margin: According to Binance's tier rules, a notional value of $60,000 falls into Tier 1, with a Maintenance Margin Rate (MMR) of 0.40%. Therefore, the required maintenance margin is: $60,000 × 0.40% = $240.
-
Estimated Liquidation Price: The liquidation price is calculated based on "Mark Price + Fees, Funding, and Slippage Buffer." Therefore, it is often lower than a trader's simple estimate based solely on the opening price and leverage. Without considering fees, the acceptable loss is $3,000 - 240 = $2,760. Therefore, the estimated liquidation price is approximately $60,000 - 2,760 = $57,240.
3.2 Scenario A: Profitable Trading
-
Market Changes: BTC price rises to $65,000.
-
Unrealized Profit and Loss: The floating profit at this point is (65,000 - 60,000) × 1 = + $5,000.
-
Holding Cost: Assume that a funding fee settlement occurs during the holding period, and the funding rate is a positive 0.01%. The funding fee the trader needs to pay is: $65,000 * 0.01% = $6.50.
-
Closing Operation: The trader closes the position at the market price of 65,000 USDT using a taker order.
-
Opening fee (Taker, 0.05%): $60,000 * 0.05% = $30.
-
Liquidation fee (Taker, 0.05%): $65,000 * 0.05% = $32.50.
-
Net Realized Profit and Loss: Net Profit = (65,000 − 60,000) × 1 − 30 − 32.50 − 6.50 Net Profit = 5,000 − 69 = $4,931. Although the apparent profit is $5,000, the transaction fees incurred when taking the order and the funding costs during the holding period, especially in high leverage situations, will eat up a large amount of the profit, and the actual amount received will be far less than the reported profit.
3.3 Scenario B: Loss-Making Trades and Forced Liquidation
-
Market Changes: BTC price began to fall.
-
Margin Depletion: As the price falls, unrealized losses accumulate and are deducted from the $3,000 initial margin.
-
Forced Liquidation Triggered: When the Mark Price fell to the estimated Forced Liquidation Price of $57,240, the trader's margin balance approached the $240 maintenance margin requirement, triggering the forced liquidation process. Many traders, even near the Forced Liquidation Price, cling to the illusion that the market is about to reverse, ignoring the Mark Price mechanism and potentially causing premature liquidation. This is one of the most common psychological pitfalls that lead to losses.
-
Final Result: The position was taken over by the liquidation engine and forced closed at the market price. The trader lost their entire $3,000 initial margin. If the liquidation was accompanied by slippage, resulting in the final execution price being lower than the bankruptcy price, the difference would be covered by the insurance fund.
Conclusion and Recommendations: Managing Risks is the Key to Surviving Cycles
Perpetual swaps, the most attractive yet riskiest instrument in the crypto derivatives market, offer high leverage, no delivery, and the flexibility of 24/7 trading. However, risks lie hidden in every detail of the profit and loss mechanism and trading system. As this article reveals, many traders, despite seemingly manageable operations, ultimately suffer unnecessary losses or even experience liquidation due to a lack of understanding of the mark price mechanism, funding fee accumulation, system forced liquidation logic, and the ADL mechanism.
Key Summary:
-
Profit and Loss Calculation Does Not Equal Visual Unrealized Profit: Unrealized profit and loss are based on the mark price, not the transaction price. A gap in psychological expectations often leads to incorrect position closing decisions.
-
Transaction fees and funding fees erode profits: High leverage magnifies small transaction fees and funding fees into margin killers, especially in volatile markets where "chronic bleeding" is most severe.
-
The mark price is the true death line: Ignoring this is tantamount to being blind in trading.
-
Forced liquidation mechanisms are often accompanied by slippage and systemic chain reactions: individual judgment is often powerless under system pressure.
-
Under the ADL mechanism, profits are not safe: winners may also be "sacrificed" by the system to maintain stability. This is the harsh reality that traders must accept.
Practical (and bloody) advice:
-
If after reading the above article you find the contract trading mechanism complex and difficult to grasp, then don't try contract trading!
-
Master the platform rules: Each platform (Binance, Bybit, Bitget, etc.) has subtle differences in fee structures, liquidation mechanisms, funding frequency, and other aspects. Understanding these differences is the foundation for refined operations.
-
Avoid excessive leverage and maintain appropriate position control: This doesn't mean you can't use leverage, but it's important to understand that with every doubling of leverage, both unrealized profits and losses increase exponentially, and your margin of error decreases dramatically.
-
Set a stop-loss limit, not a market stop-loss: During volatile market conditions, a stop-loss limit can effectively prevent secondary damage from slippage. (This is really important—set a stop-loss to minimize losses.)
Continuously monitor the mark price and index composition:Make use of the "mark price" and "forced liquidation warning" tools provided by the platform, rather than relying solely on the latest transaction price on the candlestick chart.
Avoid peak funding periods and optimize your position structure: If you are not a short-term trader, try to avoid holding positions for extended periods when funding rates deviate significantly. Consider strategies such as opening positions in batches and hedging to reduce net fees.
Shorten your trading cycle in highly volatile markets: The greater the uncertainty, the shorter the time you should stay in the market. Flexibility is more important than predicting the direction.
May we always maintain a reverent respect for the market.
Don't let floating profits and losses become a fleeting illusion.
More importantly, find peace of mind when you discover your floating profits and losses are unsatisfactory.
Peace of mind is the ultimate destination.
-