Perpetual Futures Guide
wBTC/USD pair mimics a perpetual futures trade by pricing the positions with continuous stream of aggregate index prices.
Testner v0.0.1 uses a websocket stream from Coinbase Pro.
It is important to note that there are no contracts to trade but rather a leveraged position on the underlying asset, similar to margin trading. Since the multiplier on contracts is 1 USD, where 1 contract = 1 USD, you may refer to your positionSize the same way you'd refer to tradition crypto perpetual contracts.
Your positionSize always uses the index price to open and settle trades with the Twilight Pool. The maximum intial leverage allowed is 50x.

Position Calculation

  • entryValue=initialMarginleverageentryValue=initialMargin*leverage
  • positionSize=entryValueentryPricepositionSize=entryValue*entryPrice
unrealised PnL:
  • For Long
    • uPNL=positionSize(1entryPrice1settlePrice)uPNL=positionSize*(\frac{1}{entryPrice}-\frac{1}{settlePrice})
  • For Short
    • uPNL=positionSize(1settlePrice1entryPrice)uPNL=positionSize*(\frac{1}{settlePrice}-\frac{1}{entryPrice})
For calculating your maintenance margin and liquidation price, please refer to the liquidation section.
Copy link