-
Notifications
You must be signed in to change notification settings - Fork 25
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
fumPrice shoots to an impractical high price if the fum total supply is very low #151
Comments
Hmmm. I remember in early testing (fuzzing as I recall) we hit some cases where a total FUM outstanding qty of 0 (or near 0?) could lead to errors. But my feeling at the time was, if the system gets any traction at all, there will always be a non-tiny qty of FUM outstanding - there are always some people who never get around to redeeming a coin. So either it gets traction and the bug doesn't occur, or it never gets traction and the bug doesn't matter anyway. I'll be extremely surprised if total FUM outstanding ever goes below 1 (initial value ~$1) after the first day... So I may be wrong, but I don't think the scenario you're describing here is going to be a problem in practice. Do you disagree? |
Also curious what you're working on that led you to this observation... I do appreciate the input! |
Thanks!! First I made some changes in contracts so that I could change Oracle prices based on ETH historical price like from Jan, 2018 to present date. Then I wrote a script and for each mint, burn, fund and defund I first changed the oracle price date wise and then recorded the data in excel sheet. Sharing the script https://gist.github.com/avishkarabhishek786/afa526093faa1c35f572e0f539b90dff I had two observations for fum price.
|
No matter how many times I ran the scripts the fum price would eventually increase and then fund, defund starts reverting. Checkout the Asset Balance section and Asset buy/sell price Just a thought, shouldn't there be mean fum price so that moving away from this mean should be slower in either direction. Or maybe the fum price should rather be more a function of debt ratio (inversely proportional) and less dependant on fum total supply? This way even if majority of the fum tokens are burnt the price would be decided primarily on debt ratio.. |
In the current fumPrice function,
price = (buffer <= 0 ? 0 : uint(buffer).wadDiv(fumSupply, roundUp));
if the fumSupply is very low and buffer is very high the price returned is so high that it can be considered impractical. Moreover, at such high price both fund and defund functions throw error when calculating fumOut or ethOut in fund/defund respectively.
fumOut = ethIn.wadDivDown(fumBuyPrice0);
The text was updated successfully, but these errors were encountered: