MXC provides two kinds of contract: USDT Constract and Inverse Contract. The calculation logics of margin and PnL for the two kinds contract are the same but there’s some differences. The following are the examples to demonstrate how they’ve been calculated. Please note that in the whole calculation process, the intricate logics involving trading fee is out of consideration. How the margin being calculated is the key point we want to explain to users.
1. Explanation of Margin
Every contract on MXC perpetual contract requires margin, in turn, it enables larger leverage for contract.
The following concept about Margin need to be paid attention to:
Initial margin: The minimum margin required to open a position. The initial margin rate (Value of opened position / position margin) will also reflect the leverage multiplier.
Maintenance margin: the minimum margin to maintain a position. If the margin becomes lower than the maintenance margin, liquidation will be triggered.
Opening cost: the total asset to be frozen for opening a position, including the initial margin and possible fees.
Actual leverage rate: The current position includes the leverage ratio of unrealized gains and losses.
2. Margin calculation
In perpetual contract, the order cost is the margin required to open a position. The actual cost/return is determined by how the order being executed (Maker or taker).
Inverse contract: Order cost (margin) = Position total * face value / (leverage multiplier * position avg. price)
USDT contract: Order cost (margin) = position avg. price * position total * face value / leverage multiplier
For example:
Inverse Contract
If a trader want to purchase 10,000 cont. BTCUSDT perpetual contract at the price of $7,000 with leverage multiplier of 25, and the face value of the contract is 1 USDT, then the margin required = 10000x1/ (7000x25 ) = 0.0571BTC;
USDT Contract
If a trader want to purchase 10,000 cont. BTCUSDT perpetual contract at the price of $7,000 with leverage multiplier of 25, and the face value of the contract is 0.0001BTC, then the margin required = 10000x1x7000/25= 280 USDT;
Under cross margin mode, the margin includes initial margin and available balance in the contract account.
3. PnL Calculation
Users PnL includes fee income or expenditure, funding fee income or expenditure and PnL upon closing a position.
Fee
The expenditure of taker = Position value * Taker fee rate
The income of the maker = Postion value * Maker fee rate
Funding fee
According to the negative or positive funding fee rate and the long or short position held, the user will pay or receive funding fee.
Funding fee = Funding fee rate * position value
PnL Calculation
Closing PnL:
USDT Contract
Long position = (closing price - opening avg. price) * position total * face value
Short position= (opening avg. price - closing price) * position total * face value
Inverse contract
Long position = (1/opening avg. price - 1/closing avg. price) * position total * face value
Short position = (1/closing avg. price - 1/opening avg. price) * position total * face value
Float PnL
USDT contract
Long position = (fair price - opening avg. price) * position total * face value
Long position = (opening avg. price - fair price) * position total * face value
Inverse Contract
Long position = (1/opening avg. price - 1/fair price) * position total * face value
Short position = (1/fair price - 1/opening avg. price) * position total * face value
For example, suppose a user purchase 10,000 cont. long for BTCUSDT perpetual contract at the price of $70,000 as a taker, and the taker fee = 0.05%, maker fee = -0.05%, and funding fee rate= -0.025%, then
the user shall pay service fee of: 7000*10000*0.0001*0.05%=3.5USDT,
and the user can receive funding fee of: 7000*10000*0.0001*-0.025%=-1.75USDT (since the funding fee rate is negative, the user can receive funding fee. )
Suppose a user close 10,000 cont. BTCUSDT perpetual contract at $8,000, then
the closing PnL = (8000-7000) *10000*0.0001=1000USDT;
closing fee = 8000*10000*0.0001*-0.05%=-4 USDT (the user will receive the fee)
and the total PnL of the user = 1000+4+1.75 -3.5=1002.25
Comments
0 comments
Article is closed for comments.