swapPilot

Your smart assistant for the cheapest, automated, and transparent swaps.

swapPilot

Created At

ETHGlobal New Delhi

Project Description

SwapPilot does three main things to make your life easier:


1. Finds the Smartest Route ๐Ÿ’ธ

Instead of just going from A to B directly, SwapPilot scans all the possible routes. It might find that trading your Token A for a different Token C, and then trading that Token C for your final Token B, actually gets you more money in the end.

  • Simple Analogy: It's like finding a cheaper flight with a layover instead of taking the expensive direct flight. SwapPilot automatically finds that "cheaper layover" for your crypto trade to save you money.

2. Puts Your Trades on Autopilot ๐Ÿ“ˆ

You can give SwapPilot specific goals, and it will trade for you automatically.

  • "Buy a little bit every day": This is called DCA (Dollar-Cost Averaging). You can tell it, "Buy $20 worth of Ethereum for me every Friday." This helps you invest steadily without having to time the market perfectly.
  • "Buy only at this price": This is a Target-Price Limit. You can say, "If Bitcoin drops to $50,000, automatically buy $500 worth for me." It waits for your perfect price and then acts.

3. Gives You a Clear Receipt ๐Ÿงพ

After the trade is done, SwapPilot shows you exactly where your money went, step-by-step. It provides a visual map of the "route" your trade took and breaks down all the fees. This way, you can be sure you got the best deal possible with no hidden costs.

In a nutshell, SwapPilot is a tool that automatically finds the best deals for your crypto swaps, lets you set up smart, automated trading plans, and proves it's working for you with total transparency. It's designed to save you time, money, and the headache of complex trading.

How it's Made

wapPilot is built on Scaffold-ETH 2, a comprehensive dApp development framework that provides the perfect foundation for DeFi applications. The project uses a monorepo structure with separate packages for smart contracts (Foundry) and frontend (Next.js 15 with TypeScript). The frontend leverages Tailwind CSS with DaisyUI for rapid UI development, Wagmi and RainbowKit for seamless Ethereum wallet integration, and Viem for low-level blockchain interactions. The smart contract development uses Foundry with OpenZeppelin contracts for security best practices, while the API integration utilizes 1inch Fusion Quoter API v2.0 for optimal swap routing and 1inch Swap API v6.1 for transaction generation, all handled through Axios for proper error management. The architecture features a multi-chain approach with dynamic token loading, where each of the 9 supported chains (Ethereum, Optimism, Arbitrum, Avalanche, Base, Binance, ZkSync, Gnosis, and Polygon) has its own token address mapping that dynamically updates the UI based on the selected network. The system uses two different 1inch APIs strategically - Fusion Quoter for better routing algorithms and Swap API for transaction construction, giving users the best execution across multiple DEXs with gas optimization and deep liquidity access. A particularly clever solution is the chain-aware quick swaps that dynamically generate available token pairs based on the selected network, ensuring users never see unavailable options. The "To" token input is made read-only since the amount is calculated by the 1inch API, but still allows token selection to prevent user confusion while maintaining functionality. The comprehensive error handling cascades through different error sources to provide meaningful feedback, and the entire system is built with full TypeScript coverage for type safety, resulting in a production-ready DeFi application that delivers the best possible user experience while maintaining security and reliability across multiple blockchain networks.

background image mobile

Join the mailing list

Get the latest news and updates