Information about funding rates and payments on GTE
premium = mark 1 hour twap - index 1 hour twap maxPremium = max rate / index 1 hour twap
86400 = the number of seconds in a day
Funding is accumulated in storage as cumulativeFunding
and compared to a position’s last cached cumulativeFunding
to return a user’s funding payment. In other words:
Where:
side = 1
for long positions and -1
for short positions
We define a positive funding payment as a scenario where capital is owed to protocol and a negative funding payment as a scenario where capital is owed to the trader.
Continuous Funding
The funding payment is calculated the same as above, but with funding effectively settled every second:
Where, for makers:
premium = limit price - index price
And for takers:
premium = average fill price - index price