Back to Blog
March 15, 20265 minDevFlare Team

Case Study: Building a Non-Custodial Crypto Swap Platform

How we built a multi-chain token swap platform with WalletConnect, aggregated DEX routing, slippage protection, and live gas pricing — all in six weeks.

Web3CryptoCase StudyNext.js

The project

A client needed a non-custodial token swap platform supporting Ethereum, Polygon, and Base. Users connect their own wallet, pick a token pair, and execute swaps through aggregated DEX liquidity — without the platform ever touching their funds.

The stack

  • Next.js — frontend and API routes
  • ethers.js — blockchain interactions
  • wagmi — wallet connection (injected + WalletConnect)
  • Uniswap SDK — DEX aggregation
  • Prisma + Postgres — user favourites, swap history

Key challenges

1. Slippage and MEV protection

Default slippage of 0.5% with an advanced mode letting users set custom values. We added a MEV protection toggle that routes through flashbots for Ethereum swaps.

2. Gas estimation

Gas prices vary wildly across chains and times. We built a gas oracle that fetches current prices from each chain's RPC and displays estimated cost in USD before the user confirms.

3. Wallet connection UX

Users expect to click "Connect Wallet" and see their balance immediately. Wagmi handles the connection; we handle the loading states, error states (wrong chain, no wallet installed), and the "switch network" flow.

What shipped

  • Swap interface with token search and balance display
  • Multi-hop routing through Uniswap v2 and v3
  • Transaction history with status tracking
  • Favourite token pairs saved per wallet

Timeline

Six weeks from kickoff to mainnet deploy. Week 1 was design and RPC setup, weeks 2–4 were core swap logic, week 5 was testing on testnets, week 6 was mainnet deploy and documentation.

DF
DevFlare Team
DevFlare — software studio
Work with us

Related

More posts

// Contact

Want to talk?

Reach out about products, partnerships, or anything else. We read every message.