Funding

Parameters:

Symbol
Meaning

loi

long open interest of each currency in USD for all users

soi

short open interest of each currency in absolute value in USD for all users. soi >=0

pr

a risk management parameter for each currency. pr ∈(0,1)\in (0,1)

s

net position of each currency in USD for all users. (loi-soi)

r

funding rate of each currency

LP

total LP tokens’ net asset value, in USD, equal to LP’s cash after instantly closing all user positions without fee

Assume the funding rate velocity is positively correlated with sLP\frac s {LP}.

When rβ‹…s>=0r \cdot s >=0,

drdt={βˆ’Vmaxsβ‰€βˆ’prβ‹…LPsprβ‹…LPβ‹…Vmaxs∈(βˆ’prβ‹…LP,prβ‹…LP]Vmaxs>prβ‹…LP\frac{dr}{dt} = \left \{ \begin{array}{rcl} -V_{max} && s\leq-pr \cdot LP\\ \\ \frac s {pr \cdot LP} \cdot V_{max} && s \in (-pr \cdot LP, pr \cdot LP]\\ \\ V_{max} && s>pr \cdot LP \end{array} \right.

When rβ‹…s<0r \cdot s <0,

drdt={βˆ’2β‹…Vmaxsβ‰€βˆ’prβ‹…LP2β‹…sprβ‹…LPβ‹…Vmaxs∈(βˆ’prβ‹…LP,prβ‹…LP]2β‹…Vmaxs>prβ‹…LP\frac{dr}{dt} = \left \{ \begin{array}{rcl} -2\cdot V_{max} && s\leq-pr \cdot LP\\ \\ 2 \cdot \frac s {pr \cdot LP} \cdot V_{max} && s \in (-pr \cdot LP, pr \cdot LP]\\ \\ 2 \cdot V_{max} && s>pr \cdot LP \end{array} \right.

Last updated