VoltSwap
Search…
Liquidity Pools Example

### Transaction X: A buyer wants to buy 100 MTRG by suppling Volt.

Total MTRG in the Pool = 900
Total Volt in the Pool = 1M/900 = 1111.11
Fees Paid = 0.3%,
1111.11 = (1000 + Total Volt Provided – 0.3% of Total Volt Provided)
Total Volt Provided = 1111.44 and Fees Provided = 0.334 Volt
The invariant is now changed.
Total MTRG = 900, Total Volt = 1111.44
New Invariant = 1,000,296
The Pool looks like below after the first transaction;

### Transaction Y: Buy 111.11 VOLT by supplying MTRG

Total VOLT in the Pool = 1000.334
Total MTRG in the Pool = 1.0003 M/ 1000.334 = 999.962
Fees Paid = 0.3%,
999.962 = (900+Total MTRG Provided – 0.3% of Total MTRG Provided)
Total MTRG Provided = 100.263 and Fees Provided = 0.3 MTRG
The invariant is now changed.
Total MTRG = 1000.263, Total Volt = 1000.33
New Invariant = 1,000,593
The Pool looks like below after the second transaction;
Thus, we can see now that LP tokens of the User A is now worth 100.0263 MTRG and 100.033 Volt due to the impact of transaction fees.