Perpetual futures are synthetic instruments that track the price of an underlying index such as the Dollar price of ETH. To incentivise market participants to keep perp prices in line with their index prices a perp exchange first needs to track these underlying index prices.
In the context of perpetual exchanges the index price is the price of the trading pair a market is specified to track. For example ETH-USD perps track the Dollar price of ETH. The index price in that market is the price in dollars that spot ETH is trading at.
Simply put the perpetual exchange needs to know how close perp prices are to their underlying indices.
This means that perpetual futures exchanges need prices from their own exchange and external prices representing the underlying they are tracking. These prices need to be unbiased representations of their true value and resistant to manipulation.
Price of the Underlying – Index Price
The index price reflects the fair value of a contract. Perpetual futures are built to track their underlying index so it makes sense to use this price as their fair value.
Let’s start with what the index price is used for.
Uses
Margin
Using the index price for margin means margin payments are solely a function of movements in underlying prices and not affected by the perpetual market.
This is another subtle measure incentivising convergence as it ensures that all cash flows of the perp match movements in the underlying.
Liquidations
Liquidations should also only happen when a portfolio measured by its “fair” value drops below its liquidation threshold. This means liquidations should happen using the index price rather than the perp market price which contains its own additional idiosyncratic volatility.
This has the benefit of being harder and more expensive to manipulate which is important for maintaining a healthy trading environment. Strategies such as hunting liquidation should be as difficult and expensive as possible.
Funding
Funding needs to track the price difference between the perp market and the index it tracks.
Trigger for Orders
Orders should not be triggered by variance in the perp market. Like liquidations traders expect their perps to behave like their underlyings and triggerable order levels should behave similarly. They should rely solely on the price of the underlying.
If the perp market is used there is the risk of manipulation of the perp market to profit from triggering traders orders.
An example if the perp market price is used for orders is hunting stops. A malicious trader could deliberately push perp market prices by consuming liquidity to a level where many stop orders are. The stop orders would then consume more liquidity pushing the market further to where the malicious trader would unwind their position. This is similar to a sandwich attack, but not necessarily in one block.
The downside to using the index price for orders is that if the two markets diverge sufficiently there could either be intolerable slippage to execute an order or it may get missed altogether.
Tradeoff Between Stability and Liveliness
Some of the uses of the index price listed above favour stability and resistance to manipulation and some favour liveliness.
Margin payments and liquidations should move more conservatively than funding prices and triggers for orders.
Funding prices need to be sampled frequently. The differences between the underlying index and the perp market price are then averaged out over the funding period. This reduced the impact of any particular observation, making funding rates less sensitive to temporary variance and manipulation than margin and liquidations.
In the same vein orders need to trigger against the most recent prices to avoid slippage and being missed.
This can be achieved by using two separate measures of external prices. One favouring robustness and the other favouring liveliness.
Examples of a robust measure would be an oracle feed, or even better a combination of oracle feeds excluding outliers or those that do not update. Another example for centralised exchanges is taking price feeds from a range of exchanges, taking a weighted average of the prices, and further using a time weighted moving average.
Livelier measures of prices could be prices from exchanges using a short period weighted average.
Prices on the Perpetuals Exchange
Perpetual funding rates are a function of the divergence between the price of a perpetual futures market and its underlying index. The price of each perpetual futures market therefore also needs to be measured.
There are two major issues to overcome when determining the price on an exchange:
- Prices need to be resistant to manipulation
- Prices need to be fair and unbiased
Price Sampling
Randomising the sampling time within each sampling interval makes manipulation probabilistic rather than deterministic. This makes deliberate manipulation of the funding rate costlier and adds an element of risk as the manipulation can no longer be just over an infinitesimally small period of time.
Measuring Exchange Prices
Even when sampled randomly prices can still be biased either purposely or not.
What happens if, for example in a less liquid market the last traded price happened at a level far away from the current price. One approach could be to always use the mid price defined as:
Mid Price = (Best Bid + Best Ask) ÷ 2
This could be biased if one side of liquidity is much deeper than the other such as the extreme scenario below. The small ask at 9.6 is having an oversized impact on the mid price. Said differently, removing this point has a much greater impact on the mid price than any other order. This is despite the fact that it is by far the smallest order shown. This creates two biases:
- The impact of individual orders can be very different when measured by how the mid price would be affected if they were removed.
- The impact of individual orders is not dependent on their size.
Impact Prices
To get around these problems the concept of impact prices is used. Impact prices measure the average execution price for an order of a given size, called the impact notional.
Demonstrating this using an example. Using the same orderbook from before and using impact notionals of 5 we get an approximate impact bid price of 9.38 ((9.4 × 4 + 9.3 × 1) ÷ 5) and an approximate impact ask price of 10.82 ((9.6 × 1 + 11.1 × 3 + 11.2 × 1) ÷ 5). Taking the mid point of these the market price of 10.1 is a less biased and subject to manipulation was to measure the true price of a perpetuals market.
Impact Notional
The method for calculating market prices above is dependent on defining an impact notional to use when sampling an orderbook. The question then becomes what impact notional to use?
If it is set too large, the price would not represent the actual liquidity utilised by traders. There is also the possibility of manipulation through large orders slightly away from the touch which are not likely to be utilised often but play a large role in the impact prices.
If it is set too small then it can function the same as just taking the mid price into account as in the example above which can also be manipulated.
In highly liquid markets the choice of impact notional is probably not going to make a big difference in most cases as long as it is large enough. These markets have consistent and deep liquidity on both sides of the market.
In long tail pairs should set the impact notional to a level that would attach sufficient cost to manipulation at both the low end near the touch and far away. Something like the 75th percentile trade size in the market should achieve this.
Summary
Perpetual exchanges use the price of the underlying index (index price) and the price of the perpetual itself.
The index price is used for:
- Margin
- Liquidations
- Funding (as the underlying price)
- Triggering orders
The perpetual exchange price should only be used in the calculation of the funding rate. Ideally to reduce the likelihood of manipulation impact prices should be used.
Stable robust index prices are achieved by taking a time weighted average price, using a wide range of price sources and filtering for outliers and stale prices.
These level of stability can be tweaked for the use case with liquidations and margin requiring more stability and funding and orders requiring more responsiveness.
Stable, unbiased, manipulation resistant exchange prices require random sampling. They also depend on using impact prices that incorporate liquidity beyond the touch.