Deepdive into the passive perps
Last updated
Last updated
The perpetual futures give traders to gain leveraged exposure to a reference market by paying a funding rate. Each market is determined as an instance of the passive perp instrument determined by an oracle. Like any ‘cash-settled’ derivative, it is full determined by its cashflows:
For Reya’s passive perps, the intermediate price variation (before position closing) are computed using the spot price given by the oracle, consistent with the pegging. This means that at any time, for each unit of exposure the account’s unrealized PnL is
where might be an average of actual entry prices, or also of prices at the last PnL realization.
In Reya perps, this mark to market due to price variation is credited initially to the account’s unrealized PnL. This is so that the system keeps profits on escrow for a while, in case an extreme event makes an auto-deleveraging (ADL) necessary: ADL computes bankruptcy prices on the basis of unrealized PnL (see the documentation for the Derivatives Clearing Protocol).
Rather than a traditional funding rate mechanism, Reya Network uses a dynamic funding rate, introduced by Synthetix, adapted to the constant-product pegging. In a dynamic funding rate, the price deviation determines not the funding rate itself, but its velocity.
Details of how the funding rate velocity is set can be found below. But if denotes the current funding rate velocity, and the original funding rate is at time , the funding rate at subsequent time is
In the absence of ADL events, the funding fee accrued by a single exposure token while the velocity remains constant is
Reya’s constant-product pegging mechanism takes into consideration:
the spot price
the available liquidity in the pool;
the pool’s net exposure.
The pegging is ‘constant-product’ because it uses the slippage implied by the constant product curve known, for example, from Uniswap and other AMMs. It immediately adjusts trade prices in response to any of these three variable. Concretely,
Notice a couple of important features of the pegging formula:
if there is no net exposure (i.e., the long and short sides are perfectly balanced), the quoted price is actually the spot price;
however, whenever previous trades cause an imbalance, the price gets adjusted in a way that disincentivizes further unbalancing, and does so increasingly stronger.
This price deviation is approximately linear when the trade volume is much smaller that the maximum exposure, but, as it approaches the limit, the constant product effect kicks in and it quickly shoots up. The following table illustrates this effect for a maximal exposure of 100,000.
Uniquely, in Reya Network’s constant-product-pegged passive liquidity mechanism the price impact function automatically adjusts both trade prices and the funding rate in response to liquidity changes. This optimizes trading conditions to the risk profile of the pool at any moment: increasing the price impact and the funding rate if liquidity were drained; but also improving trading conditions in response to increases in liquidity both from new deposits and accumulated PnL.
since it could take on more positions. Maximal exposure is so defined that this is never verified as trading the pool to this level would set an infinite trade price.
The maximal exposure for a given market is the maximum exposure that would result in the pool’s exhaustion, holding all other exposures constant. Holding the other exposures constant might both have a positive or negative effect in the maximal exposure, because cross-margining might actually offset the net exposure in a market with those of others.
The net exposure of the pool determines the funding rate velocity through:
Relation to traditional funding rates: If nothing changed, under a traditional funding rate with a recovery period of 24 hours, we would incentivize convergence between the two prices by charging, every one-hour period, the amount
In other words, one hour after a change in net exposure, if the funding rate was at zero and the scaling parameter is one, the velocity will add precisely the amount that the normal funding rate would charge. However, a dynamic funding rate will keep increasing until the pool is rebalanced (or its net exposure changes sign).
Here, is the time interval between and measured in days. The convention for traditional perps is to express the time interval in hours, in which case a factor of must be included.
where is the spot price. This could be approximated by querying the spot price at regular interval, but this is not practical given the smart contract limitations. Instead, the accrued funding is approximated as
This accrued amount is added every time the funding rate velocity changes, and so the accuracy of this approximation depends on the frequency of transactions and so should it is expected to be high. On the other hand, the use of means that the actual amount is not known until the end of the interval, and so intermediate queries are estimations only — but the frequency of transactions should make this sufficiently accurate.
Here, is the pool’s net exposure after the trade.
Units: | 0 (spot) | 60 | 600 | 6,000 | 60,000 |
---|---|---|---|---|---|
Because the pool is not a spot exchange, but rather trading in ‘cash-settled’ derivatives, the maximal exposure is a measure of capital consumption by margin requirements. The capital locked for the existing exposure is expressed as a Protocol-set multiple of the initial margin requirement . The pool’s capital would be exhausted if
where is a scaling parameter. If the original funding rate is at time , the funding rate at subsequent time is
where the superscript in denotes time measured in days, while in days.
Price:
$2000
$2001.2
$2012.1
$2127.7
$5,000
Deviation (bp):
0
6
60
638
15000