{"uid":"cap_Bpxd6OqIqjOlX_gliUqGE","slug":"chainhilt-token-swap-executor-4ed80a1d","name":"Chainhilt Token Swap Executor","description":"Select the best available swap quote and return ordered unsigned transaction actions. Run the returned actions in order: up to two approvals, then the swap.","url":"https://chainhilt.ai/api/v1/swap/execute?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"chainId":{"type":"integer","minimum":1},"buyToken":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"sellToken":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"sellAmount":{"type":"string","pattern":"^[0-9]+$"},"slippageBps":{"type":"integer","maximum":5000,"minimum":0},"takerAddress":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"excludedConnectors":{"type":"array","items":{"enum":["1inch","0x","kyberswap","velora","enso","okx","bebop","openocean"],"type":"string"},"uniqueItems":true}}},"responseSchema":{"type":"json","example":{"swap":{"tx":{"to":"0x0000000000000000000000000000000000000005","data":"0xabcdef","value":"0"},"gas":"150000","chainId":8453,"approval":{"token":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","amount":"1000000","spender":"0x0000000000000000000000000000000000000004"},"buyAmount":"560000000000000","aggregator":"0x","sellAmount":"1000000"},"response":{"errors":[],"actions":[{"data":{"to":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","data":"0x095ea7b3","from":"0xE4934BB19E0B97109033dBfDcCc6957E32F9Cc60","value":"0"},"type":"transaction","chainId":8453},{"data":{"to":"0x0000000000000000000000000000000000000005","data":"0xabcdef","from":"0xE4934BB19E0B97109033dBfDcCc6957E32F9Cc60","value":"0"},"type":"transaction","chainId":8453}],"warnings":[]}}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_CM2_Mx1AtoQrdwaRxBRGw","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Selects the best available DEX swap quote across multiple aggregators and returns ordered unsigned transaction actions (approvals + swap) ready to execute on-chain.","exampleAgentPrompt":"Swap 1000 USDC (0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48) for ETH (0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) on Ethereum mainnet (chainId 1) from my wallet 0xAbCd...1234, with 50 bps slippage tolerance — give me the best route excluding 1inch.","exampleUseCases":[{"title":"Automated DCA token purchasing","prompt":"Buy exactly 500 USDC worth of WBTC (0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599) on chain 8453 from my wallet 0xDEAD...BEEF with 30 bps slippage — find me the best swap route and return the transactions I need to sign."},{"title":"Arbitrage bot swap execution","prompt":"I need to swap 10000 USDT (0xdAC17F958D2ee523a2206206994597C13D831ec7) for DAI (0x6B175474E89094C44Da98b954EedeAC495271d0F) on Ethereum (chainId 1) from address 0xAaBb...9900 with 10 bps slippage, excluding kyberswap and bebop — give me the unsigned transactions."},{"title":"Portfolio rebalancing on Base","prompt":"Rebalance my portfolio by swapping 2500000000 units of USDC (0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913) into WETH (0x4200000000000000000000000000000000000006) on Base (chainId 8453) from my wallet 0x1234...5678, with 100 bps max slippage tolerance."}],"resultDescription":"Returns an ordered list of unsigned transaction actions: up to two token approval transactions (if needed) followed by the swap transaction itself, all pre-populated with calldata, target addresses, and values. The agent or wallet must execute them in sequence to complete the swap at the best available rate across supported aggregators (1inch, 0x, KyberSwap, Velora, Enso, OKX, Bebop, OpenOcean).","failureModes":["Insufficient liquidity for the requested swap pair/amount — no route found","Invalid token address format (must be checksummed 0x hex, 40 chars)","sellAmount of zero or non-numeric string","chainId not supported by any available aggregator","slippageBps out of range (must be 0–5000)","takerAddress not provided or malformed — required for constructing approval transactions","All connectors excluded — no aggregators left to route through","x402 payment failure — $0.01 USDC micropayment not completed"],"whenToPreferThis":"Choose this endpoint when you need a single call that aggregates quotes from multiple DEX sources (1inch, 0x, KyberSwap, Velora, Enso, OKX, Bebop, OpenOcean) and returns pre-built, ready-to-sign transaction calldata in the correct execution order. Prefer it over calling individual DEX APIs directly when you want best-execution routing without managing aggregator integrations yourself. Particularly useful for AI agents that need deterministic, ordered unsigned transactions they can pass directly to a wallet signer.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-31T18:30:37.015Z","isFirstParty":false,"canonicalSlug":"chainhilt-token-swap-executor-4ed80a1d"}