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

fumPrice shoots to an impractical high price if the fum total supply is very low #151

Open
avishkarabhishek786 opened this issue Sep 23, 2021 · 4 comments

Comments

@avishkarabhishek786
Copy link

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);

@jacob-eliosoff
Copy link
Collaborator

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?

@jacob-eliosoff
Copy link
Collaborator

Also curious what you're working on that led you to this observation... I do appreciate the input!

@avishkarabhishek786
Copy link
Author

avishkarabhishek786 commented Oct 11, 2021

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.

  1. In case if the buffer is a very large amount and majority of the fum tokens are burnt the fum price shoots to impractical price. Not sure if it may happen in practice but in theory if it did happen it would be nearly impossible to bring the fum price down because no one will then mint at such high price.

  2. I am not sure if fum price is lowering down when debt ratio is high and vice versa.

@avishkarabhishek786
Copy link
Author

avishkarabhishek786 commented Oct 11, 2021

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
https://docs.google.com/spreadsheets/d/1hcXQvQOjAnqb7g-FeiG0xX-hiWwwfXOplvoJ4uV9vN0/edit?usp=sharing

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..

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

2 participants