The Funding Amount is calculated based on a position size of long 1 perpetual. Each position Funding Payment is the Funding Amount multiplied by the position size.
Funding Amount = TWAP(Perpetual Price - Spot Price) / 24
-
Perpetual = Median(Best Bid, Best Ask, Last) of the Perpetuals order book for each 1 min during the 60 min funding period.
-
Spot = Median(Best Bid, Best Ask, Last) of the Spot order book for each 1 min during the 60 min funding period.
TWAP(Perpetual Price - Spot Price) is calculated by taking an average of {(Open(Perpetual) - Open(Spot)), High(Perpetual) - High(Spot), Low(Perpetual) - Low(Spot), Close(Perpetual) - Close(Spot))} for each 1 min and then taking the average of the 60 1 min bars in each 1 hour.
Note: TWAP = Time-Weighted Average Price
If the Funding Amount is > 0 then the Long Holders pay Short Holders.
If the Funding Amount is < 0 then the Short Holders pay Long Holders.