Skip to content

Latest commit

Β 

History

History
61 lines (41 loc) Β· 2.13 KB

File metadata and controls

61 lines (41 loc) Β· 2.13 KB

Uniswap (V3 Clone for Educational Purposes)

⚠️ 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.

🧠 Learning Resources & References

πŸ“ Project Structure

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)

πŸ› οΈ Tech Stack

  • Solidity ^0.8.29
  • Foundry for development and testing
  • Anvil for local forked EVM

βš™οΈ Usage

# Compile & deploy locally
make deploy-local

This 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

πŸ“„ License

MIT Β© 2025
Built for fun, learning, and DeFi exploration πŸš€