Summary
For Developers
Add Uniswap token swaps to any application — choose the integration method that fits your stack.
- Three supported methods: Trading API (frontend/backend), Universal Router SDK (full control), direct contract call (Solidity)
- Built-in input validation and mandatory user confirmation before every transaction
- Complete Trading API reference included — all routing types and order variants
SKILL.md
Uniswap Swap Integration
Integrate Uniswap token swaps into any application layer — React frontend, backend script, or Solidity smart contract.
Prerequisites
claude plugin add @uniswap/uniswap-tradingornpx skills add Uniswap/uniswap-aiinstalleduniswap-vieminstalled and configured (required foundation)- Uniswap Developer Portal API key (for Trading API authentication)
When to Use This Skill
Use this skill when the user:
- Wants to add swap functionality to a React or Next.js frontend
- Is building a backend script or bot that executes Uniswap swaps
- Wants to call Uniswap swaps from within a Solidity smart contract
- Asks about the Uniswap Trading API, Universal Router, or swap integration methods
How It Works
Three integration paths are available depending on what you're building:
| Method | Best for |
|---|---|
| Trading API | React/Next.js frontends or backend scripts — best routing, fastest to integrate |
| Universal Router SDK | Scenarios requiring full transaction-level control |
Direct execute() call | Solidity contracts composing on-chain with other DeFi protocols |
All paths include strict input validation. The skill enforces a mandatory user confirmation step before any transaction is submitted — this cannot be bypassed. The complete Trading API reference is included, covering all routing types, order variants, and error handling.
Key endpoints (base URL: https://trade-api.gateway.uniswap.org/v1):
POST /check_approval— Check if a token approval is needed before swappingPOST /quote— Get an executable quote with optimal routingPOST /swap— Get a signed transaction ready to submit