A powerful DeFi aggregation tool that finds the most efficient routes across multiple protocols to maximize returns on token swaps. Built with React, Vite, and the Enso Finance API.
- 🔄 Smart order routing across multiple DEXs and protocols
- 💰 Best rates and lowest gas costs
- ⚡ Support for complex multi-hop trades
- 🔍 Real-time quotes and price impact analysis
- 🌐 Multi-chain support (Ethereum, Optimism, Polygon, Arbitrum)
- 🔒 Secure wallet integration with RainbowKit
- 📊 Detailed gas estimates and cost breakdowns
- Frontend Framework: React + Vite
- Styling: Tailwind CSS + shadcn/ui
- State Management: TanStack Query
- Wallet Integration: RainbowKit + wagmi
- API Integration: Enso Finance API, Enso Documentation
- Type Safety: TypeScript
src/
├── components/ # React components
│ ├── route/ # Route-related components
│ ├── token/ # Token selection components
│ └── ui/ # Shared UI components
├── hooks/ # Custom React hooks
├── lib/ # Utility functions
├── services/ # API services
├── types/ # TypeScript types
└── test/ # Test utilities<img width="1728" alt="Screenshot 2024-11-27 at 9 57 32 pm" src="https://github.com/user-attachments/assets/2466111b-6660-4123-8f62-5e6e0ff72acf">
- Node.js 16+
- npm or yarn
- A Web3 wallet (e.g., MetaMask)
- Clone the repository:
git clone https://github.com/jennievon/defi-route-finder.git
cd defi-route-finder
- Install dependencies:
npm install
- Create a
.env
file in the root directory:
VITE_WALLETCONNECT_PROJECT_ID=your_project_id # Get this from https://cloud.reown.com/
VITE_ENSO_API_KEY=your_api_key # Get this from the Enso Finance website
- Start the development server:
npm run dev
The app will be available at http://localhost:5173
Vitest is used for testing. Run the test suite:
npm run test
npm run test:watch
npm run test:coverage
- Connect your Web3 wallet using the "Connect Wallet" button
- Select the network you want to trade on
- Choose the token you want to swap from and enter the amount
- Select the token you want to receive
- Adjust slippage tolerance if needed
- Click "Find Routes" to see the best available trading routes
- Review the route details, gas costs, and price impact
- Execute the trade when ready (TBD)
- Automatically finds the most efficient path for your trade
- Compares rates across multiple DEXs and protocols
- Optimizes for both price and gas costs
- Real-time gas estimates in both native tokens and USD
- Detailed breakdown of transaction costs
- Gas-efficient routing to minimize fees
- Real-time calculation of trade's market impact
- Visual indicators for high-impact trades
- Helpful tooltips explaining the implications
- Seamless trading across multiple networks
- Unified interface for all supported chains
- Real-time network switching
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.