Funding

Overview

The funding mechanism is a crucial component of perpetual futures trading. It ensures that the price of the perpetual contract closely tracks the underlying asset’s spot price. Unlike traditional futures contracts, perpetual futures do not have an expiration date. To maintain price stability and avoid significant deviations from the spot price, a periodic funding mechanism is implemented.

Funding payments occur at each hour mark. Traders holding long and short positions pay or receive a funding fee based on the difference between the contract price and the spot price. These payments are fully peer-to-peer with no fees taken by the exchange. The funding payment for an account position depends on the size and side of the position, as well as the funding rate.

The funding rate represents the difference between the mark price of the perpetual futures market and the index price, which is equivalent to the spot market price of the underlying asset.

When the funding rate is positive, users with long positions pay a funding fee to users with short positions. When the funding rate is negative, users with short positions pay a fee to users with long positions.

Funding Rate Calculation

For each minute at a random time, Lighter calculates the premium of each market, which represents the differentiation of the mark price from the index price for the corresponding market with the following formula:

premiumt=Max(0,Impact Bid Pricetindext)Max(0,indextImpact Ask Pricet)indext\small premium_{t} = \frac{Max(0, \text{Impact Bid Price}_{t} - index_{t}) - Max(0, index_{t} - \text{Impact Ask Price}_{t})}{ index_{t}}

Note: For the premium to be positive, i/e: for the funding to be positive and long positions to pay more funding to short positions, the impact bid price needs to be higher then the index price. In the case where Impact Bid PricetindextImpact Ask Pricet\text{Impact Bid Price}_{t} \leq index_{t} \leq \text{Impact Ask Price}_{t} the premiumtpremium_t will be 0

At the end of each hour, a 1-hour premium is calculated as the time-weighted average of the 60 premiums calculated over the course of the last hour. In addition to the premium component, each market has a fixed interest rate component that accounts for the difference in interest rates of the base and quote currencies. The funding rate is then calculated as:

premium:=Average of premiumt since the latest fundingsmallClampedPremium=InterestRate+premium+clamp(premium,SmallClamp,+SmallClamp)fundingRate=clamp(smallClampedPremium,BigClamp,+BigClamp)/8whereclamp(x,a,b)=max(a,  min(b,x))the values used for the majority of the markets are the following:SmallClamp=0.05% BigClamp=4% InterestRate=0.01%\small premium := \text{Average of } premium_{t} \text{ since the latest funding} \\ smallClampedPremium = InterestRate + premium + \operatorname{clamp}(-premium, -SmallClamp, +SmallClamp) \\ fundingRate = \operatorname{clamp}(smallClampedPremium, -BigClamp, +BigClamp) / 8 \\ \text{where} \operatorname{clamp}(x,a,b) = \max\bigl(a,\;\min(b,x)\bigr) \\ \\ \\ \text{the values used for the majority of the markets are the following:} \\ SmallClamp = 0.05\%\ BigClamp = 4\%\ InterestRate = 0.01\%

Note: The SmallClampSmallClamp is used to bring the premiumpremium closer to 0. For example, if the premium would be 0.1%0.1\%, the smallClampedPremium=0.01% +0.1% 0.05%=0.06%smallClampedPremium = 0.01\% \ + 0.1\%\ - 0.05\% = 0.06\%.

Note: If SmallClamppremium+SmallClamp- SmallClamp \leq premium \leq +SmallClamp, then fundingRate=InterestRate/8fundingRate = InterestRate / 8What this mean, is that if the premium is less than 5 basis points, the funding will default to the normal value of 1 basis point per 8 hours.

Note: The BigClampBigClamp limits funding payments to 4%4\% per 8 hours, or 0.5%0.5\% per hour.

Dividing the 1-hour premium by 8 ensures that funding payments for the premium are distributed over 8 hours, closely aligning with the approach adopted by centralized perpetual exchanges.

Funding round payment for account i and market j is calculated as follows:

fundingaccounti,j:=(1)×positionaccounti,j×markj×fundingRatej\small funding_{{account_i},j} := (-1) \times position_{{account_i},j} \times mark_{j} \times fundingRate_{j}

Last updated