XBTUSD is a Xena Perpetual for the price of Bitcoin to USD. This article outlines the mechanics of the perpetual. The full contract specifications are published on the Xena Exchange website here: https://trading.xena.exchange/contracts/XBTUSD-perpetual/summary/XBTUSD.
The value of each contract is $1, which is equivalent to one lot. The minimum order quantity is one lot, or 1 USD, per XBTUSD contract. Since the current applicable leverage is 20x, or 5%, the initial margin required to open a minimal trade is $50 or less.
The .BTC3_TWAP index is used as the underlying of the XBTUSD contract. The index is calculated as follows:
.BTC3 index is calculated as the average price of Bitcoin to USD on three exchanges:
The value of .BTC3_TWAP is the average of last 30 values of the .BTC3 index
Premium payments are calculated based on the .XBTUSD_Premium_IR_Corrected index. The index is calculated as follows:
The volume-weighted average price to execute a market buy order with a 0.1 BTC initial margin is calculated using the asks in the XBTUSD order book (.XBTUSD_Asks)
The volume-weighted average price to execute a market sell order with a 0.1 BTC initial margin is calculated using the bids in the XBTUSD order book (.XBTUSD_Bids)
The mid price is calculated as the average of the .XBTUSD_Asks and .XBTUSD_Bids values
The relative difference between the mid price and the value of the .BTC3_TWAP index is calculated as Percentage_Hourly = (Mid Price - .BTC3_TWAP) / .BTC3_TWAP and averaged over the last five minutes
The averaged relative difference is annualized as .XBTUSD_Premium_IR = Percentage_Hourly * 24 (clearings per day) * 365 (days per year)
The threshold is applied as .XBTUSD_Premium_IR_Corrected = if abs(.XBTUSD_Premium_IR) < 0.5% * 24 * 365 then 0 else .XBTUSD_Premium_IR
The actual premium payment is calculated as (.XBTUSD_Premium_IR_Corrected as of clearing) * (Position Value in BTC as of clearing) / (24 * 365). If the index value is positive, long positions pay short positions, and if it's negative, shorts pay longs.
The simpler explanation is, if the relative difference between the mid price and the underlying index value is less than 0.5%, no premium is paid or received. If it's greater, then the premium payment amount is equal to the difference between the mid price and the underlying index (in USD) for each 1 BTC in the position value.
The .BTC3_TWAP price is 3500, the mid price is 3600 (the perpetual is traded above the actual BTC price), John holds a long position of 0.35 lots, and Jane holds a short position of 0.35 lots:
The current position value in BTC is 0.35 lots * 100,000 contracts per lot * $1 (value of each contract) / 3500 = 10 BTC
John pays $100 * 10 = $1000 to Jane
The .BTC3_TWAP price is 3500, the mid price is 3400 (the perpetual is traded below the actual BTC price), John holds a long position of 0.35 lots, and Jane holds a short position of 0.35 lots:
The current position value in BTC is 10 BTC
Jane pays $100 * 10 = $1000 to John
The .BTC3_TWAP price is 3500 and the mid price is between (3500 - 0.5%) = 3482.5 and (3500 + 0.5%) = 3517.5: Neither John nor Jane pay or receive the premium