3 min read
IntentSwap

IntentSwap is an intent-based swap dApp that lets users create conditional token swap intents (e.g. β€œswap when price crosses X”), which can be executed automatically by an off-chain bot when conditions are met.

πŸš€ What it does

  • Create swap intents with configurable price thresholds and expiration
  • Monitor intents off-chain and execute swaps when conditions are satisfied
  • Use Chainlink Price Feeds for reliable price checks
  • Swap through Uniswap V3 with slippage protection

πŸ”„ How it works (high-level)

  1. User creates an intent on-chain (token pair, amount, price threshold, expiration) and enables bot auto-execution
  2. The bot keeps track of active intents and checks prices via Chainlink oracles
  3. When conditions are met, the bot triggers on-chain execution
  4. The executor validates the intent and performs the swap via Uniswap V3

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                         IntentSwap                              β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚    packages/    β”‚    packages/    β”‚         packages/           β”‚
β”‚    hardhat      β”‚      web        β”‚           bot               β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Smart Contracts β”‚  Next.js App    β”‚  Cloudflare Worker          β”‚
β”‚ - IntentFactory β”‚  - Create UI    β”‚  - Cron job monitoring      β”‚
β”‚ - IntentExecutorβ”‚  - Manage UI    β”‚  - Intent execution         β”‚
β”‚ - Oracle        β”‚                 β”‚  - KV subscriptions         β”‚
β”‚ - Swapper       β”‚                 β”‚                             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ› οΈ Tech Stack

CategoryTechnology
Smart ContractsSolidity, Hardhat, OpenZeppelin
OraclesChainlink Price Feeds
Swap RoutingUniswap V3
FrontendNext.js, React, Wagmi, Viem, RainbowKit
UITailwindCSS, shadcn/ui
BotCloudflare Workers, Hono, Viem
CI/CDGitHub Actions

✨ Highlights

  • Intent-based UX: users define β€œwhat” they want, not β€œhow” to execute it
  • Separation of concerns: on-chain validation + off-chain monitoring/execution
  • Safer execution: oracle-backed condition checks and slippage protection

πŸ›οΈ License

MIT