🔥GAMM Algorithm

See whitepaper:

Inspired by Uniswap V3, Gas.Finance introduces a new algorithm - Gas-specialised Asymmetric Market Maker (GAMM). GAMM concentrates liquidity around the tracking price and adjusts liquidity distribution according to changes between the marginal gas price and tracking gas price.

When gas price fluctuates significantly, the liquidity on both sides of the tracking price will change, making the transaction liquidity asymmetric. For example, when the gas price rises sharply, from 10 gwei to 1000 gwei, it leads to a very thin left-side liquidity which increases slippage, whereas the right-side liquidity distribution becomes more concentrated which decreases slippage. But if it lasts a bit longer, then the liquidity distribution will be gradually concentrated around the gas price.

What the GAMM algorithm needs to achieve is to change the liquidity distribution so that the gas token has a lower slippage when the price is stable, and a higher slippage when the gas price fluctuates significantly, so as to simulate the real gas market operation as much as possible. The purpose of this design is also to increase the cost of market manipulation. If a malicious attacker manipulates the tracking price of Gas Vault, he must manipulate the real gas price for a long time.

When the tracking price drops sharply, the right-side liquidity is pretty thin and the left-side liquidity is more concentrated. At this time, the right-side slippage is high. As a buyer, the price change is large, and the transaction volume near this price will be relatively small. This makes it impossible for arbitrageurs and speculators to take advantage of market volatility to buy at low prices. The transactions concluded in this case are more of a bilateral buying and selling behavior of immediate transactions. Since the right-side liquidity distribution is extremely deviated from the tracking price, there will be less user interactions with the pool, which naturally protects LPs and reduces impermanent loss.

Similarly, when tracking price soars, the left-side liquidity is thin and the right-side liquidity is more concentrated which leads to asymmetric liquidity distribution.

However, when drastic price changes are transformed into a trend, the entire liquidity will gradually concentrate towards the tracking price. GAMM will then monitor a continuous series of tracking prices, and when price fluctuations tend to be smoothed, former asymmetric liquidity will slowly convert to a more symmetric liquidity distribution.

Last updated