paladin-swap-mcp
Multi-aggregator swap router for AI agents on Base. MCP-native, best-of-N across 0x and Velora, current flat 10 bps fee.
README
paladin-swap-mcp
Open client and API spec for PaladinFi Swap — a competitive multi-aggregator swap router for AI agents on Base. This repository contains the public REST and MCP API specification, working code examples, and thin client wrappers. The hosted backend at swap.paladinfi.com is proprietary.
Routing scope. PaladinFi Swap queries a limited set of integrated upstream aggregators (currently 0x and Velora; 1inch and Odos planned) in parallel and returns whichever delivers the higher post-fee buy amount. We do not represent any returned route as the best available, lowest-cost, or optimal across the broader DeFi market. Phrases like "best execution" are reserved-meaning terms in U.S. securities law and are deliberately not used here.
What is PaladinFi Swap?
A swap router built for AI agents that need to execute on-chain swaps. Your agent calls a single tool; the service returns ready-to-execute calldata your wallet signs and submits:
- Router address to send the transaction to
- Calldata with all routing pre-baked
- Min buy amount (slippage protection enforced on-chain)
- Affiliate fee already injected — no separate accounting on your side
Agents skip writing aggregator glue, slippage handling, and fee logic. One call, ready bytes.
The Service is non-custodial: PaladinFi never holds, signs, or moves user funds. Every transaction is signed and submitted by the user's own wallet (or their agent acting on their behalf).
Install (MCP)
For Claude Code or any MCP-compatible client supporting Streamable-HTTP transport:
claude mcp add --transport http --scope user paladin-swap https://swap.paladinfi.com/mcp
Restart your client. Three tools become available:
swap_quote(sellToken, buyToken, sellAmount, taker, chainId?, slippageBps?)— competitive route across 0x and Velora (highest post-fee buy amount); returns ready-to-execute calldata.trust_check_preview(address, chainId?)— sample-fixture preview of the trust gate. Returns_real: false, every factor isreal: false, and the recommendation is prefixedsample-(e.g.,sample-allow). Do not use the preview verdict to gate real swaps, signing, or any production agent decision. For production trust evaluation, POST to/v1/trust-check(paid, $0.001 USDC/call via x402) or use the npm plugins@paladinfi/eliza-plugin-trust/@paladinfi/agentkit-actions.swap_health()— liveness, fee config, per-source counters, decimals-cache state, last Velora startup-canary verdict, selector-enforcement state.
See mcp-tools.json for the full tool schemas.
Install (REST)
No MCP needed — hit the endpoint directly:
curl -sS https://swap.paladinfi.com/v1/quote \
-H 'content-type: application/json' \
-d '{
"chainId": 8453,
"sellToken": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"buyToken": "0x4200000000000000000000000000000000000006",
"sellAmount": "5000000",
"taker": "0xYOUR_AGENT_WALLET"
}'
Full REST spec in openapi.yaml.
Endpoints
| Method | Path | Purpose | Pricing |
|---|---|---|---|
GET |
/health |
Liveness, fee config, per-source counters, decimals-cache state, last Velora canary verdict, selector-enforcement state | Free |
POST |
/v1/quote |
Competitive route quote with calldata — highest post-fee buy amount across 0x and Velora | Free |
POST |
/v1/trust-check |
Live token-contract trust evaluation (OFAC SDN, GoPlus, Etherscan, anomaly heuristics) | $0.001 USDC/call via x402 |
POST |
/v1/trust-check/preview |
Sample-fixture preview of the trust-check response shape (no live data sources evaluated) | Free |
POST |
/mcp |
MCP Streamable-HTTP transport (3 tools — see mcp-tools.json) |
Free |
Response shape (abridged)
{
"source": "velora",
"chainId": 8453,
"router": "0x6a000f20005980200259b80c5102003040001068",
"calldata": "0x...",
"buyAmount": "2160000000000000",
"minBuyAmount": "2138000000000000",
"sellAmount": "5000000",
"gas": "318707",
"ourFeeBps": 10,
"ourFeeRecipient": "0xeA8C33d018760D034384e92D1B2a7cf0338834b4",
"estimatedOurFeeAmount": "2160000000000",
"estimatedOurFeeToken": "0x4200000000000000000000000000000000000006"
}
source is the upstream aggregator that won this quote ("0x" or "velora"). Submit the transaction as to=router, data=calldata, value=0 (for ERC20→ERC20) from taker.
Examples
examples/python/quote_and_swap.py— Python with web3.pyexamples/typescript/quote_and_swap.ts— TypeScript with viem
Fees
A flat 10 basis points (0.1%) is taken on the buy token. The fee is calculated against the actual fill amount, not the quoted estimate, so you never pay more than expected even if the pool moves between quote and fill. PaladinFi's 10 bps is taken from the buy-token side via the upstream aggregator's integrator-fee mechanism (0x's swapFeeBps / Velora's partnerFeeBps), so the buyAmount you see in the response already reflects both any upstream protocol fee and our 10 bps — no additional deduction at fill time.
Fees route directly to the PaladinFi treasury — no on-chain receipt step on your side. The fee recipient address is published in /health so it's auditable on-chain. The /v1/quote endpoint stays free to query, with no per-call charges or spread on top. (/v1/trust-check is the only paid endpoint, at $0.001 USDC/call via x402.)
Supported assets
- Chain: Base (8453). Ethereum mainnet, Arbitrum, Optimism, BNB are on the roadmap.
- Tokens: Any ERC20 supported by either 0x or Velora on Base. Coverage is the union of both aggregators — canonical pairs (USDC, WETH, cbBTC, USDT, DAI, AERO) are routable on both; long-tail tokens often route on only one of the two.
Trust Check data sources
The paid /v1/trust-check endpoint evaluates a token contract against a defined set of public data sources and returns a single recommendation: "allow" | "warn" | "block" verdict alongside per-source breakdown. Sources currently consulted, with verifiability pointers:
| Source | What it screens | Verifiability |
|---|---|---|
| OFAC SDN list (U.S. Department of the Treasury) | Sanctioned addresses (the contract itself, deployer, and known associated wallets) | List refreshed daily on the hosted backend from the Treasury Sanctions List Service feed at https://sanctionslistservice.ofac.treas.gov/api/PublicationPreview/exports/SDN_ADVANCED.XML. The address dataset extracted is the union of Feature[@FeatureTypeID="345"]/FeatureVersion/VersionDetail[@DetailTypeID="1432"] entries (FeatureTypeID 345 = ETH/EVM addresses; DetailTypeID 1432 = Digital Currency Address Detail). Loaded count as of last verification: 87 ETH addresses (2026-04-30). The underlying Treasury feed is publicly downloadable so any client can independently re-derive the dataset and verify a positive match. |
| GoPlus Token Security API | Honeypot patterns, mint authority, ownership renouncement, transfer pause, blacklist function, anti-whale, hidden owners, slippage modifiers | Queried per-call via https://api.gopluslabs.io/api/v1/token_security/8453?contract_addresses=<address>. We normalize the GoPlus response into the factors array we surface; the full GoPlus response is publicly queryable so buyers can independently audit any signal. |
| Etherscan / BaseScan source verification (via the unified Etherscan v2 API) | Verified-source presence, proxy-pattern detection, contract age, deployer attribution | Queried per-call via https://api.etherscan.io/v2/api?chainid=8453&module=contract&action=getsourcecode&address=<address>. Public source code (when verified) is independently inspectable on basescan.org. |
| Anomaly heuristics (PaladinFi-internal) | Fresh-deploy detection, low-holder-count signal, proxy-pattern flags | Heuristic logic is part of the proprietary backend; the response includes the per-factor signal so a buyer can reproduce or override the conclusion using the verifiable sources above. |
Preview vs paid distinction. /v1/trust-check/preview (free) returns a static fixture with _real: false markers — none of the live data sources above are queried. /v1/trust-check (paid, $0.001 USDC via x402) consults all four. The preview exists so integrators can validate request shape and inspect the response schema without paying; agents must check the top-level _real field is true before consuming a verdict.
Request logging. Per call, PaladinFi retains a request log entry containing timestamp, the queried address, source IP, and billing/rate-limit reference. This is used for revenue accounting, rate-limit enforcement, and abuse detection — not for analytics or resale. PaladinFi does not maintain a separate database of evaluated tokens or buyer query history.
Roadmap
- [x] 0x Settler routing on Base
- [x] Highest-of-two routing across 0x and Velora on Base (v0.11.66+, 2026-05-04)
- [x] MCP Streamable-HTTP transport
- [x]
trust_check_previewMCP tool (v0.11.65) - [x]
/v1/trust-checkpaid endpoint via x402 ($0.001 USDC/call) - [x] Per-source 4-byte calldata selector + Settler-target allowlist (v0.11.71 — defense in depth against router-substitution / dispatcher-hijack attacks)
- [ ] 1inch + Odos as additional routing sources — planned
- [ ] Ethereum mainnet, Arbitrum, BNB, Optimism — planned
- [ ] Permit2-native flow (skip the approve tx) — planned
Status
Production. The endpoint is live, monitored, and verified end-to-end with on-chain test transactions on Base. See /health for current fee config, version, and per-source counters.
What's in this repository
| File / folder | Purpose |
|---|---|
README.md |
This file |
LICENSE |
MIT — covers everything in this repo |
openapi.yaml |
OpenAPI 3.0 spec for the public REST API |
mcp-tools.json |
MCP tool schemas |
examples/ |
Working code examples (Python, TypeScript) |
Not in this repository: the hosted backend (proprietary). This repo is the public client surface — install instructions, schemas, and integration code samples.
Contact
- Email: dev@paladinfi.com
- Marketing: paladinfi.com
- API: swap.paladinfi.com/health
- Landing: paladinfi.com/swap/
Legal
Operated by Malcontent Games LLC, doing business as PaladinFi, a Michigan limited liability company. The Service routes quotes through third-party aggregators (currently 0x and Velora). You retain custody — your agent signs every transaction. PaladinFi never holds user funds.
Use of the hosted Service is subject to the PaladinFi Terms of Service and Privacy Policy.
License
The contents of this repository are released under the MIT License. The hosted backend is proprietary and not covered.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。