Dynamic Weights
InterSwap introduces a new mechanic for the dynamic change of tokens weights during single-asset liquidity provision/removing. Adding Liquidity, proportionally increases the weight of the asset and vice versa: removing liquidity decreases the weight. Liquidity provision/removing does not affect the quotes. Such a mechanic eliminates the possibility of draining the pool. Let's take an example of such initial pool with equal weights:
Asset | Reserve | Weight Points |
---|---|---|
BNB | 20000 | 1000 |
ETH | 5000 | 1000 |
AVAX | 45000 | 1000 |
Total Weight: 3000
We are adding liquidity with amount of 20 ETH. How much weigh points we should add to ETH?
price per point = reserve / points count.
Where:
- - points to be added or reduced.
- - amount of tokens added or removed.
- - current reserve of token.
- - total points.
In our example:
points = 20 / (5000 / 1000) = 4
Asset | Reserve | Weight Points |
---|---|---|
BNB | 20000 | 1000 |
ETH | 5020 | 1004 |
AVAX | 45000 | 1000 |
Total Weight: 3004