Skip to content

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LiteDEX

LiteDEX is a simple Automated Market Maker (AMM) Decentralized Exchange built with Solidity and Next.js. It implements the constant product formula ($x * y = k$) and allows users to swap tokens, add liquidity, and earn fees.

LiteDEX Screenshot

Project Structure

  • /contracts: Smart contracts (DEX, Factory, Mock Tokens).
  • /frontend: Next.js web application.
  • /scripts: Hardhat deployment scripts.
  • /test: Automated test suite for smart contracts.

Smart Contracts

  • SimpleDEX.sol: The core AMM contract handling swaps (0.3% fee) and liquidity provision.
  • DEXFactory.sol: Factory contract to deploy and track multiple trading pairs.
  • MockERC20.sol: Sample tokens for testing.

Getting Started (Contracts)

1. Install Dependencies

npm install

2. Compile Contracts

npx hardhat compile

3. Run Tests

npx hardhat test

4. Deploy Locally

First, start a local Hardhat node:

npx hardhat node

Then deploy the contracts:

npx hardhat run scripts/deploy.js --network localhost

Security Features

  • ReentrancyGuard: Protects against recursive call attacks.
  • Price Oracle (TWAP): Industry-standard time-weighted average price tracking.
  • K-Invariant Check: Ensures pool mathematical stability after every swap.

About

LiteDEX is a simple Automated Market Maker (AMM) Decentralized Exchange built with Solidity and Next.js

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages