1 contract is 1 BTC. Contract size is expressed in BTC.
Funding (Margin Currency)
USD - Trades are funded and profit is expressed in USD
The Mark Price is calculated based on the Reference Price, Market Price and the (underlying) Index Price as follows:
Reference Price = The last perpetual traded price or a manually set.
Market Price = The Reference Price if it falls between the current best bid and best offer.
Otherwise, the Market Price will be the best bid if the Reference Price is lower than the best bid, or the best offer if the Reference Price is higher than the best offer.
Mark Price = Index Price + Exponential Moving Average (Market Price - Index Price) where the Exponential Moving Average is calculated over a period of 15 seconds.
Swap Rate = Premium Rate + Differential Interest Rate
Where Premium Rate is calculated using the Mark to Index Spread (MIS) as follows:
MIS = (Mark Price - Index) / IndexPremium Rate = Max(0.05%, MIS) + Min(-0.05%, MIS)
And Differential Interest Rate is calculated as follows:
Differential Interest Rate = Interest Rate to borrow USD - Interest Rate to borrow BTC.
The swap rate is calculated and applied every second during the interval. Depending on whether it is negative or positive, buyers (long holders) will pay sellers (shorts holders). If negative, shorts pay longs holders. If positive, longs pay short holders.
The swap is applied to the corresponding account and accrued every second in the unrealized swap amount. At settlement time, the amount is swapped between longs and shorts accounts.
Differential Interest Rate is currently set to zero.
Frequency for Swap Rate Observation
The Swap Rate is calculated and applied every second during the 1 hour interval. Notice that the Swap Rate is expressed as a % daily rate, so when applied over 1 second, it needs to be divided by 86,400.
If the Swap Rate is negative, shorts pay longs holders. If positive, longs pay short holders. The Swap Rate is applied to the corresponding account and accrued every second in the unrealized swap amount. At settlement time, the amount is swapped between longs and shorts accounts.
Settlement happens every 1 hour
Profit (or Loss if negative), also known as P&L, for a live position is calculated based on Mark Price using the entry price (price at which the position was opened) and the position size.
Profit = Position Size * (Current Mark Price - Entry Price) + swap amounts settled IF long position
Profit = Position Size * (Entry Price - Current Mark Price) + swap amounts settled IF short position
Profit (or Loss) is settled at the time the position is closed.
Essentially, at closing time, the unrealized profit (or loss) becomes realized.
If the available balance plus P&L falls to or below maintenance margin, the system will attempt to bring available balance back up by closing live orders as a first step. If after closing all live orders, available balance plus P&L is still at or below maintenance margin, the system will then close live positions on the user account until balance plus P&L is above maintenance margin.
The second step above where the system closes all live positions is also known as forced liquidation. In this event, the user's positions are essentially taken over by the system and closed on their behalf.
If the above measures result in account bankruptcy (negative balance), the insurance fund will be used to cover the shortfall. This shortfall is essentially profit of opposite positions. There will therefore be a credit from insurance fund to user account in bankruptcy to bring its balance back to zero.
If there are not enough funds in the insurance fund to cover the bankruptcy, insurance/claim tokens will be used to cover the profit of accounts with opposite positions that are in profit, equivalent to the amount by which the account is in bankruptcy. Thus, a portion of their profits will be realized and denominated in claim tokens. At this point, a process known as “auto deleveraging” will take place whereby opposing positions are closed (or partially closed) against positions on bankrupt accounts.
When auto deleveraging occurs, opposing positions are closed at market price. Realized PnL is paid in USD up to the bankruptcy price and the remainder is paid in claim tokens.
During auto deleveraging opposing traders positions are prioritized based on leverage and profit. Positions with higher profit and higher leverage are closed first and their priority in the queue is determined as follows:
Priority = PnL Percentage * Effective Leverage IF PnL percentage > 0
Priority = PnL Percentage / Effective Leverage IF PnL percentage < 0
Effective Leverage = Mark Value / abs (Avg. Entry Value - Bankrupt Value)
PnL Percentage = abs (Mark Value - Avg. Entry Value) / Avg. Entry Value
Mark Value = Position Value at Mark Price
Bankrupt Value = Position Value at Bankruptcy Price
Avg. Entry Value = Position Value at Avg. Entry Price