-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
At present invest() buys in bulk. That is, it gets the price from getInvestmentPrice() and purchases N market token gwei at this price. This gives an advantage to bulk orders from early adopters since they can purchase up a lot on the cheap (credit to Rei Chiang for this attack).
A more robust scheme would be to have fine grained purchase. Let's say that only M market token gwei can be purchased at a given price. (If M = 1e9, then one market token max can be purchased at the set price). Then to purchase N total, you would do a for loop:
remaining = N
while remaining > 0:
price = getInvestmentPrice()
purchase min(remaining, M) gwei of market token at price
remainder -= min(remaining, M)
Reactions are currently unavailable