What is the fundamental dynamic of an AMM?
The rise of decentralised finance (DeFi) has changed the way we buy and sell cryptocurrencies. One of the essential ways in which a DeFi protocol operates is through the use of what is known as an automated market maker.
Automated market makers (AMMs) are part of the decentralised finance ecosystem (DeFi). They allow digital assets to be traded automatically and without authorisation using liquidity pools rather than a traditional market of buyers and sellers.
Having explored the topic of AMMs in previous lessons, it is important to understand how they operate...
1. Fundamental dynamics of an AMM
1.1 Invariant properties. The functionality of an AMM depends upon a conservation function.
As an intuitive example, Uniswap’s constant product function determines trading dynamics between assets in the pool.
Consequently, each trade has to be made in a way such that the value removed in one asset equals the value added in the other asset. If the price of the AMM moves too far away from market prices on other exchanges, the model incentivises traders to exploit price differences between the AMM and external cryptocurrency exchanges until it is balanced again.
1.2 Mechanisms. An AMM typically involves two types of interaction mechanism: asset swapping of assets and liquidity provision/withdrawal.
2. Fundamental AMM economics
2.1 Rewards. AMM protocols often run several reward schemes.
- Liquidity reward. LPs are rewarded for supplying assets to a liquidity pool, as they have to bear the opportunity costs associated with funds being locked in the pool.
- Staking reward. LPs are offered the possibility to stake pool shares or other tokens as part of an initial incentive program from a certain token protocol. The ultimate goal of the individual token protocols is to further encourage token holding, while simultaneously facilitating token liquidity on exchanges and product usage.
- Governance right. An AMM may encourage liquidity provision and/or swapping by rewarding participants governance rights in the form of protocol tokens .
But a concrete example?
Currently, governance issues such as protocol treasury management are proposed and discussed mostly on off-chain governance portals such as Snapshot (snapshot.org), Tally (tally.xyz) and Boardroom (boardroom.io), where protocol tokens are used as ballots to vote on proposals.
- Security reward. Just as every protocol built on top of an open, distributed network, AMM-based DEXs on Ethereum suffer from security vulnerabilities. Besides code auditing, a common practice that a protocol foundation adopts is to have the code vetted by a broader developer community and reward those who discover and/or fix bugs of the protocol with monetary prizes, commonly in fiat currencies, through a bounty program.
2.2 Explicit costs. Interacting with AMM protocols incurs various costs, including charges for some form of “value” created or “service” performed and fees for interacting with the blockchain network.
AMM participants need to anticipate three types of fees:
• liquidity withdrawal penalty,
• swap fee
• and gas fee.
- Liquidity withdrawal penalty. Withdrawal of liquidity changes the shape of the conservation function and negatively affects the usability of the pool by elevating slippage.
- Swap fee. Users interacting with the liquidity pool for token exchanges have to reimburse LPs for the supply of assets and for the divergence loss (see §2.4.3). This compensation comes in the form of swap fees that are charged in every exchange trade and then distributed to liquidity pool shareholders.
( A small percentage of the swap fees may also go to the foundation of the AMM to further develop the protocol).
- Gas fee. Every interaction with the protocol is executed in the form of an on-chain transaction, and is thus subject to a gas fee applicable to all transactions on the underlying blockchain.
In a decentralized network, validating nodes need to be compensated for their efforts, and transaction initiators must cover these operating costs.
2.3 Implicit costs. Two essential implicit costs native to AMM-based DEXs are slippage for exchange users and divergence loss for LPs.
- Slippage.
Slippage is defined as the difference between the spot price and the realised price of a trade.
In a DEX the larger your trade is, or the larger is the overall trade volume with the pool, the more unbalanced the liquidity in the pool becomes and creates price slippage.
Most decentralised exchanges offer you the possibility to adjust the slippage tolerance. You can increase or decrease the slippage tolerance percentage for different situations to ensure that your trade is removed.
- Divergence loss. For LPs, assets supplied to a protocol are still exposed to volatility risk, which comes into play in addition to the loss of time value of locked funds.
A swap alters the asset composition of a pool, which automatically updates the asset prices implied by the conservation function of the pool. This consequently changes the value of the entire pool.
This can lead to a loss that is considered 'divergence loss' .
Well-devised AMMs charge appropriate swap fees to ensure that LPs are sufficiently compensated for the divergence loss.
In fact, for the majority of AMM protocols, this “loss” only disappears when the current proportions of the pool assets equal exactly those at liquidity provision, which is rarely the case.
And since assets are bonded together in a pool, changes in prices of one asset affect all others in this pool!
AMMs are a niche space within DeFi and have carved out their own territory due to their ease of use.
If you liked this lesson, share it !