Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.qfex.com/llms.txt

Use this file to discover all available pages before exploring further.

What are QFEX Perpetual Futures?

A perpetual future is a derivative contract that allows you to speculate on the price of an underlying asset without ever having to physically own it. Unlike traditional futures contracts, perpetuals do not have an expiry date. You can hold a position for as long as you like, provided you maintain sufficient margin. Perps are the end state of leveraged finance. They are the most efficient and user-friendly way of trading all manner of asset classes. To ensure the price of the perpetual contract (Mark Price) stays close to the spot price of the underlying asset (Index Price), a mechanism called Funding is used. All QFEX Perpetual Futures are margined in USDC on Arbitrum. USDC is compliant with US Law and backed by US Treasuries.

Index Price Sources

The Index Price is the reference spot price for the asset. We aggregate data from high-quality sources:
  • Equities: Real-time feeds from US stock exchanges.
  • Indices: Derived from futures data.
  • FX & Precious Metals: An aggregate of the most liquid ECNs.

Oracle Pricing

Our default pricing is: For non-equity indices: Ptoracle=PtindexP_t^{\text{oracle}} = P_t^{\text{index}} For equity indices: Ptoracle=Plast closeequity index+ΔFtP_t^{\text{oracle}} = P_{\text{last close}}^{\text{equity index}} + \Delta F_t where ΔFt\Delta F_t is the corresponding change in the equity index future.

Futures-Based Oracle Rolls

Some QFEX products derive oracle pricing from a dated futures contract and therefore roll from one contract month to the next on a published schedule to be found in reference data. For CL-USD, COPPER-USD, and NATGAS-USD, the roll schedule is:
  • On the 5th business day, the oracle remains 100% front-month.
  • On the 6th business day, the oracle is 80% front-month and 20% next-month.
  • On the 7th business day, the oracle is 60% front-month and 40% next-month.
  • On the 8th business day, the oracle is 40% front-month and 60% next-month.
  • On the 9th business day, the oracle is 20% front-month and 80% next-month.
  • On the 10th business day, the oracle is 100% next-month and the roll is complete.
In other words, the contract blend shifts by 20 percentage points per business day until the next month fully replaces the previous front month. Use GET /settlement-calendar to resolve the active dated future for a supported QFEX symbol. The response returns:
  • future_symbol: the futures contract currently used by the oracle.
  • active_until: the last timestamp at which that contract remains active for the QFEX symbol.
  • expiration: the expiration timestamp of that dated future.
If time is omitted, the endpoint returns the currently active contract. For live integrations, use the QFEX settlement calendar endpoint rather than hardcoding roll dates. If the last known Index Price is stale (ie, the market is closed or otherwise down), we do the following:

1. Impact Notional Calculation

The system calculates the Volume-Weighted Average Price (VWAP) to fill a specific “Impact Notional” amount (defined below) from the top of the order book.
  • Impact Bid: The average price to sell the impact notional amount into the bids.
  • Impact Ask: The average price to buy the impact notional amount from the asks.

2. Impact Price Deviation (IPD)

IPD measures the pressure on the price relative to the last traded price (or last calculated price). It is calculated as: IPD=max(ImpactBidPlast,0)max(PlastImpactAsk,0)IPD = \max(ImpactBid - P_{last}, 0) - \max(P_{last} - ImpactAsk, 0) Where:
  • PlastP_{last} is the latest Index price.
  • Only “improving” deviations contribute to the IPD (i.e., if the Impact Bid is higher than current price, it pushes price up; if Impact Ask is lower, it pushes price down).

3. Price Update

The price is updated using an Exponential Moving Average (EMA) model to smooth out volatility while drifting towards the order book pressure. The formula used is: St=βtSt1+(1βt)xtS_t = \beta_t \cdot S_{t-1} + (1 - \beta_t) \cdot x_t Where:
  • StS_t: New price.
  • St1S_{t-1}: Previous price.
  • xtx_t: Target price based on IPD, defined as xt=St1+IPDtx_t = S_{t-1} + IPD_t.
  • βt\beta_t: Decay factor, defined as βt=eΔt/τ\beta_t = e^{-\Delta t^* / \tau}.

Time and Constants

  • τ\tau (Tau): Time constant, set to 8 hours (28,800 seconds). This controls the “inertia” of the price.
  • Δt\Delta t: Time elapsed since the last update.
  • cc (Clamp Factor): Set to 0.1.
  • Δt\Delta t^*: Clamped time delta, defined as min(Δt,cτ)\min(\Delta t, c \cdot \tau). This prevents large jumps if updates are sparse.