In our trading system, funding is calculated and credited to your account hourly. We use Aggregate Index from CCData as the index price for funding calculation. Funding calculation is a three-step process that involves calculating the premium, funding rate, and funding value.

Step 1 - Premium Calculation

Premium is a measure of the imbalance between long and short positions in a perpetual contract, and it reflects how much the price of the perpetual contract deviates from the spot index price. Premium is calculated every minute using the following formula:

Premium=max(0, RailsBidPriceCCDataIndexPrice)  max(0, CCDataIndexPriceRailsAskPrice)CCDataIndexPrice\text{Premium} = \frac{\max(0,\ \text{RailsBidPrice} - \text{CCDataIndexPrice})\ -\ \max(0,\ \text{CCDataIndexPrice} - \text{RailsAskPrice})}{\text{CCDataIndexPrice}}

Step 2 - Funding Rate Calculation

Understanding Funding Rates

  • Positive funding rateLongs pay shorts
  • Negative funding rateShorts pay longs

The sign of the rate tells our system which side is “over-represented” or “under-represented”. When the rate is below zero, it means the position/contract is trading below the index price; shorts are effectively being subsidized to hold that position, so they must transfer the funding fee to longs.

The funding rate is calculated every hour based on 1-hour average premium, which is the average 60 premiums calculated every minute defined in Step 1.

ParameterValueDescription
TimeFactor1Normalization factor (in hours) for calculating funding rate
InterestRateComponent0.0000125Constant added to account for interest cost
MinimumFundingRate-0.04Lower bound to prevent excessively negative funding rates
MaximumFundingRate0.04Upper bound to cap extremely high funding rates
FundingRate=AveragePremiumTimeFactor+InterestRateComponent\text{FundingRate} = \frac{{\text{AveragePremium}}}{\text{TimeFactor}} + \text{InterestRateComponent}

Note that the funding rate is capped between the MinimumFundingRate and MaximumFundingRate values.

Step 3 - Funding Value Calculation

The funding value is calculated every hour when the funding rate is updated. The payment is credited to your account immediately upon calculation.

Note that the PositionSize is a negative value for short positions and a positive value for long positions.

FundingValue=(PositionSize×CCDataIndexPrice×FundingRate100)\text{FundingValue} = -(\text{PositionSize} \times \text{CCDataIndexPrice} \times \frac{\text{FundingRate}}{100})