**1.Funding fee**

The perpetual contract has no expiration or settlement, and the contract price is the underlying spot price based on the "funding fee mechanism". Funding rates are incurred every 8 hours at UTC-0 00:00 (GMT + 8 08:00), UTC-0 08:00 (GMT + 8 16:00) and UTC-0 16:00 (GMT + 8 24:00). You will only pay or receive funding if you hold a position at the Funding Timestamp.

If you close your position before the Funding Timestamp, you do not need to collect or pay funds. At the time of settlement, whether the user should collect or pay the fund fee depends on the current fund rate and the user's position. When the funding rate is positive, the longs pay the funding fee, and the shorts will be paid; when the funding rate is negative, the shorts pay the funding fee, and the longs will be paid.

**2. Funding fee calculation**

Funding Fee = Position Value*Funding Rate (When calculating the cost of funds, calculate the marked price of the position value = index price). The value of your position has nothing to do with leverage. For example, if you hold 100 BTCUSDT contracts, USDT funds will be charged at the nominal value of those contracts, not based on how much margin you have allocated for the position. When the funding rate is positive, longs pay shorts. When the funding rate is negative, Shorts pay longs the longs.

**3. Funding rate**

WBFutures calculates the premium index and interest rate (I) every minute and then calculates it's minute time-weighted average every 8 hours. Funding rates are calculated based on the interest rate and premium index components every 8 hours, adding ±0.05% buffer.

Perpetual contract different trading pair to fund rate limit ratio (R), different trading pair has different configuration, the specific configuration is as follows:

Therefore, based on different trading pairs, the calculation formula is as follows:

Ft=clamp{Pt+clamp (It-Pt,0.05%,-0.05%),R*minimum maintenance margin rate,- R*minimum maintenance margin rate}

Therefore, if (I-P) is between ±0.05%, then F = P + (I-P) = I. In other words, the funding rate will be equal to the interest rate.

The calculated funding rate will be used to calculate the trader's position value, and then calculate the fund fee that needs to be paid or received at the corresponding timestamp.

**4. Why is funding rate important?**

Traditional contracts are settled monthly or quarterly, depending on the contract specifications. At the time of liquidation, the contract price and the spot price converge, and all open positions expire. Perpetual contracts are widely used by many cryptocurrency derivatives trading platforms, and their design is similar to traditional contracts, but there is a key difference.

Unlike traditional contracts, perpetual contract traders can hold positions all the time, without expiration dates, and no need to track different delivery months. For example, a trader can hold a short position permanently until it is closed. Therefore, perpetual contract trading is very similar to the trading of spot market trading.

**5. Interest rate and premium index**

The rate of funds consists of two parts: the interest rate and the premium index. This rate is designed to ensure that the trading price of perpetual contracts underlying the reference price. In this way, contracts are similar to the spot market for margin trading, where buyers and sellers regularly exchange funds rates.

**Interest rate components**

Each contract traded on WBFutures is consist of two currencies: commodity currency and quote currency. For example: BTC/USDT, the base currency is BTC, and the quote currency is USDT. The interest rate is a function of the interest rate between these two currencies:

Interest rate (I) = (denominated interest rate index-based interest rate index) / fund rate interval

Base interest rate index = Interest rate of the base currency

Pricing interest rate index = Borrowing interest rate of the pricing currency

Funding rate interval = 3 (Since and the quote currency funds are generated every 8 hours.)

Note: The current interest rate difference is set to 0.01% per day.

**Components of the premium index**

Sometimes the price of perpetual contracts is at premium or discount compared to the marked price. In this case, the premium index will be used to raise or lower the next funding rate to bring it in line with current levels of contracts trading.

**a. ****Premium Index (P)**

The premium index reflects the current basis rate of the funding rate, and the deviation of the depth-weighted buying/selling price from the reasonable price, under a combined situation, resulted in premium and being calculated every minute.

Premium index = (mark price reasonable basis t + max (0, depth weighted buy price t-mark price t)-max (0, marked price t-depth weighted sell price t)) / index price t

Among that:

Mark price reasonable basis t=mark price t-index price t=index price t*(1+funding rate t1*Ʈ/Δt)-index price = index price* (funding rate of the previous settlement * τ/Δt )

The limit range of the perpetual contract premium index is unified to 0.0005.

**b. D****epth-weighted bid / ask price**

Depth weighted buy/sell price equals to the maximum leverage according to the impact of the margin, reachable gear N, to caculate the weighted average from the first gear to the Nth gear, based on the number of orders.

Margin impact amount = initial margin * maximum leverage

For example, if the margin impact amount is 1000USDT, then the depth-weighted bid/buy price = 1000USDT/ sum (number of pending orders in N file)

**WBFutures Team**

**March 23, 2020**

## Comments

0 comments

Article is closed for comments.