Funding Rate

Concept of ABEx funding rate is to protect the interests of ALP holders, and dynamically adjust the funding rate for a specific direction of a trading pair. When traders for a given trading pair are overall profitable, fees are collected from traders and subsidized to LPs. When traders are overall at a loss, fees are collected from LPs and subsidized to traders. This ensures that each trading pair's unrealized + realized PNL approaches 0 statistically over the long term, with LPs having no excess returns but only fee income (transcation fee + borrowing interest). And here are the steps of detailed dynamic funding fees that are calculated.

Calculate the total profit and loss of LP at time t on the the trading pair

sgn={1short1longΔt=openingAmountt×pricetopeningSizetpnlt=realisedPnl+accFundingFee+sgn×Δt\begin{aligned}sgn&=\begin{cases}1&short\\-1&long\end{cases}\\\Delta_t&=openingAmount_t \times price_t - openingSize_t\\pnl_t&=realisedPnl+accFundingFee+sgn\times\Delta_t\end{aligned}

  • realised PNL represents the realized profit and loss of LP on traders' delta, excluding the impact of fees

  • accFundingFee represents the accumulated funding fees collected/distributed

The rebalancing method for the funding rate at time t is

fundingRatet={min{K1×logpnlt,R1}pnlt<00pnlt=0min{K2×logpnlt,R2}pnlt>0fundingRate_t=\begin{cases}min\left\{K_1\times log\left|pnl_t\right|,R_1\right\} &pnl_t<0\\0&pnl_t=0\\-min\left\{K_2\times log\left|pnl_t\right|,R_2\right\} &pnl_t>0\end{cases}

K1, K2 are constant coefficients

  • The reason for using the logarithm of pnl is to make the funding rate change significantly when pnl is small and change slowly when pnl is large

  • The funding rate has upper and lower bounds, with corresponding upper and lower rate limits R1, R2 when pnl < 0 and pnl > 0, respectively

If a trader opens a position at time t1 and closes it at time t2, with a position size of size, the funding fee to be paid/received by the trader is

fee=size×t1t2fundingRatet dtaccFundingFee=accFundingFee+feefee=size\times\int_{t_1}^{t_2}fundingRate_t\ dt\\accFundingFee=accFundingFee+fee

When the fee is positive, it represents the trader paying the funding fee to the LP

When the fee is negative, it represents the LP paying the funding fee to the trader

Last updated