LimitLess DEX
A DEX is only interesting when the contract mechanics, liquidity math, and failure cases are visible.
Stack
Description
LimitLess DEX is a blockchain class project: a Solidity and Hardhat constant-product automated market maker for ETH/LML swaps.
Context
The goal was to implement the mechanics behind a simple decentralized exchange rather than treat DeFi as a black box: pool creation, liquidity changes, reserve ratios, slippage checks, fees, and secure token movement.
System
The exchange contract supports pool creation, proportional liquidity add/remove, ETH-to-token and token-to-ETH swaps, slippage bounds, reserve accounting, and owner fee withdrawal. The paired ERC-20 token includes controlled minting and a permanent mint-disable switch.
Intelligence
The core invariant is constant-product pricing, with explicit reserve updates and checks around rate bounds. The implementation also uses OpenZeppelin ownership, ERC-20 interfaces, ReentrancyGuard, and allowance handling through the ethers.js frontend.
Iteration
The project added configurable swap fees in basis points and separate fee reserve tracking, while keeping the main pool math legible enough to reason about gas usage and liquidity behavior.