IntentSwap

Intent-based token swaps on SUI solvers compete in real-time auctions to give users the best price.

IntentSwap

Created At

HackMoney 2026

Project Description

IntentSwap is an intent-based swap protocol built on SUI that replaces the traditional AMM model with a solver auction mechanism. Instead of swapping against a liquidity pool and accepting whatever price the AMM offers, users declare a swap intent — specifying the token they want to sell, the token they want to receive, and their minimum acceptable amount. Their tokens are locked into an on-chain escrow smart contract written in Move.

Once an intent is created, it's broadcast to a network of solvers via server-sent events. A 30-second auction window opens where solvers compete by submitting quotes. The solver offering the highest output amount wins. The winning solver then fills the intent on-chain — the user's escrowed tokens go to the solver, and the solver's tokens go directly to the user. Settlement is fully atomic and non-custodial.

If no solver fills the intent, the user can cancel and reclaim their escrowed funds. The protocol ensures users always get at least their minimum requested amount, while solver competition drives prices above that floor. This design eliminates MEV extraction, reduces slippage, and creates a competitive marketplace for order flow on SUI.

How it's Made

The core of IntentSwap is a Move smart contract (IntentEscrow) deployed on SUI testnet. It uses SUI's object model with phantom type parameters to create a generic escrow that works across any token pair. The contract handles three operations: creating an escrow (locking user funds), filling by a solver (atomic two-way transfer), and cancellation (returning funds to the creator).

The frontend is a Next.js app using the App Router, with @mysten/dapp-kit for SUI wallet integration (connect, sign, execute transactions). The UI is built entirely with Tailwind CSS v4 — glassmorphism cards, gradient accents, and ambient floating background elements, all without any external UI component library.

The real-time layer was the most interesting part to build. The backend uses API routes with Server-Sent Events (SSE) to push intent creation, quote submissions, and auction results to all connected clients instantly. The solver bot is a standalone TypeScript process that connects to this SSE stream, automatically detects new intents, submits competitive quotes, and when it wins an auction, constructs and executes the Move contract fill transaction using @mysten/sui SDK.

One notably hacky detail: the auction engine runs server-side with in-memory state and setTimeout-based timers. When the 30-second window expires, it evaluates all quotes, picks the winner, and broadcasts the result over SSE — all within a Next.js API route. No separate backend, no database, no message queue. The entire protocol runs as a single Next.js deployment plus a solver process.

background image mobile

Join the mailing list

Get the latest news and updates