For the complete documentation index, see llms.txt. This page is also available as Markdown.

Funding Mechanism

Learn how Rails calculates hourly funding rates and payments for perpetual markets.

Funding Overview

Unlike expiring derivatives, perpetuals contracts have no expiry date, and thereby lack a natural settlement mechanism that aligns their price with the index price. Funding makes the crowded side of the market more costly to hold, incentivizing traders to rebalance positions and limits price divergence.

Funding consists of regular payments between traders with long and short positions. It keeps a perpetual contract's price close to its index price.

Rails calculates the funding rate each hour. The rate determines which side pays:

  • A positive rate means the perpetual trades above the index price. Long positions pay short positions.

  • A negative rate means the perpetual trades below the index price. Short positions pay long positions.

How is funding calculated?

Rails calculates funding in three steps.

1

Premium Calculation

In perpetual trading, premium measures the difference between executable perpetual-market prices and the index price. It uses impact prices, which reflect the average execution price for a fixed impact notional. This reduces the influence of small top-of-book orders. Rails calculates the premium every minute using this formula:

Premium=max⁡(0,Impact Bid Price−Index Price)−max⁡(0,Index Price−Impact Ask Price)Index Price\text{Premium} = \frac{\max\left(0, \text{Impact Bid Price} - \text{Index Price}\right) - \max\left(0, \text{Index Price} - \text{Impact Ask Price}\right)}{\text{Index Price}}

Here, Impact Bid Price\text{Impact Bid Price} is the average price to sell the impact notional into available bids. Impact Ask Price\text{Impact Ask Price} is the average price to buy the impact notional from available asks. Index Price\text{Index Price} comes from Index Price source data.

The premium is positive when the Impact Bid Price exceeds the Index Price. This means the perpetual trades above spot. It is negative when the Index Price exceeds the Impact Ask Price. This means the perpetual trades below spot. It is zero when the Index Price sits between the Impact Bid and Impact Ask prices. This is the normal case.

2

Funding Rate Calculation

Rails calculates the funding rate every hour using the average premium from the previous hour. Rails settles funding payments every hour using that funding rate.

Funding Rate=clamp⁡(Average Premium8+Interest Rate Component,−0.005,+0.005)\text{Funding Rate} = \operatorname{clamp}\left(\frac{\text{Average Premium}}{8} + \text{Interest Rate Component}, -0.005, +0.005\right)

The funding rate is capped between minimum and maximum values. This prevents excessive funding payments. The parameters are:

Parameter
Value
Description

Time Factor (in hours)

8

Funding is calculated hourly. Dividing the average premium by 8 normalizes the hourly rate.

Interest Rate Component

0.00125%

A fixed hourly value added to the funding rate. It reflects the cost of holding a leveraged position, similar to interest on borrowed capital. It is added after the previous hour’s average premium is divided by 8.

Minimum Funding Rate

-0.5%

The lower bound on the funding rate.

Maximum Funding Rate

0.5%

The upper bound on the funding rate.

3

Funding Value Calculation

Rails calculates and pays the funding value every hour. Funding payments are automatically credited or debited from your account. A positive Position Size represents a long position. A negative Position Size represents a short position.

Funding Payment=-Position Size×Index Price×Funding Rate\text{Funding Payment} = \text{-Position Size} \times \text{Index Price} \times \text{Funding Rate}

Funding rates use decimal fractions. For example, 0.0001 equals 0.01%.

Where to see funding on Rails

Still need help? See our troubleshooting tips.

Last updated

Was this helpful?