Because Perpetuals have no expiration date, final settlement, or delivery, funding rate payments are the incentive mechanism to bring Vortex’s mark price closer to the oracle price.
For instance, a trader with a short position in a market whose mark price > oracle price will receive a payoff proportional to their position size.
Funding is collected hourly based on the ratio between longs and shorts, using a daily funding period. It is calculated using the difference between an hourly time-weighted average price (TWAP) of mark price and an hourly TWAP of the oracle price normalized over 24 hours.
Funding Formula and Example
tiTwap(t)mTwap(t)fundingRate(t)cumFundingRate(t)amm.cumFundingRate(0)amm.cumFundingRate(t)fundingPaymentuserExampleAlice:=an ever increasing hour index, e.g. the number of hours after the luanch of Matrix:=index TWAP at the end of hour t:=mark TWAP at the end of hour t:=60×60mTwap(t)−iTwap(t):=cumulative funding rate from time 0 to time t=0=t∑60×60mTwap(t)−iTwap(t):=position.baseAsset×(amm.cumFundingRate−position.lastCumFunding)//note this is for single market, we need to sum all funding payment for a user against all market index:=base asset: 37.5 (in UST), quote asset: 300 UST at hour t0
Suppose now the TWAP mark price and index price are $1.6/$1.6, $1.62/$1.6 and $1.64/$1.61 at t0, t1 and t2 respectively, Alice’s payment in t1 and t2 will be the following: