hackquest logo

omeswap

Update soon

Videos

Description

# 🌊 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!

Progress During Hackathon

# 🌊 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. ![Mantle DEX](https://img.shields.io/badge/Mantle-DEX-blue) ![License](https://img.shields.io/badge/license-MIT-green) ![Next.js](https://img.shields.io/badge/Next.js-15-black) ![React](https://img.shields.io/badge/React-19-blue) --- ## πŸ“– 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!

Tech Stack

Next
Web3
Solidity
Shadcn

Fundraising Status

na

Team LeaderAanik200365
Sector
DeFiAI

Builders Also Viewed