Skip to content

Refactor the Claiming mechanism #44

@EGreg

Description

@EGreg

Background

Uniswap's price curve is based on a constant product formula. As a result, someone who adds 99% of the reserveToken into the pool, will receive 99% of the tradedToken. This is a problem, since someone can simply buy up a huge amount of the entire TradedToken supply for a relatively small price, assuming the initial liquidity pool was small (compared to what it would have been if the token ecosystem grew over time and more liquidity had been added).

In many projects, the presale hands out 95% of the tokens and any given liquidity pool only contains about 5% of the tokens. In that case, someone buying up 99% of the pool still ends up with only 5% of the total supply of tokens. But in this case, the token holders can simply dump the spot price of the token at any time. That's the flip-side of the problem: even if decentralized, the crowd can dump the spot price. That's still better than having one person (with a bunch of fake front accounts) buy up all the supply.

So what we want is the best of both worlds: allow presale investors "crowd" to claim more tokens when the long-term average price (which is harder to manipulate) reaches a new all-time high. So that the "crowd" can eventually hold 10x more tokens than any person buying up most of the tokens in the liquidity pool.

Changes

  1. Have init parameter allTimeHighGrowthFraction (divide by 10,000 as usual). When the spotPrice = tradedTokenBalance/reserveTokenBalance exceeds allTimeHigh * (allTimeHighGrowthFraction + 10000) / 10000 then set allTimeHigh to spotPrice, and set cumulativeClaimed = 0. You can store totalCumulativeClaimed just for informational purposes, but use cumulativeClaimed where you currently use totalCumulativeClaimed.

Setting taxes to 5-20% can prevent manipulation of spotPrice by managers for the purpose of minting more tokens to their friends. Because it will cost more to buy + mint + sell, if the price movement required is too big.

  1. Instead of spotPrice, we can use the same averagePrice mechanism as with `addLiquidity, namely "average price since the last time you reset cumulativeClaimed".

  2. ClaimingManager will continue to rescale wantToClaim amounts as before. But it will use cumulativeClaimed, not totalCumulativeClaimed, to calculate availableToClaim. Note that cumulativeClaimed gets reset to zero after every new all-time-high average price is set.

  3. To prevent people with ClaimingToken from rushing to claim TradedTokens as soon as they become available again, we should provide an incentive to hold off on that, which can introduce some uncertainty. So let the exchangeRate (initial value) grow by init parameter exchangeRateIncrease for every exchangeRateInterval seconds. That way holding ClaimingToken and not claiming, can get you more TradedTokens in the future.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions