Skip to main content

Funding rate

Formula

In order to calculate the funding rate, it is necessary to first calculate the skewness between long and short open interest in a given market. The skewness can be determined through the following formula:

S=LSL+S\begin{equation*} S = \frac{L - S}{L + S} \end{equation*}

where:

  • S: skewness
  • L: long open interest
  • S: short open interest
fF=RbeCSnf\begin{equation*} f_F = R_be^{CSn_f} \end{equation*}

where:

  • fFf_F: funding rate,
  • RbR_b: default interest rate = 0.01 %
  • CC: Change scalar = 2
  • SS: Skewness between long and short open interest
  • nfn_f: The number of funding intervals when the skewness does not change and keep increasing

The funding rate is an exponential function of the default interest rate that uses the number e for a smooth and natural growth. The exponent of the func- tion is a multivariable function composed of two variables: S, which represents skewness, and nf , which represents the number of funding intervals that have not gone in the opposite direction. This means that when there is a persistent long skew, funding rates will continue to increase over time. Conversely, when short positions dominate, funding rates will decrease as long as the short skew is maintained.

The exponent scalar, denoted by C, exhibits a doubling effect whenever there is a change in S or nf . This results in a rapid escalation of the rate, which incentivizes traders on the dominant side to close their positions in order to avoid incurring high funding rates from the counterparty side. Funding rate is capped between -1 and 1%.

Funding payout

Every 8 hour, Void Exchange will settle funding payout. The dominant side will need to pay fundings to the other side. In order to efficiently store the state of funding payout within the resource limitations of smart contracts, we use four variables below:

  1. Long funding index: accumulated positive funding rate.
ILt=ILt1+FLt\begin{equation*} I_{L_t} = I_{L_{t-1}} + F_{L_t} \end{equation*}
  • ILtI_{L_t}: Current long funding index
  • ILt1I_{L_{t-1}}: Long funding index of previous funding interval
  • FLtF_{L_t}: Positive funding rate at current funding interval
  1. Short funding index: accumulated negative funding rate.
ISt=ISt1+FSt\begin{equation*} I_{S_t} = I_{S_{t-1}} + F_{S_t} \end{equation*}
  • IStI_{S_t}: Short funding index
  • ISt1I_{S_{t-1}}: Short funding index of previous funding interval
  • FStF_{S_t}: Negative funding rate at current funding interval
  1. Short funding payout index: accumulated funding payout to short positions per token.
PISt=PISt1+LSFLt\begin{equation*} PI_{S_t} = PI_{S_{t-1}}+ \frac{L}{S}|F_{L_t}| \end{equation*}
  • PIStPI_{S_t}: Current short payout funding index

  • PISt1PI_{S_{t-1}}: Index of previous interval

  • LL: Long open interest

  • SS: Short open interest

  • FLt|F_{L_t}|: Absolute value of current positive funding rate

  1. Long funding payout index: accumulated funding payout to long positions per token.
    PILt=PILt1+SLFSt\begin{equation*} PI_{L_t} = PI_{L_{t-1}}+ \frac{S}{L}|F_{S_t}| \end{equation*}
  • PILtPI_{L_t}: Current long payout funding index

  • PILt1PI_{L_{t-1}}: Index of previous interval

  • SS: Short open interest

  • LL: Long open interest

  • FSt|F_{S_t}|: Absolute value of current negative funding rate

  1. Short funding payout index: accumulated funding payout to short positions per token.
    PISt=PISt1+LSFLt\begin{equation*} PI_{S_t} = PI_{S_{t-1}}+ \frac{L}{S}|F_{L_t}| \end{equation*}
  • PIStPI_{S_t}: Current short payout funding index

  • PISt1PI_{S_{t-1}}: Index of previous interval

  • LL: Long open interest

  • SS: Short open interest

  • FLt|F_{L_t}|: Absolute value of current positive funding rate

Total payout for a long position

PLt=((PILtPILentry)(ILtILentry))SizeP_{L_t} = ((PI_{L_t} - PI_{L_{entry}} ) - (I_{L_t} - I_{L_{entry}}))* Size
  • PILt1PI_{L_{t-1}}: Current long payout index

  • PILentryPI_{L_{entry}}: Entry long payout index

  • ILtI_{L_t}: Current long funding index

  • ILentryI_{L_{entry}}: Entry long funding index

Total payout for a short positon

PSt=((PIStPISentry)(IStISentry))SizeP_{S_t} = ((PI_{S_t} - PI_{S_{entry}} ) - (I_{S_t} - I_{S_{entry}}))* Size
  • PISt1PI_{S_{t-1}}: Current short payout index
  • PISentryPI_{S_{entry}}: Entry short payout index
  • IStI_{S_t}: Current short funding index
  • ISentryI_{S_{entry}}: Entry short funding index

If the total payout is negative, traders need to pay this payout amount to the vault. The payout is incurred in the PNL of a position.

To claim funding payout, users can call this method in the smart contract.

   function claimFundingPayout(bytes32 _positionKey, address _to) external; 

Unlike other exchanges where funding payout will automatically be claimed after you close a trade. On Void exchange, at any given time, as long as your positions have accrued funding payout, you can claim it directly from the smart contract without closing the position. After the funding payout is claimed. The entry funding index and the entry funding payout index of the position will be reset to the current indexes.