unlock-protocol / locked.fyi

A basic notes application where notes are stored on IPFS and only visible by members of a lock
https://locked.fyi/
MIT License
21 stars 7 forks source link

Key-Price Update Frequency #54

Closed nfurfaro closed 3 years ago

nfurfaro commented 4 years ago

There's a concurrency issue around the keyPurchase flow: each purchase triggers a price change, possibly affecting the next purchase if tx has already been submitted at previous price.

2 possible mitigations are: 1.) Step-function: Have the price increase in steps rather than following the curve perfectly.

2.) UI accounting for price slippage.

eg:

cc @julien51

julien51 commented 4 years ago

Hey! I think we should take approach 1) but make it even simpler. I think for good practice/UI we should "round" the key price to the nearest 10cts. (It would be confusing for people to pay for $1.00213 for example.

So, the hook should compute the new key price and round it to the nearest 10 cts so that the price goes from from 10cts to 20 cts to 30 cts to... to 1 DAI to 1.10 DAI... etc.

This way, since we have a clear goal to reach about 10DAI when we get to 1Bn key sold, that means the price changes at most 100 times, and the changes will become less and less frequent with more keys sold.

What do you think?

nfurfaro commented 4 years ago

I like the rounding approach! I'll see about getting that feature working before my Rinkeby-test. Note that at the moment, the price for the 1Billionth key is $9, not 10. I could maybe tweak it if it's important to you that it be $10.

julien51 commented 3 years ago

Nah, 9DAI is cool ;)

nfurfaro commented 3 years ago

closing as this is now resolved using price-rounding.