β οΈ Disclaimer: This is an unofficial educational clone of the Uniswap V3 protocol, created for research and experimentation. It is not affiliated with or endorsed by Uniswap Labs or the Uniswap Foundation. Not intended for production use.
A simplified Uniswap V3 implementation focused on core concepts like pool creation, swaps, liquidity provision, and quoting. Ideal for developers exploring how Uniswap V3 works under the hood.
- π Uniswap V2 Whitepaper
- π Programming DeFi (by Jeiwan)
- π Uniswap V3 Book (Highly Recommended)
A huge thanks to Uniswap V3 Book for providing clear explanations and visuals for the V3 architecture and math.
src/
βββ UniswapV3Factory.sol # Pool factory
βββ UniswapV3Manager.sol # Handles minting and swaps
βββ UniswapV3Pool.sol # Core pool logic (ticks, liquidity, swaps)
βββ UniswapV3Quoter.sol # Quote estimation without executing swaps
βββ UniswapV3NFTManager.sol # (Optional) Position management
test/
βββ fixtures/ # Setup scenarios and token pairs
βββ libraries/ # Unit tests for TickMath, Path, etc.
βββ mocks/ # Mock ERC20s and helper contracts
βββ utils/ # Assertion helpers and testing utils
scripts/
βββ UniswapV3Deployer.s.sol # Deployment script using Foundry (forge)
- Solidity
^0.8.29 - Foundry for development and testing
- Anvil for local forked EVM
# Compile & deploy locally
make deploy-localThis will:
-
Spin up a local Anvil node (if not already running)
-
Deploy mock tokens, Uniswap core contracts (factory, pools, manager, quoter)
-
Initialize multiple pools
-
Add initial liquidity to each pool
MIT Β© 2025
Built for fun, learning, and DeFi exploration π