https://etherscan.io/tx/0x0060c02e3cfaeaae10d762b9b22c8dacb8fc41f999afb4f6f0329e3da8e51319
A quick note on the migration math.
The goals of the migration were threefold:
- Upgrade to an improved token contract that would work as well at a market cap 10, 100, etc. times as large.\
- Merge X7m105 and X7 Protocol into a single token to reduce complexity and concentrate interest.\
- Improve the liquidity in each token's uniswap pair.
Goal (3) needed to be accomplished while the value of held tokens remained constant.
In math terms, this translated to ensuring that the following was equal in both old and new tokens:
held tokens price
(tokenSupply - pairTokenReserve) * pairETHReserve / pairTokenReserve = "held token" value
After we had harvested liquidity from the v1 tokens the "knowns" were:
1. v1 uniswap pair token reserve
2. v1 uniswap pair ETH reserve
3. v2 available ETH reserve
4. v1 and v2 token supply
We have only one "unknown" in the above equation - v2 uniswap pair token reserve.
We solved for this by solving for the unknown in the below equation:
oldHeldTokenValue = newHeldTokenValue
The three relevant functions for doing so in the X7V1toV2Migration contract are:
_getNewDAOReserves _getNewX7RReserves _getNewConstellationReserves
The newly calculated v2 token reserve would result in:
1. increased token AND ETH liquidity in the uniswap pairs.
2. price increase and held v2 token reduction to leave each investor whole, in terms of value.
There was additional complexity due to the token merge and due to the 'non-circulating' X7000/X7100 tokens, but the method remained essentially the same.
With the new token reserve calculated, and therefore the new token price, the equation to determine the v2 token airdrop amount is:
old tokens x old price = new tokens x new price
This equation guarentees one's v1 token holdings are value-equivalent to v2 token holdings.
You can see this equation used in the X7V1toV2Migration contract:
_airdropWalletTokens _airdropMigrationTokens
This increased liquidity came with reduced price slippage and an increase in supply to make room for new investors (at this higher initial price point).
