Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hanyc91539/amm_dex_defi

This repository is for test some advance solidity concepts and building some core DeFi primitives.
https://github.com/hanyc91539/amm_dex_defi

blockchain erc20 hardhat nextjs14 remix smart-contracts solidity tailwindcss typescript

Last synced: 2 months ago
JSON representation

This repository is for test some advance solidity concepts and building some core DeFi primitives.

Awesome Lists containing this project

README

        

## What is an Automated Market Maker (AMM)?
An Automated Market Maker (AMM) is a type of decentralized exchange or DEX protocol that relies on a mathematical formula to price assets. Unlike traditional exchanges, where both buyers and sellers place orders to create a market, AMMs facilitate trading through liquidity pools. These pools are funded by users who deposit pairs of assets into smart contracts, enabling automated and efficient trading without needing an order book.

## How Does an AMM Work?
A centralized exchange (CEX) utilizes an Order Book to manage offers from buyers and sellers, while a decentralized exchange (DEX) employs an Automated Market Maker (AMM). The AMM uses Smart Contracts and algorithms to encourage crypto holders to provide liquidity for trading pairs and automatically adjusts or customizes prices based on the continuous liquidity ratio.

Simply put, the AMM model works on the equation x*y=k. To illustrate, let’s consider a trading pair of BTC/USDT:

- x = the proportion of BTC in the total pool

- y = the proportion of USDT in the total pool

- k = the total liquidity in pool (x*y)

Here, k is the constant.

## Benefits of AMM-based DEXs

1. Liquidity Provision

AMMs incentivize users to provide liquidity by providing a share of the trading fees generated by the pool. This democratizes market-making, allowing anyone to become a liquidity provider and earn rewards.

2. 24/7 Trading

AMMs operate around the clock, enabling users to trade anytime without relying on a centralized entity.

3. Decentralization and Security

AMM-based DEXs are decentralized, reducing the risk of hacks and central point failures associated with centralized exchanges.

4. Reduced Slippage

Larger liquidity pools lead to lower slippage, providing a better trading experience for users.

## Popular AMM-based DEXs
Several AMM-based DEXs have gained popularity in the DeFi space:

### Uniswap

The pioneer of the AMM model, Uniswap uses the constant product formula and has become one of the most widely used DEXs.

### SushiSwap

A fork of Uniswap, SushiSwap offers additional features like yield farming and staking rewards.

### Curve Finance

Specializes in stablecoin trading, minimizing slippage and impermanent loss for assets with similar values.

### Balancer

Allows multi-token liquidity pools and customizable weightings, offering greater flexibility for liquidity providers.

## Future of AMM-based DEXs
The future of AMM-based DEXs looks promising with continuous innovations and improvements. Layer 2 scaling solutions, such as Optimistic Rollups and zk-Rollups, aim to reduce gas fees and enhance transaction speeds. New AMM models are also being developed to address challenges like impermanent loss and capital efficiency.

## License

Licensed under the MIT license