The convergence point where all DeFi protocols, chains, and opportunities unite into one optimized experience.
Nexus is a comprehensive DeFi trading platform that maximizes every aspect of the 1inch protocol suite, providing intelligent trade routing, cross-chain arbitrage, MEV protection, and advanced portfolio management.
DeFi traders are fragmented across multiple platforms, protocols, and chains, leading to:
- $2.1B in annual inefficient execution costs
- $500M+ lost to MEV attacks
- 78% of traders using suboptimal execution methods
- Missed arbitrage opportunities due to manual cross-chain execution
- AI-Powered Protocol Selection: Automatically chooses between Classic, Fusion, Fusion+, and Limit Orders
- Real-time Comparison: Side-by-side analysis of all execution methods
- MEV Protection by Default: Routes through Fusion when MEV risk is detected
- Gas Optimization: Smart routing based on trade size and market conditions
- Real-time Opportunity Detection: Scans price differences across all 5 supported chains
- One-Click Execution: Execute arbitrage trades using Fusion+ (bridge-free)
- Confidence Scoring: AI-powered risk assessment for each opportunity
- Auto-scanning: Continuous monitoring with 30-second intervals
- Comprehensive Protection: Sandwich attack, frontrunning, and backrunning prevention
- Real-time Alerts: Live monitoring of MEV attempts and blocks
- Savings Tracking: Track total USD saved from MEV protection
- Private Mempool: Transactions hidden from public mempool
- Multi-Chain Portfolio: Unified view across all supported chains
- Auto-Rebalancing: Maintain target allocations using Fusion+
- Limit Order Engine: Set complex conditional orders across chains
- P&L Analytics: Detailed profit/loss tracking with protocol performance
- β Classic Swap Protocol (v6.0): Quote, Swap, Tokens, Allowance, Approve
- β Fusion Protocol (v1.0): Intent-based swaps with MEV protection
- β Fusion+ Protocol (v1.0): Bridge-free cross-chain swaps
- β Limit Order Protocol (v4.0): Advanced order management
- β Portfolio API (v4.0): Multi-chain balance tracking
- β Price Feeds API: Real-time token prices
- Frontend: Next.js 15, React 19, TypeScript
- Styling: Tailwind CSS v3, shadcn/ui components, Glassmorphism design
- Web3: Wagmi, Viem for wallet connections and blockchain interactions
- State Management: TanStack Query for API state management
- Charts: Recharts for data visualization
- API Layer: Next.js API routes with Bearer token authentication
- Real-time Quotes: Live price updates and route optimization
- Real-time Portfolio Tracking: Live balance and value updates
- Performance Analytics: 24h changes and historical data
- Asset Allocation: Visual portfolio distribution
- Multi-token Support: Track all ERC-20 tokens
- Multiple Wallet Support: MetaMask, WalletConnect, and more
- Chain Switching: Seamless network transitions
- Transaction Management: Approve and execute swaps
- Security: Non-custodial, self-custody trading
- Responsive Design: Mobile-first approach
- Dark Theme: Modern glassmorphism design
- Real-time Updates: Live data without page refresh
- Intuitive Interface: Clean and user-friendly
- Node.js 18+ and npm
- A Web3 wallet (MetaMask recommended)
- 1inch API key (get from 1inch Developer Portal)
-
Clone the repository
git clone <repository-url> cd hackathon_project
-
Install dependencies
npm install
-
Set up environment variables
cp env.template .env.local
Edit
.env.localand add your API keys:ONEINCH_API_KEY=your_1inch_api_key_here NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=your_walletconnect_project_id_here
-
Run the development server
npm run dev
-
Open your browser Navigate to http://localhost:3000
- Visit 1inch Developer Portal
- Create an account and generate an API key
- Add the API key to your
.env.localfile
- Visit WalletConnect Cloud
- Create a project and get your Project ID
- Add the Project ID to your
.env.localfile
- Frontend: Next.js 15, React 19, TypeScript
- Styling: Tailwind CSS, shadcn/ui components
- Web3: Wagmi, Viem, Ethers.js
- State Management: TanStack Query
- Charts: Recharts
- API: 1inch API v6.0
βββ app/
β βββ api/1inch/ # 1inch API routes
β βββ layout.tsx # Root layout
β βββ page.tsx # Main page
β βββ providers.tsx # Web3 providers
βββ components/
β βββ ui/ # shadcn/ui components
β βββ portfolio-dashboard.tsx
β βββ swap-interface.tsx
β βββ token-selector.tsx
β βββ wallet-connect.tsx
βββ lib/
β βββ 1inch.ts # 1inch service
β βββ utils.ts # Utility functions
β βββ web3.ts # Web3 configuration
βββ public/ # Static assets
This dApp integrates multiple 1inch API endpoints:
- Token API: Fetch available tokens for each chain
- Quote API: Get swap quotes and rates
- Swap API: Execute token swaps
- Allowance API: Check token allowances
- Approve API: Generate approval transactions
- Portfolio API: Track wallet balances
- Price API: Get real-time token prices
- Ethereum (Chain ID: 1)
- Polygon (Chain ID: 137)
- Arbitrum (Chain ID: 42161)
- Optimism (Chain ID: 10)
- Base (Chain ID: 8453)
# Development server
npm run dev
# Build for production
npm run build
# Start production server
npm start
# Lint code
npm run lint- New API Endpoints: Add routes in
app/api/1inch/ - UI Components: Create in
components/ - Utility Functions: Add to
lib/ - Styling: Use Tailwind CSS classes
- Non-custodial: Users maintain control of their funds
- API Key Security: Server-side API calls only
- Transaction Signing: Client-side wallet signing
- Input Validation: Comprehensive parameter validation
- Fully responsive design
- Mobile wallet integration
- Touch-optimized interface
- Progressive Web App (PWA) ready
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License.
- 1inch Network for the powerful API
- shadcn/ui for beautiful components
- Wagmi for Web3 React hooks
- Next.js for the amazing framework
For support and questions:
- Check the 1inch API Documentation
- Open an issue on GitHub
- Join the community discussions
Built with β€οΈ for the DeFi community