Regardless of the type of trade, it is important to understand how profit and loss are calculated before opening a position. We will introduce them one by one in order, so that traders can accurately understand how the following variables affect profit and loss calculations.
I. Average Entry Price
In XXKK linear contract trading, the average entry price will change whenever traders add to their positions.
Example: User A currently holds a 0.1 BTCUSDT long position with an entry price of 40,000 USDT. One hour later, User A decides to open an additional 0.1 position at an entry price of 42,000 USDT.
Average Entry Price = Total Contract Value in USDT / Total Contract Quantity
Total Contract Value = [(Contract Quantity 1 * Price 1) + (Contract Quantity 2 * Price 2)] = [(0.1 * 40,000) + (0.1 * 42,000)] = 8200
Total Contract Quantity = 0.1 + 0.1 = 0.2 BTC
Average Entry Price = 8200 / 0.2 = 41,000
II. Unrealized PnL
Once an order is filled, the position and its unrealized PnL can be viewed instantly in the position area.
The formula for calculating unrealized PnL varies slightly depending on the direction of your trade.
1. For Long Positions
Example: User A currently holds a 0.2 BTCUSDT long position with an entry price of 41,000 USDT. When the current mark price shown in the position table is 43,000 USDT, the unrealized PnL will be displayed as 400 USDT.
Unrealized PnL = Contract Quantity * (Current Mark Price - Entry Price) = 0.2 * (43,000 - 41,000) = 400 USDT
2. For Short Positions
Example: User A currently holds a 0.4 BTCUSDT short position with an entry price of 40,000 USDT. When the current mark price shown in the order table is 39,000 USDT, the unrealized PnL will be displayed as 400 USDT.
Unrealized PnL = Contract Quantity * (Entry Price - Current Mark Price) = 0.4 * (40,000 - 39,000) = 400 USDT
※In USDT contracts, your profit and loss are settled in USDT. This is the exact opposite of inverse contracts (coin-margined), where settlement is made in the traded coin (for example, BTCUSD inverse contracts are settled in BTC).
※A price fluctuation (such as 1,000 USDT), regardless of the direction, means that if the position size is 1 BTC, the trader has earned or lost 1,000 USDT.
※Increasing leverage does not directly multiply your profits/losses. Instead, profits and losses are determined by the position size and price fluctuation. In simple terms, the higher the leverage, the lower the margin required to open a position; the larger the contract quantity, the greater the profit/loss; and the greater the distance between the price and the entry price, the greater the profit/loss.
※The unrealized PnL displayed by default is calculated based on the latest market price. Place your mouse over the displayed number, and the unrealized PnL calculated based on the mark price will be displayed.
※One final important point: the unrealized PnL calculation does not include any trading fees or funding fees paid or received by the trader while opening, closing, or holding the position.
III. Unrealized PnL Percentage
The unrealized PnL percentage basically displays the return on investment (ROI) of the position as a percentage.
Like unrealized PnL, this number changes continuously with the latest market price. Therefore, the formula for the unrealized PnL percentage is as follows.
Unrealized PnL Percentage (%) = [Position Unrealized PnL / Position Margin] * 100%
Position Margin = Initial Margin + Closing Fee
Example: User A currently holds a 0.2 BTCUSDT long position with an entry price of 41,000 USDT. When the latest market price shown in the order table is 43,000 USDT, the unrealized PnL will be displayed as 400 USDT. Assume that the leverage used is 10x.
Based on the previous calculation, Position Unrealized PnL = 400 USDT
Initial Margin = (Contract Quantity * Entry Price) / Leverage = (0.2 * 41,000) / 10 = 820 USDT
Closing Fee = Bankruptcy Price * Contract Quantity * 0.06% = 36877.86 * 0.2 * 0.06% = 4.4253 USDT
Unrealized PnL Percentage (%) = [400 USDT / (820 USDT + 4.4253 USDT)] * 100% = 48.52%
※Some traders have a misunderstanding about this. Increasing leverage does not increase your unrealized profit. The increase in the unrealized PnL percentage is actually because the position margin used has decreased, not because the actual profit has increased.
Using User A as an example again, the unrealized PnL is the same regardless of whether the leverage used is 10x, 5x, or 50x.
If User A uses the original leverage of 10x, the unrealized PnL = 400 USDT, and the unrealized PnL percentage = 48.52%.
If User A lowers the leverage to 5x, the unrealized PnL = 400 USDT, and the unrealized PnL percentage = 24.32%.
If User A increases the leverage to 50x, the unrealized PnL = 400 USDT, and the unrealized PnL percentage = 237.49%.
For cross-margin mode, the position margin is calculated using the highest leverage allowed under the current risk limit for the coin (for example, BTCUSDT = 125x).
IV. Realized PnL
When the trader finally closes the position, the profit or loss is realized and can be found in the contract history.
| Included in Unrealized PnL Calculation | Included in Realized PnL Calculation | |
|---|---|---|
| Position Profit and Loss | Included | Included |
| Trading Fees | Not Included | Included |
| Funding Fees | Not Included | Included |
Realized PnL = Position PnL - Opening Fee - Closing Fee - Total Funding Fees Paid/Received
User A currently holds a 0.4 BTCUSDT short position with an entry price of 40,000 USDT.
When the latest market price shown in the order table is 39,000 USDT, the unrealized PnL will be displayed as 400 USDT.
User A currently holds a 0.4 BTCUSDT short position with an entry price of 40,000 USDT. When the latest market price in the order table is 39,000 USDT, User A decides to close the entire position using a market order closing strategy. Assume that User A also opened the position using a market order and paid a total of 4.2 USDT in funding fees while holding the position.
Based on our previous calculation, Position PnL = 400 USDT profit
Opening Fee = Contract Quantity x Entry Price * 0.06% = 9.60 USDT expense
Closing Fee = Contract Quantity x Closing Price * 0.06% = 9.36 USDT expense
Total Funding Fees Paid/Received = 4.20 USDT expense
Realized PnL = 400 - 9.60 - 9.36 - 4.20 = 376.84 USDT
※The above example only applies when the entire position is opened and closed using a single order. For partial closing, all fees (opening fees and funding fees) are calculated proportionally and then displayed proportionally in the realized PnL.