computablelabs / computablelabs/goest

Fine grained invest()

Open
#55 1 comment 0 reactions 0 assignees View on GitHub
To the Future!
Dominant language
Go
Stars
8
Forks
0
PR merge metrics
No merged PRs in 30d

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.