design-integrationDesign a Uniswap integration architecture. Use when user is building a project that needs to integrate Uniswap and wants recommendations on integration method (Trading API vs SDK vs direct contract), architecture patterns, required dependencies, and security considerations.
Install via ClawdBot CLI:
clawdbot install wpank/design-integrationDesigns a complete Uniswap integration architecture for any project by delegating to the integration-architect agent. Produces a comprehensive blueprint covering: integration method recommendation (Trading API vs Universal Router SDK vs direct contract vs V4 hooks), component architecture, dependency list with versions, security review with mitigations, and ordered implementation plan.
Activate when the user asks:
| Parameter | Required | Default | Description |
| --- | --- | --- | --- |
| projectType | Yes | -- | Type of project (e.g., "DeFi dashboard", "arb bot", "wallet app", "DeFi protocol") |
| functionality | Yes | -- | Required Uniswap functionality: "swap", "LP", "both", or "custom" |
| environment | No | Auto-detect | Execution environment: "frontend", "backend", "smart contract", or "full-stack" |
| chains | No | ethereum | Target chain(s): single chain name or comma-separated list |
| scale | No | -- | Expected scale: transaction volume, concurrent users, latency requirements |
Task(subagent_type:integration-architect) with the full context. The integration-architect will:Present a structured integration blueprint:
Integration Blueprint: DeFi Dashboard with Swap (Ethereum + Base)
Recommended Method: Trading API (primary), Universal Router SDK (fallback)
Rationale: Trading API provides optimized routing with minimal frontend
complexity. Fallback to SDK for advanced use cases or API downtime.
Architecture:
User -> QuoteService -> ApprovalManager -> SwapExecutor -> Wallet -> Chain
Components:
QuoteService: Fetches and caches quotes from Trading API
ApprovalManager: Manages Permit2 approvals and allowances
SwapExecutor: Constructs and submits swap transactions
ChainManager: Multi-chain config and RPC connections
Dependencies:
@uniswap/sdk-core ^5.8.0 Token and price primitives
viem ^2.21.0 Ethereum client
wagmi ^2.14.0 React wallet hooks
@tanstack/react-query ^5.0.0 Data fetching and caching
Security:
- Stale quotes: Refresh every 15s, enforce deadline (block.timestamp + 300s)
- Approvals: Permit2 with exact amounts and 30-min expiry
- Key management: wagmi wallet connection only, never handle keys
Implementation Order:
1. Wallet connection (wagmi) ā 1 day
2. Chain configuration ā 0.5 days
3. Quote fetching service ā 1 day
4. Permit2 approval flow ā 1 day
5. Swap execution and tracking ā 1.5 days
6. Error handling and retry logic ā 1 day
Complexity: Medium
integration-architect agent -- it does not call MCP tools directly.| Error | User-Facing Message | Suggested Action |
| --- | --- | --- |
| VAGUE_PROJECT | "Need more detail about your project to recommend an integration approach." | Describe project type and what Uniswap functionality is needed |
| DEPRECATED_APPROACH | "The requested integration method is deprecated. Recommending alternatives." | Follow the updated recommendation |
| UNSUPPORTED_CHAIN | "Uniswap is not deployed on the specified chain." | Choose from the 11 supported chains |
| CONFLICTING_REQUIREMENTS | "The requirements conflict (e.g., frontend + direct contract calls)." | Clarify the execution environment and adjust expectations |
Generated Mar 1, 2026
A web application that aggregates user DeFi positions across multiple chains and allows them to execute swaps directly from the dashboard. It requires real-time price quotes and seamless wallet integration for a smooth user experience.
A backend service that monitors price discrepancies between Uniswap and other DEXs to execute profitable trades automatically. It demands low-latency transaction execution and robust error handling to manage gas costs and slippage.
A mobile or web wallet that integrates Uniswap to enable users to swap tokens directly within the app, supporting multiple chains for broader accessibility. Focuses on user-friendly interfaces and secure transaction flows.
A smart contract-based protocol that uses Uniswap for liquidity provisioning and token swaps as part of its yield-generating strategies. Requires integration with both swap and LP functionalities for automated operations.
An online store that accepts cryptocurrency payments by integrating Uniswap to convert various tokens into a stablecoin at checkout. Needs reliable swap execution and minimal latency to finalize transactions quickly.
Generate income by charging a small percentage fee on each swap executed through the integration. This model is common in aggregators and wallets, where volume drives profitability.
Offer premium features such as advanced analytics, lower fees, or priority support through monthly or annual subscriptions. Suitable for DeFi dashboards targeting professional traders.
Earn commissions from yield generated by liquidity provision or arbitrage activities facilitated by the integration. Ideal for protocols that automate DeFi strategies for users.
š¬ Integration Tip
Start with the Trading API for simplicity and fallback to the SDK for advanced needs; always use viem and Permit2 for security and modern best practices.
Connect Claude to Clawdbot instantly and keep it connected 24/7. Run after setup to link your subscription, then auto-refreshes tokens forever.
ERC-8004 Trustless Agents - Register, discover, and build reputation for AI agents on Ethereum. Use when registering agents on-chain, querying agent registries, giving/receiving reputation feedback, or interacting with the AI agent trust layer.
Autonomous crypto trading on Base via Bankr. Use for trading tokens, monitoring launches, executing strategies, or managing a trading portfolio. Triggers on "trade", "buy", "sell", "launch", "snipe", "profit", "PnL", "portfolio balance", or any crypto trading task on Base.
Deploy ERC20 tokens on Base using Clanker SDK. Create tokens with built-in Uniswap V4 liquidity pools. Supports Base mainnet and Sepolia testnet. Requires PRIVATE_KEY in config.
Query DeFi portfolio data across 50+ chains via Zapper's GraphQL API. Use when the user wants to check wallet balances, DeFi positions, NFT holdings, token prices, or transaction history. Supports Base, Ethereum, Polygon, Arbitrum, Optimism, and more. Requires ZAPPER_API_KEY.
Interact with Solana blockchain via Helius APIs. Create/manage wallets, check balances (SOL + tokens), send transactions, swap tokens via Jupiter, and monitor addresses. Use for any Solana blockchain operation, crypto wallet management, token transfers, DeFi swaps, or portfolio tracking.