# Funding rates

Periodic funding payments are the most common mechanism used by exchanges to do perpetual swaps. Funding payments act to converge the **mark price** (the price on Position Perpetual Trading Protocol) and the **index price** (the average price from major exchanges - Chainlink price).

Position Perpetual Trading Protocol calculates funding payments every hour.

Position Perpetual Trading Protocol follows [FTX's method](https://help.ftx.com/hc/en-us/articles/360027946571-Funding) to calculate the funding payments, which is as follows:

$$
fundingPayment = positionSize \* fundingRate
$$

The *fundingRate* in the formula above is calculated by, firstly, subtracting the *hourly time-weighted average price (TWAP) of the index price* from the *hourly TWAP of the mark price*, and secondly, dividing the result from the previous step by 24. (Note: FTX's formula results in funding denominated in *position size*, whereas our calculation expresses funding in *quote asset*, ie. USDC.)

$$
fundingRate = {TWAP\_{perpetual} - TWAP\_{index} \over 24}
$$

We use the price feed from **Chainlink** as the data source for the index price because it is currently the most battle-tested Oracle solution on the market. Other oracles will be added as needed.

If the *fundingRate* is positive, long position holders need to **pay** the funding payment while short position holders will **receive** the funding payment, and vice versa if the rate is negative.&#x20;

The funding payment happens at the **end of each hour** on Position Exchange's Perpetual Trading Protocol.

##
