Key Definitions
| Term | Description |
|---|---|
| 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
| Field | Formula | Description |
|---|---|---|
| premium | (max(0, railsBidPrice - indexPrice) - max(0, indexPrice - railsAskPrice)) / indexPrice | Premium, calculated every minute |
| fundingRate | averagePremium / timeFactor + interestRateComponent | Funding rate, calculated hourly (bounded between minimumFundingRate and maximumFundingRate) |
| fundingValue | -(positionQuantity × indexPrice × fundingRate / 100) | Funding value, credited hourly |
Understanding Funding Rates
- Positive fundingRate → Longs pay shorts
- Negative fundingRate → Shorts pay longs