Perpetuals funding
Funding is collected hourly based on the ratio between longs and shorts. It is calculated using a difference between an hourly TWAP of mark price and an hourly TWAP of the index price, normalized over 24 hours.
$1h \space funding = \frac{1h \space twap \space mark - 1h \space twap \space index }{24}$
where:
• Index price is the price of the underlying asset
• $\frac{mark}{index}$
is clamped between 0.95 and 1.05