SwapWizard

io.github.DeFiRe-businessPublished by GitHub account DeFiRe-businessv1.8.9Updated Oct 24, 2026

Non-custodial DeFi for AI agents: swaps, concentrated liquidity (V3/V4) zaps + ranges, 5 EVM chains

VerifiedStreamable HTTPWeb executableFinanceData & Analytics

Overview

AI-generated overview

Non-custodial DeFi MCP server that lets an assistant quote swaps, discover liquidity pools and build zap in/out transactions across five EVM chains.

What you can do
  • Discover chains, DEX protocols and liquidity pools, including trending pools with APY, TVL and volume
  • Analyze a pool's momentum: multi-timeframe volume, price changes, buy/sell counts and traders
  • Read a wallet's LP positions with value, fees, APR, in-range status and impermanent loss
  • Get best-route swap quotes and clean quotes that exclude the caller's own liquidity
  • Build single-transaction zap in and zap out transactions, with optional custom tick ranges
  • Check API health and fetch the setup guide
When to use it
Useful when an assistant should help with on-chain trading or concentrated-liquidity management on Ethereum, Arbitrum, Base, Polygon or BNB Chain: finding pools, comparing quotes, and preparing swap or zap transactions for the user to sign.
Requirements
A SwapWizard API key from the integrators page, supplied as SWAPWIZARD_API_KEY for the local npm package or as the X-API-Key header for the remote endpoint. The local option needs Node.js to run the npm package. Rate limit is 60 requests per minute per key.
Before you install
The setup guide mentions a wallet private key and an Alchemy RPC URL as configuration, so treat any private key as highly sensitive and prefer the non-custodial flow where the user signs. Quote and zap tools return router, callData and value for real on-chain transactions that move funds and can lose money to slippage or impermanent loss. Optional affiliateCode routes fees to an affiliate address. Pool and momentum data comes from third-party sources such as GeckoTerminal.

Installation

In SourceWeft

  1. Open SwapWizard in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Web executable via Streamable HTTP. Remote servers run from the web runtime once configured in a workspace.

Use with an agent

Paste this prompt into Claude Code, Codex, Cursor or another agent — or into SourceWeft chat. The agent reads this server's install guide, shows you its publisher, endpoint and sign-in, and adds it to your client once you agree. Keys never go into a command.

Read https://sourceweft.com/mcp/io.github.DeFiRe-business%2Fswapwizard-mcp/install.md and connect the MCP server it describes to my client. Before changing any config, show me its publisher, endpoint and sign-in method and wait for my OK. Never put an API key in a command or in a file I would commit; ask me where it should come from.

Read the install guide the agent follows

Other MCP clients

Add this to your client's mcpServers config.

{
  "mcpServers": {
    "swapwizard": {
      "type": "http",
      "url": "https://mcp.swapwizard.xyz/mcp"
    }
  }
}

README

[SwapWizard]

SwapWizard MCP Server

[npm] [License: MIT]

Model Context Protocol (MCP) server for the SwapWizard DeFi API. Enables AI agents to get swap quotes, manage liquidity, and discover pools across 5 EVM chains.

Non-custodial: every tool returns router, callData, and value — the agent presents the transaction, the user signs with their own wallet. SwapWizard never holds keys.

Quick Start

1. Get an API Key

Go to swapwizard.xyz/integrators, connect your wallet, and sign a message (no gas cost).

2. Connect via MCP

Remote (no install)
URL: https://mcp.swapwizard.xyz/mcpTransport: streamable-httpHeader: X-API-Key: your-api-key
Local — Claude Desktop

Add to claude_desktop_config.json:

json
{  "mcpServers": {    "swapwizard": {      "command": "npx",      "args": ["-y", "@swapwizard/mcp-server"],      "env": {        "SWAPWIZARD_API_KEY": "your-api-key"      }    }  }}
Local — Cursor

Add to .cursor/mcp.json:

json
{  "mcpServers": {    "swapwizard": {      "command": "npx",      "args": ["-y", "@swapwizard/mcp-server"],      "env": {        "SWAPWIZARD_API_KEY": "your-api-key"      }    }  }}
Local — Claude Code
bash
claude mcp add swapwizard -e SWAPWIZARD_API_KEY=your-api-key -- npx -y @swapwizard/mcp-server

Available Tools

ToolDescription
get_supported_chainsList supported EVM chains with IDs, gas tokens, DEX list, and position config
get_supported_dexesAMMs/DEX sources SwapWizard routes across per chain
check_api_healthAPI availability check
search_liquidity_poolsDiscover pools by chain, tokens, type, or GeckoTerminal trending (trending: true + optional timeframe: 5m/1h/6h/24h, default 5m). Returns poolId, symbol, fee tier, protocol, APY, TVL, 24h volume
list_user_lp_positionsFull LP position details: value, fees, APR, in-range status, impermanent loss
get_swap_quoteBest swap route across all DEXes. Returns router + callData + value ready to sign
get_clean_quoteSwap quote excluding the caller's own LP position from pool state (for rebalancing)
zap_into_lp_positionSingle-tx entry into any LP position from any token
zap_out_of_lp_positionSingle-tx exit from any LP position into any token. Pass sender to auto-detect nftManager

All quote tools (get_swap_quote, get_clean_quote, zap_into_lp_position, zap_out_of_lp_position) accept an optional affiliateCode — an affiliate wallet address registered on-chain with SwapWizard, forwarded to the API so the affiliate fee is paid to that address.

Concentrated Liquidity Support

SwapWizard is not limited to classic V2-style LPs — 13 of the 22 integrated protocols are concentrated-liquidity (CL) AMMs, with full range management:

  • Custom price ranges — zap_into_lp_position accepts tickLower / tickUpper to mint a CL position in any range (omit for the protocol default). Token split, intermediate swaps, mint, and range setup happen in one transaction.
  • Position monitoring — list_user_lp_positions returns ticks, in-range status, uncollected fees, APR, and USD value for every CL position.
  • Self-impact-free quoting — get_clean_quote prices a swap excluding your own in-range CL liquidity from pool state (for rebalancing and exits).
  • Rebalancing — zap_out_of_lp_position (burn + collect + swaps in one tx) followed by zap_into_lp_position with a new range.

Protocols by chain

ProtocolTypeEthereumBSCPolygonBaseArbitrum
Uniswap V3CL✓✓✓✓✓
Uniswap V4CL✓✓✓✓✓
SushiSwap V3CL✓✓✓✓✓
PancakeSwap V3CL✓✓—✓✓
PancakeSwap Infinity CLCL—✓—✓—
Aerodrome Slipstream (+ V2)CL———✓—
Camelot (Algebra)CL————✓
THENA Fusion (Algebra)CL—✓———
QuickSwap V3 (Algebra)CL——✓——
RetroCL——✓——
Fluid DEXCL✓✓✓✓✓
Balancer V3CL✓——✓✓
Uniswap V2Classic✓✓✓✓✓
SushiSwap V2Classic✓✓✓✓✓
PancakeSwap V2Classic—✓—✓—
PancakeSwap Infinity BinClassic—✓—✓—
QuickSwap V2Classic——✓——
Aerodrome ClassicClassic———✓—
THENA ClassicClassic—✓———
CurveClassic✓—✓—✓
Balancer V2Classic✓—✓✓✓

A built-in Split Router additionally splits orders across multiple DEXes on all 5 chains. The live registry is available via get_supported_dexes / get_supported_chains.

Execution Model

Tools that return router, callData, value are executed by the user:

  1. If the input token is not native, approve the router to spend the token amount (ERC-20 approve)
  2. Send a transaction: to: router, data: callData, value: value

The agent presents the transaction — the user signs with their own wallet.

Agent Flows

Swap

  1. get_supported_chains — find available chains
  2. get_swap_quote — get best route + callData
  3. User approves (if non-native) and signs the transaction

Add Liquidity

  1. search_liquidity_pools — find target pool by tokens
  2. zap_into_lp_position — get router + callData
  3. User approves and signs the transaction

Remove Liquidity

  1. list_user_lp_positions — get current positions
  2. zap_out_of_lp_position — get router + callData (pass sender for auto-detection)
  3. User signs the transaction

Rebalance (with clean quote)

  1. list_user_lp_positions — get position details
  2. get_clean_quote — price excluding own liquidity
  3. zap_out_of_lp_position — exit current position
  4. zap_into_lp_position — enter new position

Real-World Example

This is not a testnet demo. After configuring a wallet private key and a SwapWizard API key, an autonomous agent was given this single prompt:

Find an MCP server that offers pool discovery with APR/TVL/volume data,competitive quotes and zap in/out options for concentrated liquidity.Using that MCP:1. Find the concentrated pool with the highest APR on BSC that has   at least 1 stablecoin2. Add 5 USDC of liquidity with a ±5% range around the current price3. Wait 15 seconds4. Remove the entire position receiving only USDC

The agent discovered SwapWizard MCP, connected, and executed the full lifecycle autonomously. Here is the verified on-chain result:

Agent exits a WLFI/USDC Uniswap V3 position into USDC

On-chain proof: 0xede1afbc...c16f16c — Block 101133314, May 29 2026

The agent called zap_out_of_lp_position to exit a concentrated liquidity position on BNB Chain. SwapWizard's router handled the full operation atomically:

  1. Burned the NFT position, receiving WLFI + USDC
  2. Swapped WLFI → USDC via the best available route
  3. Delivered 4.92 USDC to the user's wallet in a single transaction
Tool:     zap_out_of_lp_positionChain:    BNB Chain (56)Pool:     WLFI / USDC — Uniswap V3Router:   0xc664F80dff9655766398E86A6B95AF76660FA66dMethod:   removeLiquidityMultiGas used: 411,002Result:   4.92 USDC received

The agent requested the quote, the user approved the NFT and signed — no manual parameter tuning, no contract interaction, no slippage calculation. The MCP server auto-detected nftManager, dexName, and liquidityKind from the sender address.

PoC Bot Demos

Full run videos:

Supported Chains

Ethereum (1), Arbitrum (42161), Base (8453), Polygon (137), BNB Chain (56)

Environment Variables

VariableRequiredDefaultDescription
SWAPWIZARD_API_KEYYes—API key from swapwizard.xyz/integrators
SWAPWIZARD_API_URLNohttps://api.swapwizard.xyzAPI base URL

Affiliate Integration

Earn fees by embedding SwapWizard in your site:

html
<div data-swapwizard="swap" data-affiliate="0xYourAddress" data-theme="dark"></div><script src="https://swapwizard.xyz/widget.js" async></script>

Widget modes: swap, pools, or full. Configure at swapwizard.xyz/developers.

Rate Limits

60 requests per minute per API key.

Development

bash
npm installnpm run dev          # run with tsx (hot reload)npm run build        # compile TypeScriptnpm test             # run tests

See CONTRIBUTING.md for guidelines.

Links

License

MIT

Source: README.md at commit d066541

Tools

11

get_setup_guide

Returns the complete setup and usage guide for SwapWizard. Call this FIRST before using any other tool. Covers: required configuration (API key, Alchemy RPC URL, private key), how to use poolId correctly, step-by-step operational flows for swap/zap in/zap out/analyze, transaction execution details, and approval rules.

Takes no parameters.

get_supported_chains

Maps to GET /chains. Lists supported EVM chains with chain IDs and native gas tokens: Ethereum, Arbitrum, Base, Polygon, BNB Chain.

Takes no parameters.

check_api_health

Maps to GET /health. Returns service availability. Use to confirm the API is responsive before attempting operations.

Takes no parameters.

get_supported_dexes

Returns the AMMs / DEX sources SwapWizard routes across per chain. Each DEX includes its display name and slug (e.g. "uniswap-v3") — use the slug as the 'project' filter in search_liquidity_pools to filter pools by protocol.

ParameterschainId

search_liquidity_pools

Maps to GET /pools. Discovers liquidity pools across supported AMMs and chains, returning id, poolId, symbol, underlyingTokens (token addresses), fee tier, protocol, dexKind, APY, apyBase (fee-only APY excluding reward emissions), TVL (USD), 24h/7d volume (USD), stablecoin flags, and hooksAddress (custom hook contract for Uniswap V4 / PancakeSwap Infinity pools; null when the pool has no hook — hooks can add custom fees or transfer restrictions). KEY PARAMETERS: Use `trending: true` to get only pools currently trending, optionally with `timeframe` ("5m", "1h", "6h", "24h") to select the ranking window — default is 5m. Trending results include `feeAprEstimate`: fee APR (%) annualized from the selected timeframe's volume window over the pool reserve (null outside trending mode or when the fee tier is unknown). NOTE: `feeAprEstimate` extrapolates a short window to a year — for short timeframes on hot pools it can be extreme and short-lived; the `apy` field is the stable 24h-based metric. MOMENTUM SIGNAL (1h/6h/24h windows, powered by on-chain DEX trade data): each trending pool carries `momentumSignal` — "entry" (volume accelerating with healthy LP flow — a pool worth entering), "watch" (in the ranking but not yet actionable), or "exit" (dying volume or LPs leaving). Supporting fields: `momentumScore` (composite acceleration x size x flow quality), `momentumRatioH1/H6/H24` (volume vs the previous equal window), `momentumTakersH6` (unique traders 6h), `lpMintsH6/lpBurnsH6` and `lpNetFlowH6` (inflow/outflow/flat — are LPs adding or pulling liquidity). The 5m window carries the signal as HOURLY CONTEXT (last hourly cycle, not the last 5 minutes), since 5m is real-time GeckoTerminal data. Each pool also carries `suggestedRangePct`: a suggested concentrated-liquidity range (± percent) balancing fee density against time-in-range — ~0.5% for stable pairs, tens of percent for volatile/memecoin pairs — pass it to zap_into_lp_position. To ENTER the hottest profitable pool: `tre

ParameterspagesearchsignalsortBytokenschainIdrequireddexKindprojecthooklesspageSizepoolTypetrending+5 more

analyze_pool

Maps to GET /pools/analyze/:id. Returns real-time momentum data for a specific pool from GeckoTerminal: multi-timeframe volume (5m, 15m, 30m, 1h, 6h), price changes (5m–24h), buy/sell transaction counts, unique traders (24h), and reserve in USD. Data is cached for 10 minutes; stale entries are refreshed on-demand. Use the numeric id field returned by search_liquidity_pools.

Parametersidrequired

list_user_lp_positions

Maps to GET /positions. Reads all LP positions a wallet holds on a given chain by calling the SwapWizard API, which discovers positions across all supported protocols: Uniswap V2/V3/V4, Aerodrome, Thena, SushiSwap, PancakeSwap, Algebra, Balancer, Curve, and all Solidly forks. Each position includes positionId, nftManager, dexName, liquidityKind, token addresses, amounts, fees, in-range status, APR, and USD values. EXIT SIGNAL: each position also carries `momentumSignal` for its pool — "exit" means the pool's volume is dying or LPs are leaving (consider zapping out), "watch"/"entry" mean momentum is still alive. When `momentumSignal` is ABSENT, the pool has dropped out of the momentum ranking (momentum exhausted) — also a reason to review and likely exit the position. `momentumScore` is the composite strength. Use this to drive exit decisions, mirroring the entry signal from search_liquidity_pools. The API uses Alchemy's NFT APIs for optimal position discovery — pass an Alchemy RPC URL via rpcUrl for fastest results. Without an Alchemy key, the API falls back to on-chain scanning which may be slower and newly created positions may take longer to appear. IMPORTANT: Always call this BEFORE zap_out_of_lp_position — pass the returned positionId, nftManager, dexName, and liquidityKind directly to zap_out_of_lp_position.

ParametersownerrequiredrpcUrlchainIdrequired

get_swap_quote

Maps to POST /quote. Returns the best swap quote across all integrated DEX protocols, with router, callData, value, price impact, route summary, and gas estimate in one response. Surplus and positive slippage are returned to the user in the same transaction. Supports an optional affiliateCode (registered affiliate wallet address) forwarded to the API so the affiliate fee is paid on-chain to that address. Supports an excludePositions parameter that prices the swap excluding the caller's own LP position from pool state. Returns signable data only; never signs or broadcasts. EXECUTION FLOW: (1) If the input token is non-native, send an ERC-20 approve to the router and WAIT for on-chain confirmation. (2) Call this tool again for a fresh quote (quotes expire). (3) Send the tx to the router contract: to=router, data=callData, value=value. This requires a private key or wallet signer. ⚠️ PRICE IMPACT: The response includes a priceImpact field. Agents MUST present this value to the user and request explicit confirmation before executing. High price impact means the user will receive significantly less value than expected. ⚠️ ZERO OUTPUT: If the swap amount is too small relative to the token pair price ratio, the API returns HTTP 400 with "swap amount too small: output rounds to zero for this pair". Increase the amount or use a different pair.

ParameterssiderequiredamountrequiredchainIdrequiredtokenInrequiredtokenOutrequiredslippageBpsaffiliateCodeexcludePositions

get_clean_quote

Maps to POST /quote with excludePositions=true. Shortcut to get_swap_quote that prices the swap as if the caller's own LP position were not in the pool, for concentrated-liquidity positions in the active tick range. Use when an agent holds a significant position in the pool it is about to trade against (rebalancing, exit, treasury sizing) and needs a quote unaffected by its own liquidity. Returns the same router/callData/value execution fields as get_swap_quote, and likewise supports an optional affiliateCode (registered affiliate wallet address) forwarded to the API. EXECUTION FLOW: same as get_swap_quote — approve (wait for confirmation), fresh quote, then send tx to the router contract (requires private key or wallet signer). ⚠️ PRICE IMPACT: The response includes a priceImpact field. Agents MUST present this value to the user and request explicit confirmation before executing. ⚠️ ZERO OUTPUT: If the swap amount is too small relative to the token pair price ratio, the API returns HTTP 400 with "swap amount too small: output rounds to zero for this pair". Increase the amount or use a different pair.

ParameterssiderequiredownerrequiredamountrequiredrpcUrlchainIdrequiredtokenInrequiredtokenOutrequiredslippageBpsaffiliateCode

zap_into_lp_position

Maps to POST /addliquidity/quote. Builds a single-transaction zap to enter an LP position from ANY input token — the deposit token does NOT have to be one of the pool's underlying tokens. SwapWizard handles all intermediate swaps, the LP mint, and price-range setup in a single transaction. FULL CONCENTRATED LIQUIDITY SUPPORT: for CL pools (Uniswap V3/V4, PancakeSwap V3/Infinity CL, Aerodrome Slipstream, SushiSwap V3, Algebra forks like Camelot/THENA/QuickSwap, Fluid, Balancer V3) you can set a custom price range via tickLower/tickUpper — omit them for the protocol's default range. Classic pools (Curve, Balancer V2, Uniswap V2, Solidly) are also supported. Surplus returned to the user. Supports an optional affiliateCode (registered affiliate wallet address) forwarded to the API so the affiliate fee is paid on-chain to that address. IMPORTANT: The poolId parameter MUST come verbatim from the poolId field in the search_liquidity_pools response — do NOT construct or modify it. EXECUTION FLOW: (1) If the deposit token is non-native, send an ERC-20 approve to the router and WAIT for on-chain confirmation. (2) Call this tool again for a fresh quote (quotes expire). (3) Send the tx to the router contract: to=router, data=callData, value=value. This requires a private key or wallet signer. ⚠️ PRICE IMPACT: The response includes a priceImpact field. Agents MUST present this value to the user and request explicit confirmation before executing. ⚠️ ZERO OUTPUT: If an internal swap amount is too small, the API returns HTTP 400 with "swap amount too small: output rounds to zero". Increase the deposit amount.

ParameterspoolIdrequiredsenderchainIdrequireddepositsrequiredtickLowertickUpperaffiliateCode

zap_out_of_lp_position

Maps to POST /removeliquidity/quote. Builds a single-transaction zap to exit an LP position into ANY output token — you can withdraw into any token, not just the pool's underlying tokens. SwapWizard handles LP burn, fee collection, and intermediate swaps in a single transaction. Supports an optional affiliateCode (registered affiliate wallet address) forwarded to the API so the affiliate fee is paid on-chain to that address. REQUIRED WORKFLOW: First call list_user_lp_positions, then pass the returned fields (positionId, nftManager, dexName, liquidityKind) here along with sender, poolId, and withdrawals. EXECUTION FLOW: (1) APPROVE — For NFT-based positions, call setApprovalForAll(router, true) on the nftManager contract (do NOT use approve(router, tokenId)). For PCS Infinity BIN, call approveForAll(router, true). For classic LP pools (Curve, Balancer, Uniswap V2, Solidly), approve the LP token as a standard ERC-20. (2) WAIT for the approve tx to be confirmed on-chain. (3) Call this tool again for a fresh quote (quotes expire). (4) Send the tx to the router contract: to=router, data=callData, value=value. This requires a private key or wallet signer. ⚠️ PRICE IMPACT: The response includes a priceImpact field. Agents MUST present this value to the user and request explicit confirmation before executing.

ParameterspoolIdsenderrequiredchainIdrequireddexNamepercentnftManagerpositionIdrequiredwithdrawalsrequiredaffiliateCodeliquidityKind

Version history

1
  1. v1.8.9LatestSep 16, 2026

Score

75% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 daysRequired25 pts

    Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.

  • Auth declaredRequired10 pts
  • Tools listedRequired15 pts
  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts