# Automated Market Maker

* automated Market Maker, namely AMM
* not relying on order book, using algorithm on smart contract to exchange token automatically where maintaining *x \* y = k* constant between 2 tokens x & y
* the higher the liquidity (i.e. more tokens in the pool), the low slippage (i.e. impact to the token price in the pool)
* AMM users - enjoy on-chain buy/sell activities without having to match buy/sell counter-parties
* liquidity providers  -  deposit assets to liquidity pools & incentivised by sharing transaction fee when&#x20;

### How AMM works

<table><thead><tr><th width="50"> </th><th>Trader</th><th>Liquidity Provider</th><th>AMM Smart Contract</th><th>Liquidity Pool</th></tr></thead><tbody><tr><td><strong>0</strong></td><td></td><td>deposits equal values of USDC(x) &#x26; ETH (y) into liquidity pool, get LP tokens based on provider's share of total liquidity pool</td><td></td><td>maintains  <em>x * y = k,</em> <br>if price of 1 ETH is 1000, 1000 USDC (x) pairs with 1 ETH (y) to keep the constant</td></tr><tr><td><strong>1</strong></td><td>intends to swap USDC into ETH, approves contract to use his USDC </td><td></td><td>smart contract is permitted to interact with the USDC token in trader's wallet</td><td></td></tr><tr><td><strong>2</strong></td><td>confirms swapping USDC into ETH</td><td></td><td>algorithm calculates impacts to the liquidity pool. <br><em>(k / total USDC) / total ETH = price of ETH</em></td><td>deposits USDC into the ETH-USDC pool</td></tr><tr><td><strong>3</strong></td><td></td><td></td><td>sends corresponding ETH to trader</td><td>removes ETH from the ETH-USDC pool</td></tr><tr><td><strong>4</strong></td><td>receives ETH</td><td>receives portions of transaction fee based on provider's share of total liquidity pool</td><td>ETH price increased</td><td></td></tr></tbody></table>

### Advantage vs. traditional financial services

* **Decentralised** - no centralised entity, transactions executed by predefined smart contract agreement
* **Instant** - transactions are immediately processed without requiring others' approval
* **Transparent** - all pools' interactions are visible on chain explorer
* **Non-custodial** - directly interact with users' wallet, users retain full assets ownership
* **Token accessibility** - everyone can provide liquidity to any token, no listing required by any platform owner
