Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change to "effective" funding constant #79

Open
mikeyrf opened this issue Jun 27, 2022 · 1 comment
Open

Change to "effective" funding constant #79

mikeyrf opened this issue Jun 27, 2022 · 1 comment

Comments

@mikeyrf
Copy link
Contributor

mikeyrf commented Jun 27, 2022

Currently funding is most extreme when imbalance in open interest is to one side. However, this does not account for what fraction the imbalance is of the current open interest cap. This leads to extreme funding rates occurring even when smaller sizes only exist on the market, counter to how funding should likely work. Funding rates due to imbalance should account for "utilization" of the allowed open interest on the market (how much of the OI cap is currently being used): less OI utilization is less risk for the protocol, so funding rates charged should be less.

Proposing changing the funding constant used in the imbalance drawdown:

OI_imb(t) = OI_imb(0) * e**(-2*k*t)

from k -> k'(k, OI_imb(0), C_OI(0)), where

k' = k * OI_imb(0) / C_OI(0)

and

k = original gov param for funding
OI_imb(0) = imbalance in OI at time 0
C_OI(0) = open interest cap at time 0

When all of the open interest is to one side and the oi utilizes entire cap such that OI_imb(0) = C_OI(0), we reduce to the prior form of funding (so all the original k calibrations should hold).

As k' is still a constant in time (between interactions with the market), all of the math from Section II B. of the WP should hold as well. Would require us to cache the mid price every call to update P(0) in order to have C_OI(0) available to the market contracts. In terms of code changes with oiAfterFunding(), only need to slightly alter L547.

Given 2*k for ETH/DAI is likely to be 2.78% per day from WP calibrations for the worst case scenario of risk exposure, full OI imbalance utilizing 1/10 of the OI cap would yield funding rates on the same order of magnitude as existing CEX rates. Smaller traders then don't get priced out immediately when building positions.

@mikeyrf mikeyrf changed the title Change to effective funding constant Change to "effective" funding constant Jun 27, 2022
@mikeyrf
Copy link
Contributor Author

mikeyrf commented Jun 30, 2022

See math in funding curves note for further development.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant