OmeSwap is a six-agent AI co-pilot for market decisions, risk control, strategy research, and chain-agnostic execution. Every signal comes with a clear Decision Receipt you can question at any depth.
# ๐ Omeswap โ Mantle DEX **Omeswap** is a next-generation decentralized exchange (DEX) and DeFi platform built natively on **Mantle Network (L2)**. It combines a fully functional Uniswap V2-style Automated Market Maker (AMM) with advanced portfolio analytics, token research tools, and a visual AI agent builder โ all wrapped in a stunning, modern interface.     --- ## ๐ Project Overview Omeswap is designed to be the all-in-one DeFi hub for traders, liquidity providers, and developers on Mantle. Unlike traditional DEXs that only offer swapping functionality, Omeswap provides: 1. **Decentralized Trading** โ Swap tokens with optimal routing through multi-hop paths 2. **Liquidity Management** โ Provide liquidity to pools and earn trading fees 3. **Portfolio Tracking** โ Real-time wallet analysis across multiple chains 4. **Token Research** โ Deep token analytics with audit scores, charts, and fundamental analysis 5. **DEX Explorer** โ Browse all pools, tokens, and transactions on the protocol 6. **AI Agent Builder** โ Visually design and deploy automated trading strategies ### ๐ฏ Why Omeswap? | Feature | Traditional DEX | Omeswap | |---------|----------------|---------| | Token Swaps | โ | โ | | Multi-hop Routing | โ | โ | | Portfolio Analytics | โ | โ | | Token Research & Audits | โ | โ | | AI Trading Agents | โ | โ | | L2 Low Gas Fees | Varies | โ (Mantle) | | Modern UI/UX | Basic | โ Premium | --- ## โจ Core Features ### ๐ Decentralized Exchange (AMM) - **Uniswap V2 Constant Product AMM** โ `x * y = k` formula for fair, permissionless trading - **Multi-Hop Swap Router** โ Automatically routes through multiple pools to find the best price (e.g., tUSDC โ tWETH โ tWBTC in a single transaction) - **0.3% LP Fees** โ Liquidity providers earn fees on every trade proportional to their share - **Slippage Protection** โ Configurable slippage tolerance to protect against price movements - **10 Testnet Tokens** โ tUSDC, tUSDT, tDAI, tWETH, tWBTC, tLINK, tUNI, tAAVE, tCRV, tMKR ### ๐ง Liquidity Provision - **Add Liquidity** โ Deposit token pairs to liquidity pools and receive LP tokens - **Remove Liquidity** โ Burn LP tokens to withdraw your proportional share anytime - **Pool Analytics** โ View reserves, total supply, your position value, and fee earnings - **Dual Token Approval** โ Streamlined UX for approving both tokens before adding liquidity ### ๐ DEX Explorer - **Tokens Table** โ Browse all tokens with price, 24h volume, liquidity, and sparkline charts - **Pools Table** โ View all liquidity pools with TVL, volume, APR estimates, and composition - **Transactions Feed** โ Real-time feed of swaps, adds, and removes across the protocol - **Global Stats** โ Total Value Locked (TVL), 24h volume, and protocol-wide metrics - **Advanced Filtering** โ Search, sort, and filter by multiple criteria ### ๐ผ Portfolio Dashboard - **Wallet Analysis** โ Connect your wallet to see real-time token holdings and values - **Multi-Chain Support** โ Track assets across Ethereum, Polygon, and other EVM chains - **Net Worth Tracking** โ Aggregated portfolio value with historical charts - **Custom Address Analysis** โ Analyze any wallet address without connecting - **Dust Filtering** โ Hide low-value tokens for a cleaner view - **Agent Wallet Cards** โ Dedicated tracking for AI agent-managed funds ### ๐ Token Detail Pages - **Comprehensive Analytics** โ Price charts, market cap, volume, circulating supply - **Audit Scores** โ Financial, fundamental, social, and security ratings (0-100) - **Fundamental Analysis** โ AI-generated insights on tokenomics and project health - **Technical Analysis** โ Chart indicators and trading signals - **Volume Breakdown** โ CEX vs DEX volume distribution - **Related Tokens** โ Discover similar tokens and alternatives - **Integrated Swap** โ Trade directly from the token detail page ### ๐ค AI Agent Builder (No-Code Trading Bots) Build automated trading strategies visually with a drag-and-drop flow canvas: #### Block Types: - **Triggers** โ Price threshold, price change %, time-based, manual, on-chain events - **Conditions** โ If/else logic, comparisons, AND/OR gates, range checks - **Actions** โ Buy, sell, swap, limit orders, stop-loss, take-profit - **Strategies** โ DCA, grid trading, arbitrage, market making, trailing stops - **Indicators** โ RSI, MACD, moving averages, Bollinger Bands, volume #### Agent Features: - Visual flow-based editor (React Flow) - Parameter configuration for each block - Save, load, and manage multiple agents - Execution status tracking - Draft โ Testing โ Active โ Paused lifecycle ### ๐จ Premium UI/UX - **3D Spline Animations** โ Interactive 3D scenes on the landing page - **Liquid Ether Background** โ Fluid simulation background effects - **GSAP Animations** โ Smooth scroll-triggered animations - **Framer Motion** โ Delightful micro-interactions throughout - **Variable Font Proximity** โ Text that reacts to cursor position - **Dark Theme** โ Optimized for night trading sessions - **Responsive Design** โ Seamless experience from mobile to 4K displays - **shadcn/ui Components** โ Accessible, customizable UI primitives --- ## ๐๏ธ Architecture ``` โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ FRONTEND (Next.js 15) โ โ React 19 โข Tailwind CSS โข shadcn/ui โข Framer Motion โข GSAP โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ Pages: โ Components: โ โ โข Landing (3D Hero + Bento) โ โข SwapCard โ โ โข Trade (Swap/Liquidity/Mint) โ โข AddLiquidityCard โ โ โข Explore (Tokens/Pools/Txns) โ โข TokensTable / PoolsTable โ โ โข Portfolio (Holdings/Analysis) โ โข AgentBlockNode / Canvas โ โ โข Token Detail (Charts/Audits) โ โข WalletAnalysisPanel โ โ โข Agent Builder (Flow Editor) โ โข PriceChart / RadarChart โ โโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ wagmi v2 + viem v2 + RainbowKit โ TanStack Query (caching) โผ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ WEB3 / BLOCKCHAIN LAYER โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ Custom Hooks: โ External APIs: โ โ โข use-dex-swap โ โข CoinGecko (prices/metadata) โ โ โข use-liquidity โ โข Wallet Analysis Service โ โ โข use-token-mint โ โข OpenAI (agent logic) โ โ โข use-dex-pools โ โ โ โข use-wallet-analysis โ โ โ โข use-pool-details โ โ โโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ JSON-RPC (https://rpc.sepolia.mantle.xyz) โผ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ MANTLE SEPOLIA TESTNET (Chain ID: 5003) โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ Smart Contracts (Solidity 0.8.20): โ โ โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ โ MultiTokenLiquidityPools (0xe635...) โ โ โ โ โข createPool() โ โ โ โ โข addLiquidity() / removeLiquidity() โ โ โ โ โข swap() โ single-hop swaps โ โ โ โ โข getReserves() / getUserPosition() โ โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ โ MultiHopSwapRouter (0xFe21...) โ โ โ โ โข swapExactTokensForTokens() โ โ โ โ โข getAmountsOut() โ path simulation โ โ โ โ โข Multi-hop routing (2-3+ hops) โ โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ โ 10 Test ERC20 Tokens (Mintable) โ โ โ โ tUSDC, tUSDT, tDAI, tWETH, tWBTC... โ โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ ``` --- ## ๐ Smart Contracts ### Deployed on Mantle Sepolia Testnet | Contract | Address | Description | |----------|---------|-------------| | **MultiTokenLiquidityPools** | `0xe63514C2B0842B58A16Ced0C63668BAA91B033Af` | AMM pools, liquidity, single-hop swaps | | **MultiHopSwapRouter** | `0xFe2108798dC74481d5cCE1588cBD00801758dD6d` | Multi-hop routing engine | | **tUSDC** | `0x6D13968b1Fe787ed0237D3645D094161CC165E4c` | Test USDC token | | **tUSDT** | `0x0828b7774ea41Db0fCbf13ADe31b5F61624A1364` | Test USDT token | | **tDAI** | `0x907fF6a35a3E030c11a02e937527402F0d3333ee` | Test DAI token | | **tWETH** | `0x95829976c0cd4a58fBaA4802410d10BDe15E3CA0` | Test Wrapped ETH | | **tWBTC** | `0xD781bf79d86112215F7bF141277f5782640cad5D` | Test Wrapped BTC | | **tLINK** | `0xCEbBd58F40c8CE0739327fDde1A52bb67557e37a` | Test Chainlink token | | **tUNI** | `0xe771E51F90D7176B6bd17a123f7D78c2231158a0` | Test Uniswap token | | **tAAVE** | `0x6b1F4e0Eea462745750dddaEB11FB85B968a87F6` | Test Aave token | | **tCRV** | `0xa6bAeA5811Bd070AeF343537b03A909597002526` | Test Curve token | | **tMKR** | `0x4296e3e1d3efbb5bac66a66f1E463BAc25Ec6189` | Test Maker token | [View on Mantle Sepolia Explorer โ](https://explorer.sepolia.mantle.xyz) --- ## ๐ฏ Use Cases ### For Traders - Swap tokens with minimal slippage via intelligent multi-hop routing - Research tokens with comprehensive analytics and audit scores - Track your portfolio value and holdings in real-time - Build automated trading strategies without coding ### For Liquidity Providers - Earn 0.3% fees on all swaps in pools you provide liquidity to - Track your LP positions and accumulated fees - Add/remove liquidity anytime with no lock-up periods ### For Developers - Study a production-grade AMM implementation - Learn wagmi v2, viem v2, and modern React patterns - Explore visual programming concepts with the agent builder - Fork, customize, and deploy your own DEX ## ๐ Quick Start ### 1. Install Dependencies ```bash npm install ``` ### 2. Setup Environment Create `.env.local`: ```bash NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=your_project_id ``` Get your WalletConnect Project ID from: https://cloud.walletconnect.com/ ### 3. Start Development Server ```bash npm run dev ``` Visit: **http://localhost:3000** ### 4. Connect & Trade 1. **Connect Wallet** (top right corner) 2. **Switch to Mantle Sepolia Testnet** 3. **Get testnet MNT** from https://faucet.sepolia.mantle.xyz 4. **Mint test tokens** (Mint Tokens tab) 5. **Add liquidity** or **start swapping**! ## ๐ Prerequisites - Node.js 18+ - MetaMask or compatible wallet - Testnet MNT (for gas fees) ## ๐๏ธ Tech Stack ### Frontend - **Framework:** Next.js 15 (App Router) - **UI Library:** React 19 - **Styling:** Tailwind CSS + shadcn/ui - **Web3:** wagmi v2 + viem v2 - **Wallet:** RainbowKit ### Smart Contracts - **Language:** Solidity 0.8.20 - **Framework:** Hardhat - **Network:** Mantle Sepolia Testnet - **Testing:** Chai + Ethers.js ## ๐ Smart Contracts ### Deployed on Mantle Sepolia | Contract | Address | |----------|---------| | **Liquidity Pools** | `0xe63514C2B0842B58A16Ced0C63668BAA91B033Af` | | **Swap Router** | `0xFe2108798dC74481d5cCE1588cBD00801758dD6d` | [View on Explorer โ](https://explorer.sepolia.mantle.xyz) ## ๐ฏ Use Cases ### For Traders - Swap tokens with minimal slippage - Multi-hop routing finds best paths - Low gas costs on L2 ### For Liquidity Providers - Earn 0.3% on all swaps - Receive LP tokens - Remove liquidity anytime ### For Developers - Learn AMM mechanics - Study DeFi integration - Fork and customize ## ๐ Documentation - **[Implementation Summary](./IMPLEMENTATION_SUMMARY.md)** - Complete technical overview and implementation details ## ๐งช Testing ### Frontend Testing ```bash npm run dev ``` ### Smart Contract Testing ```bash cd ../Mantel_contract npx hardhat test ``` ### Backend Scripts ```bash # Mint test tokens npm run hardhat:mint # Add liquidity npm run hardhat:liquidity # Execute swap npm run hardhat:swap # Multi-hop swap npm run hardhat:multihop # Complete setup npm run hardhat:quickstart ``` ## ๐ Security โ ๏ธ **Testnet Only**: This DEX is deployed on Mantle Sepolia Testnet. All tokens are for testing purposes and have **no real value**. For production use: - Professional security audit required - Implement additional safety checks - Add protocol fee mechanism - Enable emergency pause functionality ## ๐ ๏ธ Development ### Project Structure ``` Mantle_Dex/ โโโ app/ # Next.js pages โโโ components/ # React components โ โโโ trade/ # DEX trading components โ โโโ portfolio/ # Portfolio management โ โโโ features/ # Wallet integration โโโ contracts/ # Contract ABIs & config โโโ hooks/ # Custom React hooks โโโ lib/ # Utilities โโโ scripts/ # Hardhat interaction scripts ``` ### Available Scripts ```bash npm run dev # Start dev server npm run build # Build for production npm run start # Start production server npm run lint # Run linter npm run hardhat:* # Hardhat operations ``` ## ๐ Network Configuration ### Mantle Sepolia Testnet - **Chain ID:** 5003 - **RPC URL:** https://rpc.sepolia.mantle.xyz - **Explorer:** https://explorer.sepolia.mantle.xyz - **Faucet:** https://faucet.sepolia.mantle.xyz Add to MetaMask: 1. Networks โ Add Network โ Add Manually 2. Enter the details above 3. Save ## ๐จ Features Walkthrough ### 1. Token Swapping - Select input/output tokens - Enter amount - Review estimated output - Approve & swap - Track transaction on explorer ### 2. Liquidity Management - Choose token pair - Enter amounts (auto-calculated ratio) - Approve both tokens - Add liquidity - Receive LP tokens ### 3. Multi-Hop Routing - Swap tokens without direct pools - Example: DAI โ USDC โ WETH โ WBTC - Atomic transaction (all-or-nothing) - Automatic path finding ## ๐ค Contributing Contributions are welcome! Please: 1. Fork the repository 2. Create a feature branch 3. Make your changes 4. Submit a pull request ## ๐ License MIT License - see [LICENSE](./LICENSE) file ## ๐ Acknowledgments - Uniswap V2 for the AMM design - Mantle Network for L2 infrastructure - shadcn/ui for beautiful components - wagmi & viem for Web3 integration ## ๐ Support - **Issues:** GitHub Issues - **Docs:** [Integration Guide](./DEX_INTEGRATION_GUIDE.md) - **Explorer:** https://explorer.sepolia.mantle.xyz ## ๐ Getting Started Ready to try it out? ```bash npm install npm run dev ``` Then visit **http://localhost:3000/trade** and start trading! --- **Built with โค๏ธ on Mantle Network** โญ Star this repo if you found it helpful!
na