# IV. Présentation des frais de financement des swaps perpétuels

Date de publication : 21 déc. 2020Date de mise à jour : 24 avr. 2024Lecture de 5 min

At OKX, our perpetual futures adopt a funding fee mechanism designed to align the market price of the perpetual market with the index price.

## Calculating the funding fee

### Funding fee formula

• Funding fee = Position value × Funding rate of this cycle

• For USDT-margined contracts: Position value = Mark price × Number of contracts × Contract size × Contract multiplier

• For crypto-margined contracts: Position value = Number of contracts × Contract size × Contract multiplier / Mark price

## Funding rate

### Predicting the funding rate

Funding rate = Clamp[MA( Premium index – Interest rate), a, b]

• Current interest rate is zero.

• Premium index = [(Best bid + Best offer) / 2 – Spot index price] / Spot index price

• MA, also known as the moving average, refers to the average value of the premium index over the last N hours till present. “N hours” refers to the number of hours between each settlement period. If funding fees are settled every 8 hours, N = 8.

• For example: MA(Premium index at Tn) = (Premium index at T1 + Premium index at T2 + ... + Premium index at Tn) / n. The funding rate is updated every minute. If the current funding fee cycle is from 12:00 am to 8:00 am, then this cycle’s funding rate is calculated using the premium index of every minute within the 12:00 am to 7:59 am time period. In other words, n = 480.

• Variables a and b are the upper and lower limits for the funding rate. For more information, please refer to /trade-market/funding/swap

### Funding fee for the current cycle

Current cycle’s funding rate is calculated based on this cycle’s premium index. The funding rate used to calculate the funding fee is taken at the moment when this cycle ends. For example, if the funding fee is settled at 4:00 pm, this cycle’s funding rate is calculated based on the premium index of the current cycle (8:00 am to 3:59 pm). The funding fee is settled using the funding rate of 3:59 pm.

## Funding fee for different margin modes

• Single-currency cross margin mode: The fee is deducted directly from the available equity of the single currency account. If equity is insufficient, pending orders that will use more margin will be canceled, including spot orders and orders to open positions in isolated and cross margin modes. The maximum funding fee is capped when your free margin equals the sum of maintenance margin and liquidation fee.

• Multi-currency and portfolio margin cross margin mode: The fee is deducted from the adjusted equity of the multi-currency account. If equity is insufficient, pending orders that might reduce the adjusted equity will be canceled, including spot orders and orders to open positions in isolated margin mode. The maximum funding fee is capped when your free margin equals the sum of maintenance margin and liquidation fee.

• Isolated margin mode: The fee is first deducted from the transferable balance of your cross margin account. If auto borrow is turned on for the cross margin positions, the borrowed crypto will count toward the transferable balance. If the transferable balance is insufficient, orders to open positions in isolated margin mode for this instrument will be canceled. Funding fees will then be deducted from the margin of your isolated positions. The maximum funding fee is capped when your free margin equals the sum of maintenance margin and liquidation fee.

• The actual funding fee a trader can receive is determined by the amount of funding fees the system can collect from the counterparty. If you hold multiple perpetual futures positions subject to the funding fee mechanism, fee deduction happens following a specific order of crypto pairs. The maximum funding fee is capped when your free margin equals the sum of maintenance margin and liquidation fee.