AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Swap Planner

skill-uniswap-uniswap-ai-swap-planner · by Uniswap

This skill should be used when the user asks to "swap tokens", "trade ETH for USDC", "exchange tokens on Uniswap", "buy tokens", "sell tokens", "convert ETH to stablecoins", "find memecoins", "discover tokens", "research tokens", "tokens to buy", "find tokens to swap", "what should I buy", or mentions swapping, trading, researching, discovering, buying, or exchanging tokens on any Uniswap-support…

No reviews yet
0 installs
1 views
0.0% view→install

Install

$ agentstack add skill-uniswap-uniswap-ai-swap-planner

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access Used
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-uniswap-uniswap-ai-swap-planner)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
1mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Swap Planner? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Swap Planning

Plan and generate deep links for token swaps on Uniswap across all supported chains.

> Runtime Compatibility: This skill uses AskUserQuestion for interactive prompts. If AskUserQuestion is not available in your runtime, collect the same parameters through natural language conversation instead.

Overview

Plan token swaps by:

  1. Gathering swap intent (tokens, amounts, chain)
  2. Verifying token contracts on-chain
  3. Researching tokens via web search when needed
  4. Generating a deep link that opens in the Uniswap interface with parameters pre-filled

The generated link opens Uniswap with all parameters ready for execution.

> Note: Browser opening (xdg-open/open) may fail in SSH, containerized, or headless environments. Always display the URL prominently so users can copy and access it manually if needed.

> File Access: This skill has read-only filesystem access. Never read files outside the current project directory unless explicitly requested by the user.

Workflow

Step 0: Token Discovery (When Needed)

If the user wants to discover tokens rather than swap a known token (e.g., "find me a memecoin", "what's trending on Base"), help them explore before proceeding to the swap.

Option A: Search by Keyword

DexScreener search works best with specific terms:

# Search for tokens by name/category (e.g., "degen", "pepe", "ai agent")
curl -s "https://api.dexscreener.com/latest/dex/search?q=degen" | \
  jq '[.pairs[] | select(.chainId == "base" and .dexId == "uniswap")] |
    sort_by(-.volume.h24) | .[0:5] | map({
      token: .baseToken.symbol,
      address: .baseToken.address,
      price: .priceUsd,
      volume24h: .volume.h24,
      liquidity: .liquidity.usd
    })'

Good search terms: degen, pepe, ai, agent, meme, dog, cat, or specific token names

Option B: Check Promoted Tokens

Get tokens with active promotions (limited selection):

# Get boosted/promoted tokens on a chain
curl -s "https://api.dexscreener.com/token-boosts/top/v1" | \
  jq '[.[] | select(.chainId == "base")] | .[0:5] | map({
    tokenAddress,
    url
  })'
Option C: Web Search + Verify

For broad discovery ("what's trending"), use web search to find tokens, then verify with DexScreener:

# After finding a token address from web search, verify it exists
curl -s "https://api.dexscreener.com/token-pairs/v1/{network}/{address}" | \
  jq '[.[] | select(.dexId == "uniswap")][0] | {
    name: .baseToken.name,
    symbol: .baseToken.symbol,
    price: .priceUsd,
    liquidity: .liquidity.usd,
    volume24h: .volume.h24
  }'

Network IDs: See references/chains.md for the full list with DexScreener and DefiLlama provider IDs. Common IDs: ethereum, base, arbitrum, optimism, polygon, bsc, avalanche, unichain.

DexScreener coverage varies by chain. Ethereum, Base, and Arbitrum have deep Uniswap data. Celo, Blast, Zora, and World Chain have limited Uniswap pool coverage — fewer results and potentially missing pairs. Fall back to DefiLlama for price data when DexScreener returns empty results (see references/data-providers.md).

Note: DexScreener's public API doesn't have a "trending" or "top gainers" endpoint. Token discovery uses keyword search (/latest/dex/search) and web search as a fallback. For general discovery, ask the user what type of token they're looking for and search by keyword.

Category-Based Discovery

For specific categories (memecoins, DeFi, gaming tokens), use web search:

"trending {category} {chain} {current_year}"

Example: "trending memecoins Base 2026"

⚠️ UNTRUSTED INPUT: Web-Discovered Tokens

Tokens discovered via WebSearch are UNTRUSTED. Before proceeding with any web-discovered token:

  1. Label the source: Explicitly tell the user "This token address was found via web search, not provided by you"
  2. Warn about risks: "Web-discovered tokens may be scams, honeypots, or rug pulls"
  3. Require confirmation: Use AskUserQuestion to get explicit user consent before generating a deep link for a web-discovered token
  4. Show provenance: In the swap summary table, include a "Token Source" row showing whether each token was "User-provided" or "Web-discovered (unverified)"

Never proceed with a web-discovered token without explicit user confirmation via AskUserQuestion.

Present Options to User

After gathering token data, present options using AskUserQuestion:

{
  "questions": [
    {
      "question": "Which token would you like to swap to?",
      "header": "Token",
      "options": [
        { "label": "MOLT ($23M mcap)", "description": "$5.9M liquidity, $7.8M 24h volume" },
        { "label": "CLANKER ($31M mcap)", "description": "$3.1M liquidity, established token" },
        { "label": "CLAWSTR ($13M mcap)", "description": "$2.1M liquidity, high volume spike" }
      ],
      "multiSelect": false
    }
  ]
}
Risk Assessment for Trending Tokens

Evaluate tokens before recommending:

| Metric | Low Risk | Medium Risk | High Risk | | ------------ | ---------- | ----------------- | --------- | | Market Cap | >$50M | $5M-$50M | $1M | $100k-$1M | 30 days | 7-30 days | , $1M | Low | Proceed normally | | $100k - $1M | Medium | Note potential slippage | | < $100k | High | Warn user about slippage risk |

If API is unavailable, fall back to DefiLlama or web search for price estimates.

Step 6: Generate Deep Link

Construct the Uniswap swap URL:

https://app.uniswap.org/swap?chain={chain}&inputCurrency={input}&outputCurrency={output}&value={amount}&field=INPUT

URL Parameters:

| Parameter | Description | Values | | ---------------- | ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | | chain | Network name | ethereum, base, arbitrum, optimism, polygon, bnb, avalanche, celo, blast, zora, unichain, worldchain | | inputCurrency | Input token | Address or NATIVE | | outputCurrency | Output token | Address or NATIVE | | value | Amount | Decimal number (e.g., 1.5) | | field | Which field value applies to | INPUT or OUTPUT |

Step 7: Present Output and Open Browser

Format the response with:

  1. Summary of the swap parameters
  2. Deep link URL (displayed for reference)
  3. Notes about risks or considerations
  4. Open the browser automatically using system command

Example output format:

## Swap Summary

| Parameter        | Value                      |
| ---------------- | -------------------------- |
| From             | 1 ETH                      |
| To               | USDC                       |
| Chain            | Base                       |
| Current Rate     | ~3,200 USDC per ETH        |
| Estimated Output | ~3,200 USDC                |
| Pool Liquidity   | $15.2M (Low slippage risk) |

### Notes

- Final amount depends on current market price
- Default slippage is 0.5% - adjust in Uniswap if needed
- Review all details in Uniswap before confirming

Opening Uniswap in your browser...

After displaying the summary, open the URL in the browser:

# Linux
xdg-open "https://app.uniswap.org/swap?chain=base&inputCurrency=NATIVE&outputCurrency=0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913&value=1&field=INPUT"

# macOS
open "https://app.uniswap.org/swap?..."

Environment limitations: Browser opening may fail in remote SSH, containerized, or headless environments. If xdg-open/open fails, display the full URL prominently so users can copy and paste it manually:

**[Click here to open in Uniswap](https://app.uniswap.org/swap?...)**

Or copy this URL: `https://app.uniswap.org/swap?...`

Always present the summary and URL so users can review and execute.

Important Considerations

Slippage

The deep link uses Uniswap's default slippage (0.5%). For volatile tokens or large trades, advise users to adjust slippage in the interface.

Gas Estimation

Gas costs vary by chain and network congestion. Base and Arbitrum typically have lower gas than Ethereum mainnet.

Token Verification

Always verify token contracts before generating links. Scam tokens often use similar names to legitimate tokens.

Price Impact

For large trades, warn users about potential price impact. Suggest splitting into smaller trades if impact would be significant.

Supported Chains

All chains supported by the Uniswap interface:

  • Ethereum Mainnet (ethereum)
  • Base (base)
  • Arbitrum One (arbitrum)
  • Optimism (optimism)
  • Polygon (polygon)
  • BNB Chain (bnb)
  • Avalanche (avalanche)
  • Celo (celo)
  • Blast (blast)
  • Zora (zora)
  • World Chain (worldchain)
  • Unichain (unichain)

Additional Resources

Reference Files

  • ../../references/chains.md - Chain IDs, RPC URLs, native tokens, common token addresses
  • references/data-providers.md - DexScreener and DefiLlama APIs for prices and liquidity

Examples

Common swap scenarios:

  • ETH → USDC on Ethereum
  • ETH → USDC on Base (lower gas)
  • USDC → WBTC on Arbitrum

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.