SwapWizard

v1.8.9
io.github.DeFiRe-business/swapwizard-mcp Checked 3 days ago Published 5 months ago

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

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

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.

ParameterTypeDescription
chainIdintegerEVM chain ID to filter results. If omitted, returns protocols for all supported chains.

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 rank…

ParameterTypeDescription
chainId *integerEVM chain ID (e.g. 56 for BSC, 1 for Ethereum)
dexKindstringFilter by DEX kind (e.g. UNIV3_SR02)
hooklessbooleanIf true, exclude pools with a custom hook contract (Uniswap V4 / PancakeSwap Infinity). Hooks can add custom fees or transfer restrictions.
pageintegerPage number, 0-based (default: 0)
pageSizeintegerResults per page, max 200 (default: 50)
poolTypestringFilter by pool type
projectstringFilter by protocol/DEX name (e.g. uniswap-v3, pancakeswap-v3, aerodrome-v2)
searchstringSearch by symbol or project name
semiStableOnlybooleanShow only pools with exactly one stablecoin
signalstringFilter by momentum signal. Comma-separated list allowed (e.g. 'entry' or 'entry,watch'). Only effective with trending=true. Combine with sortBy=signal&sortOrder=desc to get entry pools ranked by APR.
sortBystringSort field (default: tvl). 'signal' (trending only) groups pools by momentum signal entry→watch→exit (sortOrder=asc reverses) and within each group by APR descending — i.e. the entry pools with…
sortOrderstringSort direction (default: desc)
stableOnlybooleanShow only stablecoin pairs
timeframestringTrending ranking window (default: 5m). Only applies with trending=true. Sent to the API as trendingDuration; also selects the volume window for feeAprEstimate. Use 6h for sustained LP-yield traction,…
tokensstringComma-separated token addresses to filter pools by
topPerVenueintegerLimit to top N pools per venue by APY
trendingbooleanIf true, return only currently trending pools (with momentumSignal and suggestedRangePct on each result)

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.

ParameterTypeDescription
id *integerPool numeric ID (from the id field in search_liquidity_pools response)

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 mome…

ParameterTypeDescription
chainId *integerEVM chain ID
owner *stringWallet address to query positions for
rpcUrlstringCustom RPC endpoint URL. If the URL is from Alchemy, the API auto-extracts the key for accelerated NFT-based position discovery.

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) I…

ParameterTypeDescription
amount *stringAmount as stringified uint256 in token decimals
chainId *integerEVM chain ID (e.g. 56 for BSC)
side *stringQuote direction
tokenIn *stringInput token address (0x0000...0000 for native coin)
tokenOut *stringOutput token address
affiliateCodestringOptional affiliate wallet address registered on-chain with SwapWizard — forwarded to the API so the affiliate fee for this operation is paid to that address. Omit if you have no affiliate.
excludePositionsarrayPositions to subtract from pool state during simulation — for a clean quote that excludes self-impact. Get these from list_user_lp_positions.
slippageBpsintegerSlippage tolerance in basis points (default: 100 = 1%)

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 g…

ParameterTypeDescription
amount *stringAmount as stringified uint256 in token decimals
chainId *integerEVM chain ID (e.g. 56 for BSC)
owner *stringWallet address whose LP positions will be excluded from pool state during quoting
side *stringQuote direction
tokenIn *stringInput token address (0x0000...0000 for native coin)
tokenOut *stringOutput token address
affiliateCodestringOptional affiliate wallet address registered on-chain with SwapWizard — forwarded to the API so the affiliate fee for this operation is paid to that address. Omit if you have no affiliate.
rpcUrlstringCustom RPC endpoint URL for position discovery.
slippageBpsintegerSlippage tolerance in basis points (default: 100 = 1%)

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…

ParameterTypeDescription
chainId *integerEVM chain ID
deposits *arrayTokens and amounts to deposit
poolId *stringPool identifier from search_liquidity_pools (e.g. 'pancakeswap-v3:0x36696...')
affiliateCodestringOptional affiliate wallet address registered on-chain with SwapWizard — forwarded to the API so the affiliate fee for this operation is paid to that address. Omit if you have no affiliate.
senderstringWallet address of the sender (for simulation)
tickLowerintegerCustom lower tick for concentrated liquidity
tickUpperintegerCustom upper tick for concentrated liquidity

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…

ParameterTypeDescription
chainId *integerEVM chain ID
positionId *stringPosition identifier from list_user_lp_positions. For CL positions: NFT token ID. For classic pools: LP token contract address.
sender *stringWallet address of the position owner.
withdrawals *arrayTokens to receive after removal
affiliateCodestringOptional affiliate wallet address registered on-chain with SwapWizard — forwarded to the API so the affiliate fee for this operation is paid to that address. Omit if you have no affiliate.
dexNamestringDEX project name from list_user_lp_positions (e.g. 'Uniswap V3', 'PancakeSwap V3', 'curve-dex').
liquidityKindstringLiquidity kind from list_user_lp_positions (e.g. UNIV3, UNIV4, ALGEBRA, SLIPSTREAM, PCS_INF_CL, CURVE, UNIV2, SOLIDLY).
nftManagerstringNFT position manager contract address from list_user_lp_positions. Required for CL positions (Uniswap V3/V4, PancakeSwap V3/Infinity CL, SushiSwap V3, Algebra).
percentintegerPercentage of position to remove (default: 100). For classic LP pools (UniV2, Solidly, Curve, Balancer) use 99 instead of 100 to avoid reverts from LP balance race conditions between RPC nodes.
poolIdstringPool identifier from search_liquidity_pools — pass if available.