Skip to main content
In our trading system, funding is calculated and credited to your account hourly. Funding calculation is a three-step process involving the premium, funding rate, and funding value.

Key Definitions

  • railsBidPrice: Highest bid price on Rails order book
  • railsAskPrice: Lowest ask price on Rails order book
  • indexPrice: Current market index price for the asset
  • averagePremium: 1-hour average of the premium (see below)
  • timeFactor: 1 (normalization factor in hours)
  • interestRateComponent: 0.0000125 (interest cost adjustment)
  • minimumFundingRate: -0.04 (lower bound)
  • maximumFundingRate: 0.04 (upper bound)
  • positionQuantity: Size of the position (positive for long, negative for short)

Calculation Formulas

FieldFormulaDescription
premium(max(0, railsBidPrice - indexPrice) - max(0, indexPrice - railsAskPrice)) / indexPricePremium, calculated every minute
fundingRateaveragePremium / timeFactor + interestRateComponentFunding rate, calculated hourly (bounded between minimumFundingRate and maximumFundingRate)
fundingValue-(positionQuantity × indexPrice × fundingRate / 100)Funding value, credited hourly
Understanding Funding Rates
  • Positive fundingRateLongs pay shorts
  • Negative fundingRateShorts 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.

Usage in API

Funding calculations are used in the Get Account Fundings response, where you can see the hourly funding credited to your account for each open position.