From ae6d988365d137fc5755279aea18db4064bccecf Mon Sep 17 00:00:00 2001 From: Nick Koutrelakos Date: Wed, 1 Apr 2026 09:50:47 -0700 Subject: [PATCH 1/3] [new-plugin] uniswap-swap-integration v1.3.0 --- submissions/uniswap-swap-integration/LICENSE | 21 ++++++ .../uniswap-swap-integration/README.md | 25 +++++++ .../uniswap-swap-integration/plugin.yaml | 24 +++++++ .../skills/uniswap-swap-integration/SKILL.md | 72 +++++++++++++++++++ 4 files changed, 142 insertions(+) create mode 100644 submissions/uniswap-swap-integration/LICENSE create mode 100644 submissions/uniswap-swap-integration/README.md create mode 100644 submissions/uniswap-swap-integration/plugin.yaml create mode 100644 submissions/uniswap-swap-integration/skills/uniswap-swap-integration/SKILL.md diff --git a/submissions/uniswap-swap-integration/LICENSE b/submissions/uniswap-swap-integration/LICENSE new file mode 100644 index 0000000..fb60be1 --- /dev/null +++ b/submissions/uniswap-swap-integration/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Uniswap Labs + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/submissions/uniswap-swap-integration/README.md b/submissions/uniswap-swap-integration/README.md new file mode 100644 index 0000000..709b860 --- /dev/null +++ b/submissions/uniswap-swap-integration/README.md @@ -0,0 +1,25 @@ +# uniswap-swap-integration + +Integrate Uniswap swaps into frontends, backends, and smart contracts via Trading API, Universal Router SDK, or direct contract calls + +## Source + +This skill is maintained by Uniswap Labs in the [uniswap-ai](https://github.com/uniswap/uniswap-ai) monorepo. + +The canonical source is at [`packages/plugins/uniswap-trading/skills/swap-integration/`](https://github.com/uniswap/uniswap-ai/tree/main/packages/plugins/uniswap-trading/skills/swap-integration). + +### What It Does + +- Guides AI agents through integrating Uniswap swaps using the Trading API, Universal Router SDK, or direct smart contract calls +- Covers frontend hooks, backend scripts, Solidity integrations, Permit2 patterns, and L2 WETH handling +- Provides decision matrices for choosing the right integration method + +### Related Skills + +- **uniswap-swap-planner**: Plan swaps and generate Uniswap deep links +- **uniswap-viem-integration**: Foundational EVM blockchain integration +- **uniswap-pay-with-any-token**: Pay HTTP 402 challenges using any token + +## License + +MIT diff --git a/submissions/uniswap-swap-integration/plugin.yaml b/submissions/uniswap-swap-integration/plugin.yaml new file mode 100644 index 0000000..ea6970f --- /dev/null +++ b/submissions/uniswap-swap-integration/plugin.yaml @@ -0,0 +1,24 @@ +schema_version: 1 +name: uniswap-swap-integration +version: "1.3.0" +description: "Integrate Uniswap swaps into frontends, backends, and smart contracts via Trading API, Universal Router SDK, or direct contract calls" +author: + name: "Uniswap Labs" + github: "wkoutre" +license: MIT +category: defi-protocol +tags: + - uniswap + - swap + - defi + - trading-api + - universal-router + - permit2 + - ethereum + +components: + skill: + dir: skills/uniswap-swap-integration + +api_calls: + - "trade-api.gateway.uniswap.org" diff --git a/submissions/uniswap-swap-integration/skills/uniswap-swap-integration/SKILL.md b/submissions/uniswap-swap-integration/skills/uniswap-swap-integration/SKILL.md new file mode 100644 index 0000000..23ba1a1 --- /dev/null +++ b/submissions/uniswap-swap-integration/skills/uniswap-swap-integration/SKILL.md @@ -0,0 +1,72 @@ +--- +name: uniswap-swap-integration +description: "Integrate Uniswap swaps into applications via Trading API, Universal Router SDK, or direct smart contract calls" +version: "1.3.0" +author: "Uniswap Labs" +tags: + - uniswap + - swap + - defi + - trading-api +--- + +# Uniswap Swap Integration + +Integrate Uniswap swaps into frontends, backends, and smart contracts. + +## Overview + +This skill guides AI agents through integrating Uniswap token swaps using three methods: Trading API (recommended for most use cases), Universal Router SDK (full routing control), and direct smart contract calls (on-chain composability). + +## Pre-flight Checks + +1. Node.js and npm/yarn installed +2. An Ethereum RPC endpoint configured +3. For Trading API: a Uniswap API key from [developer.uniswap.org](https://developer.uniswap.org) + +## Quick Decision Guide + +| 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 | + +## Commands + +### Trading API (Recommended) + +Base URL: `https://trade-api.gateway.uniswap.org/v1` + +3-step flow: + +1. **Check Approval**: `POST /check_approval` to verify token allowance +2. **Get Quote**: `POST /quote` to get swap route and pricing +3. **Execute Swap**: `POST /swap` to get the transaction calldata + +### Universal Router SDK + +For full control, use `@uniswap/universal-router-sdk` and `@uniswap/v3-sdk`. + +## Full Skill + +For the complete integration guide with code examples, Permit2 patterns, L2 WETH handling, ERC-4337 support, and troubleshooting, install the full plugin: + +``` +npx skills add Uniswap/uniswap-ai +``` + +## Error Handling + +| Error | Cause | Resolution | +|-------|-------|------------| +| "INSUFFICIENT_FUNDS" | Not enough tokens for swap | Check balance before submitting | +| "SLIPPAGE_TOO_HIGH" | Market moved beyond tolerance | Increase slippage or retry | +| 403 from Trading API | Missing or invalid API key | Get key from developer.uniswap.org | + +## Skill Routing + +- For swap planning with deep links (no code) -> use `uniswap-swap-planner` +- For viem/wagmi blockchain setup -> use `uniswap-viem-integration` +- For paying API invoices with any token -> use `uniswap-pay-with-any-token` From 3fb6d2c84cf7ac8d223b8634340e610d4e51eb17 Mon Sep 17 00:00:00 2001 From: Nick Koutrelakos Date: Wed, 1 Apr 2026 09:55:34 -0700 Subject: [PATCH 2/3] simplify SKILL.md to minimal stub pointing to canonical source --- .../skills/uniswap-swap-integration/SKILL.md | 59 +------------------ 1 file changed, 3 insertions(+), 56 deletions(-) diff --git a/submissions/uniswap-swap-integration/skills/uniswap-swap-integration/SKILL.md b/submissions/uniswap-swap-integration/skills/uniswap-swap-integration/SKILL.md index 23ba1a1..296a489 100644 --- a/submissions/uniswap-swap-integration/skills/uniswap-swap-integration/SKILL.md +++ b/submissions/uniswap-swap-integration/skills/uniswap-swap-integration/SKILL.md @@ -5,68 +5,15 @@ version: "1.3.0" author: "Uniswap Labs" tags: - uniswap - - swap - defi - - trading-api --- -# Uniswap Swap Integration +# uniswap-swap-integration -Integrate Uniswap swaps into frontends, backends, and smart contracts. - -## Overview - -This skill guides AI agents through integrating Uniswap token swaps using three methods: Trading API (recommended for most use cases), Universal Router SDK (full routing control), and direct smart contract calls (on-chain composability). - -## Pre-flight Checks - -1. Node.js and npm/yarn installed -2. An Ethereum RPC endpoint configured -3. For Trading API: a Uniswap API key from [developer.uniswap.org](https://developer.uniswap.org) - -## Quick Decision Guide - -| 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 | - -## Commands - -### Trading API (Recommended) - -Base URL: `https://trade-api.gateway.uniswap.org/v1` - -3-step flow: - -1. **Check Approval**: `POST /check_approval` to verify token allowance -2. **Get Quote**: `POST /quote` to get swap route and pricing -3. **Execute Swap**: `POST /swap` to get the transaction calldata - -### Universal Router SDK - -For full control, use `@uniswap/universal-router-sdk` and `@uniswap/v3-sdk`. - -## Full Skill - -For the complete integration guide with code examples, Permit2 patterns, L2 WETH handling, ERC-4337 support, and troubleshooting, install the full plugin: +This skill is maintained by Uniswap Labs. Install the full version: ``` npx skills add Uniswap/uniswap-ai ``` -## Error Handling - -| Error | Cause | Resolution | -|-------|-------|------------| -| "INSUFFICIENT_FUNDS" | Not enough tokens for swap | Check balance before submitting | -| "SLIPPAGE_TOO_HIGH" | Market moved beyond tolerance | Increase slippage or retry | -| 403 from Trading API | Missing or invalid API key | Get key from developer.uniswap.org | - -## Skill Routing - -- For swap planning with deep links (no code) -> use `uniswap-swap-planner` -- For viem/wagmi blockchain setup -> use `uniswap-viem-integration` -- For paying API invoices with any token -> use `uniswap-pay-with-any-token` +Source: [uniswap-ai/packages/plugins/uniswap-trading/skills/swap-integration](https://github.com/uniswap/uniswap-ai/tree/main/packages/plugins/uniswap-trading/skills/swap-integration) From 98ab5224eef68443a0b27befd01f51421f1281de Mon Sep 17 00:00:00 2001 From: Nick Koutrelakos Date: Wed, 1 Apr 2026 10:01:45 -0700 Subject: [PATCH 3/3] add per-plugin install command to stub --- .../skills/uniswap-swap-integration/SKILL.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/submissions/uniswap-swap-integration/skills/uniswap-swap-integration/SKILL.md b/submissions/uniswap-swap-integration/skills/uniswap-swap-integration/SKILL.md index 296a489..6cb11a8 100644 --- a/submissions/uniswap-swap-integration/skills/uniswap-swap-integration/SKILL.md +++ b/submissions/uniswap-swap-integration/skills/uniswap-swap-integration/SKILL.md @@ -16,4 +16,10 @@ This skill is maintained by Uniswap Labs. Install the full version: npx skills add Uniswap/uniswap-ai ``` +Or install just this plugin: + +``` +claude plugin add @uniswap/uniswap-trading +``` + Source: [uniswap-ai/packages/plugins/uniswap-trading/skills/swap-integration](https://github.com/uniswap/uniswap-ai/tree/main/packages/plugins/uniswap-trading/skills/swap-integration)