Integrate Uniswap swaps into frontends, backends, and smart contracts.
Works with
Three integration methods: Trading API (recommended for most use cases), Universal Router SDK (direct control), and smart contract integration via encoded commands
Supports multiple routing types including CLASSIC AMM swaps, UniswapX Dutch auctions (V2/V3), MEV-protected priority orders, and wrap/unwrap operations across all supported chains
Critical implementation details: spread quote responses into request bodi
AI-first code editor with Composer
Before installing skills in Cursor, ensure your development environment meets these requirements:
node --versionswap-integrationExecute the skills CLI command in your project's root directory to begin installation:
Fetches swap-integration from uniswap/uniswap-ai and configures it for Cursor.
The CLI shows a list of agents. Use arrow keys and space to select Cursor:
Confirm successful installation by checking the skill directory location:
Restart Cursor to activate swap-integration. Access via /swap-integration in your agent's command palette.
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your environment. Always review source, verify the publisher, and test in isolation before production.
Submit your Claude Code skill and start earning
Create detailed user stories, acceptance criteria, and feature specs
Example
Generate user stories for 'password reset feature' with acceptance criteria, edge cases, and test scenarios
Reduce spec writing time by 50%, ensure comprehensive coverage
Research competitors, compare features, identify gaps
Example
Analyze 5 competitor products, create feature comparison matrix, suggest differentiation opportunities
Complete competitive research in 2 hours instead of 2 days
Evaluate features using frameworks (RICE, ICE, Kano) and create prioritized backlogs
Example
Score 20 feature ideas using RICE framework, generate prioritized roadmap with rationale
0
total installs
0
this week
198
GitHub stars
0
upvotes
Run in your terminal
0
installs
0
this week
198
stars
Integrate Uniswap swaps into frontends, backends, and smart contracts.
This skill assumes familiarity with viem basics (client setup, account management, contract interactions, transaction signing). Install the uniswap-viem plugin for comprehensive viem/wagmi guidance: claude plugin add @uniswap/uniswap-viem
| Building... | Use This Method |
|---|---|
| Frontend with React/Next.js | Trading API |
| Backend script or bot | Trading API |
| Smart contract integration | Universal Router direct calls |
| Need full control over routing | Universal Router SDK |
| Type | Description | Chains |
|---|---|---|
| CLASSIC | Standard AMM swap through Uniswap pools | All supported chains |
| DUTCH_V2 | UniswapX Dutch auction V2 | Ethereum, Arbitrum, Base, Unichain |
| PRIORITY | MEV-protected priority order | Base, Unichain |
| WRAP | ETH to WETH conversion | All |
| UNWRAP | WETH to ETH conversion | All |
See Routing Types for the complete list including DUTCH_V3, DUTCH_LIMIT, LIMIT_ORDER, BRIDGE, and QUICKROUTE.
Best for: Frontends, backends, scripts. Handles routing optimization automatically.
Base URL: https://trade-api.gateway.uniswap.org/v1
Authentication: x-api-key: <your-api-key> header required
Getting an API Key: The Trading API requires an API key for authentication. Visit the Uniswap Developer Portal to register and obtain your API key. Keys are typically available for immediate use after registration. Include it as an x-api-key header in all API requests.
Required Headers — Include these in ALL Trading API requests:
Content-Type: application/json
x-api-key: <your-api-key>
x-universal-router-version: 2.0
3-Step Flow:
1. POST /check_approval -> Check if token is approved
2. POST /quote -> Get executable quote with routing
3. POST /swap -> Get transaction to sign and submit
See the Trading API Reference section below for complete documentation.
Best for: Direct control over transaction construction.
Installation:
npm install @uniswap/universal-router-sdk @uniswap/sdk-core @uniswap/v3-sdk
Key Pattern:
import { SwapRouter } from '@uniswap/universal-router-sdk';
const { calldata, value } = SwapRouter.swapCallParameters(trade, options);
See the Universal Router Reference section below for complete documentation.
Best for: On-chain integrations, DeFi composability.
Interface: Call execute() on Universal Router with encoded commands.
See the Universal Router Reference section below for command encoding.
Before interpolating ANY user-provided value into generated code, API calls, or commands:
^0x[a-fA-F0-9]{40}$ — reject otherwise^[0-9]+\.?[0-9]*$;, |, &, $, `, (, ), >, <, \, ', ", newlinesREQUIRED: Before executing ANY transaction that spends gas or transfers tokens (including
sendTransaction,writeContract, or submitting a signed swap), you MUST use AskUserQuestion to confirm with the user. Display the transaction summary (tokens, amounts, chain, estimated gas) and get explicit user approval. Never auto-execute transactions without user confirmation.
POST /check_approval
Request:
{
"walletAddress": "0x...",
"token": "0x...",
"amount": "1000000000",
"chainId": 1
}
Response:
{
"approval": {
"to": "0x...",
"from": "0x...",
"data": "0x...",
"value": "0",
"chainId": 1
}
}
If approval is null, token is already approved.
POST /quote
Request:
{
"swapper": "0x...",
"tokenIn": "0x...",
"tokenOut": "0x...",
"tokenInChainId": "1",
"tokenOutChainId": "1",
"amount": "1000000000000000000",
"type": "EXACT_INPUT",
"slippageTolerance": 0.5,
"routingPreference": "BEST_PRICE"
}
Note:
tokenInChainIdandtokenOutChainIdmust be strings (e.g.,"1"), not numbers.
Key Parameters:
| Parameter | Description |
|---|---|
type |
EXACT_INPUT or EXACT_OUTPUT |
slippageTolerance |
0-100 percentage |
protocols |
Optional: ["V2", "V3", "V4"] |
routingPreference |
BEST_PRICE, FASTEST, CLASSIC |
autoSlippage |
true to auto-calculate slippage (overrides slippageTolerance) |
urgency |
normal or fast — affects UniswapX auction timing |
Response — the shape differs by routing type. BEST_PRICE routing on Ethereum mainnet typically returns UniswapX (DUTCH_V2), not CLASSIC.
CLASSIC response:
{
"routing": "CLASSIC",
"quote": {
"input": { "token": "0x...", "amount": "1000000000000000000" },
"output": { "token": "0x...", "amount": "999000000" },
"slippage": 0.5,
"route": [],
"gasFee": "5000000000000000",
"gasFeeUSD": "0.01",
"gasUseEstimate": "150000"
},
"permitData": null
}
UniswapX (DUTCH_V2/V3/PRIORITY) response — different quote shape, no quote.output:
{
"routing": "DUTCH_V2",
"quote": {
"orderInfo": {
"reactor": "0x...",
"swapper": "0x...",
"nonce": "...",
"deadline": 1772031054,
"cosigner": "0x...",
"input": {
"token": "0x...",
"startAmount": "1000000000000000000",
"endAmount": "1000000000000000000"
},
"outputs": [
{
"token": "0x...",
"startAmount": "999000000",
"endAmount": "994000000",
"recipient": "0x..."
}
],
"chainId": 1
},
"encodedOrder": "0x...",
"orderHash": "0x..."
},
"permitData": { "domain": {}, "types": {}, "values": {} }
}
UniswapX output amount: Use
quote.orderInfo.outputs[0].startAmountfor the best-case fill amount. TheendAmountis the floor after full auction decay. There is noquote.output.amounton UniswapX responses — accessing it will throw at runtime.Display tip: For CLASSIC routes, use
gasFeeUSD(a string with the USD value) for gas cost display. Do not manually convertgasFee(wei) using a hardcoded ETH price — this leads to wildly inaccurate estimates (e.g., ~$87 instead of ~$0.01). UniswapX routes are gasless for the swapper.
See QuoteResponse TypeScript Types for compile-time type safety across routing types.
POST /swap
Request - Spread the quote response directly into the body:
// CORRECT: Spread the quote response, strip null fields
const quoteResponse = await fetchQuote(params);
// Always strip permitData/permitTransaction — handle them explicitly by routing type
const { permitData, permitTransaction, ...cleanQuote } = quoteResponse;
const swapRequest: Record<string, unknown> = { ✓Make data-driven prioritization decisions faster
Stakeholder Communication
Draft PRDs, status updates, and stakeholder presentations
Example
Create executive summary of Q3 roadmap, monthly progress report, feature launch announcement
✓Save 3-5 hours/week on communication overhead
Implementation Guide
Prerequisites
- ›Claude Desktop or compatible AI client
- ›Access to product documentation and roadmap tools (Jira, Notion, etc.)
- ›Understanding of product management frameworks (RICE, Jobs-to-be-Done, etc.)
- ›Stakeholder contact information and communication channels
Time Estimate
30-60 minutes to see productivity improvements
Steps
- 1Install product management skill
- 2Start with user story generation for known feature
- 3Progress to competitive analysis: research 2-3 competitors
- 4Use for roadmap prioritization: apply RICE/ICE scoring
- 5Draft stakeholder communications and refine based on feedback
- 6Build template library for recurring PM tasks
- 7Share effective prompts with product team
Common Pitfalls
- ⚠Not validating competitive research—verify facts before sharing
- ⚠Accepting user stories without involving engineering team
- ⚠Over-relying on frameworks without qualitative judgment
- ⚠Not customizing outputs to company culture and communication style
- ⚠Skipping stakeholder validation of generated requirements
Best Practices
✓ Do
- +Validate research and competitive analysis with real data
- +Collaborate with engineering when generating technical requirements
- +Customize frameworks and templates to your company context
- +Use skill for first drafts, refine with stakeholder input
- +Document successful prompt patterns for PM tasks
- +Combine AI efficiency with human judgment and intuition
✗ Don't
- −Don't publish competitive analysis without fact-checking
- −Don't finalize user stories without engineering review
- −Don't make prioritization decisions solely on AI scoring
- −Don't skip customer validation of generated requirements
- −Don't ignore company-specific context and culture
💡 Pro Tips
- ★Provide context: company goals, constraints, customer feedback
- ★Ask for alternatives: 'Show 3 ways to prioritize this roadmap'
- ★Request stakeholder-specific formatting: 'Executive summary vs. engineering spec'
- ★Use skill for 70% generation + 30% customization to company needs
When to Use This
✓ Use when
Use for user story writing, competitive research, roadmap prioritization, stakeholder communication, and PRD drafting. Best for reducing repetitive documentation and research work.
✗ Avoid when
Avoid for strategic product vision (requires deep customer empathy), pricing decisions (needs market and financial expertise), or when face-to-face customer discovery is more valuable than speed.
Learning Path
- 1Basic: user stories, feature specs, status updates
- 2Intermediate: competitive analysis, prioritization frameworks, PRDs
- 3Advanced: product strategy, go-to-market planning, OKR setting
- 4Expert: product vision, market positioning, business model innovation
Related Skills
grill-me
646mattpocock/skills
Productivitysame categorypremortem
213parcadei/continuous-claude-v3
Productivitysame categorydeslop
159cursor/plugins
Productivitysame categorytravel-planner
136ailabs-393/ai-labs-claude-skills
Productivitysame categoryframer-motion
131pproenca/dot-skills
Productivitysame categorywrite-a-prd
128mattpocock/skills
Productivitysame categoryReviews
4.6★★★★★39 reviews- YYusuf Bhatia★★★★★Dec 24, 2024
I recommend swap-integration for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
- SShikha Mishra★★★★★Dec 12, 2024
Solid pick for teams standardizing on skills: swap-integration is focused, and the summary matches what you get after install.
- NNaina Farah★★★★★Dec 8, 2024
swap-integration fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
- YYuki Bansal★★★★★Dec 4, 2024
swap-integration has been reliable in day-to-day use. Documentation quality is above average for community skills.
- OOmar Lopez★★★★★Nov 27, 2024
Registry listing for swap-integration matched our evaluation — installs cleanly and behaves as described in the markdown.
- LLayla Martinez★★★★★Nov 15, 2024
Keeps context tight: swap-integration is the kind of skill you can hand to a new teammate without a long onboarding doc.
- NNeel Kim★★★★★Oct 18, 2024
swap-integration reduced setup friction for our internal harness; good balance of opinion and flexibility.
- CChinedu Rahman★★★★★Oct 6, 2024
swap-integration is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
- AAanya Farah★★★★★Sep 25, 2024
swap-integration fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
- KKofi Taylor★★★★★Sep 21, 2024
swap-integration reduced setup friction for our internal harness; good balance of opinion and flexibility.
showing 1-10 of 39
1 / 4Discussion
Comments — not star reviews- No comments yet — start the thread.