# Funding fee mechanism

Published on Dec 21, 2020Updated on Apr 22, 20246 min read

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.

### Funding fee for the current cycle

Our platform currently has two types of funding fee settlement rules: cross-cycle settlement and current-cycle settlement (effective from January 4, 2024, for some of the adjusted perpetual futures). For futures contracts that follow current-cycle settlement, their funding rate is shown with a lightning symbol.

The main difference between the two settlement rules is how the funding rates are determined.

 Current-cycle settlement Cross-cycle settlement How are funding rates determined 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 exampleIf 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. Current cycle’s funding rate is calculated based on the previous cycle’s premium index. The funding rate used to calculate the funding fee is taken at the moment when the previous cycle ended. It stays consistent throughout this cycle.For exampleIf the funding fee is settled at 4:00 pm, this cycle’s funding rate is calculated based on the premium index of the previous cycle (12:00 am to 7:59 am). The funding fee is settled using the funding rate of 7:59 am. Scope 8:00 am UTC, January 4, 2024USDT-margined perpetual futures: FLOWUSDT8:00 am UTC, January 10, 2024USDT-margined perpetual futures: SOLUSDT, TRBUSDT, XRPUSDT, BCHUSDT, WLDUSDTPlease refer to our announcement for details. OKX to change funding fee collection mechanism for some contracts Other perpetual futures

## 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 porfolio 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.