SwapWizard

io.github.DeFiRe-business由 GitHub 帳號 DeFiRe-business 發布v1.8.9更新於 Oct 24, 2026

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

已驗證Streamable HTTP可網頁執行金融資料與分析

概覽

AI 產生的概覽

非託管的 DeFi MCP 伺服器,讓助理在五條 EVM 鏈上取得兌換報價、探索流動性池並產生 zap 進出交易。

可以做什麼
  • 查詢支援的鏈、DEX 協定與流動性池,包含附 APY、TVL 與成交量的熱門池
  • 分析單一池的動能資料:多時間窗成交量、價格變化、買賣筆數與交易者數
  • 讀取錢包的 LP 持倉,含價值、手續費、APR、是否在區間內與無常損失
  • 取得最佳路由的兌換報價,以及排除自身流動性的 clean 報價
  • 產生單筆交易的 zap 進入與退出,可自訂 tick 區間
  • 檢查 API 健康狀態並取得設定指南
適用情境
適合讓助理在以太坊、Arbitrum、Base、Polygon 或 BNB Chain 上協助鏈上交易與集中流動性管理:尋找池子、比較報價,並準備由使用者簽署的兌換或 zap 交易。
執行需求
需要從整合商頁面取得的 SwapWizard API 金鑰:本機 npm 套件透過 SWAPWIZARD_API_KEY 提供,遠端端點透過 X-API-Key 標頭提供。本機方式需要 Node.js 執行 npm 套件。每個金鑰限制每分鐘 60 次請求。
安裝前請注意
設定指南提到需要錢包私鑰與 Alchemy RPC URL,私鑰屬高度敏感資訊,建議採用由使用者自行簽署的非託管流程。報價與 zap 工具回傳 router、callData 與 value,對應真實的鏈上交易,會轉移資金,並可能因滑價或無常損失造成虧損。選用的 affiliateCode 會把手續費支付給聯盟地址。池與動能資料來自 GeckoTerminal 等第三方。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 SwapWizard,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/io.github.DeFiRe-business%2Fswapwizard-mcp/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "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

來源:README.md,提交 d066541

工具

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.

無需輸入參數。

get_supported_chains

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

無需輸入參數。

check_api_health

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

無需輸入參數。

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.

輸入參數chainId

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

輸入參數pagesearchsignalsortBytokenschainId必填dexKindprojecthooklesspageSizepoolTypetrending另有 5 個

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.

輸入參數id必填

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.

輸入參數owner必填rpcUrlchainId必填

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.

輸入參數side必填amount必填chainId必填tokenIn必填tokenOut必填slippageBpsaffiliateCodeexcludePositions

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.

輸入參數side必填owner必填amount必填rpcUrlchainId必填tokenIn必填tokenOut必填slippageBpsaffiliateCode

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.

輸入參數poolId必填senderchainId必填deposits必填tickLowertickUpperaffiliateCode

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.

輸入參數poolIdsender必填chainId必填dexNamepercentnftManagerpositionId必填withdrawals必填affiliateCodeliquidityKind

版本歷史

1
  1. v1.8.9最新Sep 16, 2026

評分

已滿足適用檢查項的 75%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分