Skip to content
drasticstaticPublic

Repository files navigation

AMM: slow waves meeting, for two tokens held in balance by a curve.

AMM β€” Automated Market Maker

Status For Live Demo License: MIT Deploy

You are here: drasticstatic lab β€Ί DappU coursework β€Ί amm Β· public Β· main is the working branch

TL;DR

  1. What this is. A full-stack Automated Market Maker on Ethereum, built during DappU.
  2. Who it is for. Anyone learning how a constant-product pool works.
  3. Do this first. View the live demo; the UI is explorable without a wallet.

A full-stack decentralized Automated Market Maker (AMM) built on Ethereum. Users can swap between two ERC-20 tokens, provide liquidity, and withdraw β€” all with a live price chart tracking the AMM's bonding curve over time.

β†’ View Live Demo

Note: The live demo runs against a local Hardhat node. Smart contract interaction requires the local node running with contracts deployed. The UI is fully explorable without a wallet.


Features

  • Token Swap β€” exchange Token A ↔ Token B via the constant-product formula (x Β· y = k)
  • Liquidity Deposit β€” provide token pairs to the pool and earn proportional LP shares
  • Liquidity Withdrawal β€” redeem LP shares to reclaim your token pair
  • Price Chart β€” real-time chart tracking swap history and price impact over time
  • MetaMask integration β€” connect wallet to sign and submit transactions
  • Read-only demo mode β€” full UI visible without wallet for portfolio showcase

Tech Stack

Layer Tools
Smart contracts Solidity, Hardhat
Frontend React, Redux, React Router, React Bootstrap
Blockchain interaction Ethers.js
Charts ApexCharts (react-apexcharts)
Testing Hardhat + Chai

Local Setup

# Install dependencies
npm install

# Start local Hardhat node
npx hardhat node

# Deploy contracts (in a separate terminal)
npx hardhat run scripts/deploy.js --network localhost

# Start React dev server
npm start

Open http://localhost:3000 β€” MetaMask should connect to localhost:8545 (Chain ID 31337).


Project Structure

contracts/        Solidity β€” AMM.sol, Token.sol
scripts/          deploy.js
test/             AMM.test.js
src/
  components/     React UI β€” Swap, Deposit, Withdraw, Charts, Navigation
  store/          Redux β€” actions, reducers, interactions
  abis/           Contract ABIs
  config.json     Network β†’ contract address map

Related

  • dao β€” DAO governance with proposals + treasury
  • crowdsale β€” Token crowdsale with whitelist + vesting
  • nft_dappu-punks β€” NFT minting with reveal timer

Suggest a change

Noticed something? Open an issue or a pull request against main; Christopher reads them and a person with the role merges. Not on GitHub? Reach Christopher through his contact page.

The front door follows the living README standard. Copy it, improve it.

Releases

Packages

Used by

Contributors

Languages