Uniswap 交易者 MCP
一个用于 AI 代理的 MCP 服务器,用于跨多个区块链自动执行 Uniswap DEX 上的代币交换。
特征
价格报价:通过多跳路由优化获取代币交换的实时价格报价。
掉期执行:在 Uniswap V3 上执行掉期,具有可配置的滑点容忍度和期限。
掉期建议:根据流动性、费用和最佳路径生成交易建议。
多链支持:兼容以太坊、Optimism、Polygon、Arbitrum、Celo、BNB Chain、Avalanche 和 Base。
先决条件
Node.js :版本 14.x 或更高版本。
npm :用于包管理。
钱包:一个有资金的钱包,带有用于执行交换的私钥。
RPC 端点:访问受支持链的区块链 RPC URL(例如 Infura、Alchemy)。
安装
克隆存储库:
git clone https://github.com/kukapay/uniswap-trader-mcp.git cd uniswap-trader-mcp安装依赖项:
npm install
配置
用法
支持的链
支持以下区块链。请确保在chainConfigs.js
中配置每个链的有效 RPC URL、WETH 地址和 SwapRouter 地址。
链ID | 姓名 | 笔记 |
1 | 以太坊 | 主网,广泛用于 Uniswap 交易 |
10 | 乐观 | 第 2 层,需要 Optimism RPC |
137 | 多边形 | 快速且低成本,使用 MATIC 作为原生 |
42161 | 仲裁 | 第 2 层,Arbitrum One 网络 |
42220 | 塞洛 | 移动优先区块链,使用 CELO |
56 | BNB链 | 币安智能链,使用BNB |
43114 | 雪崩 | 高通量,使用 AVAX |
8453 | 根据 | Coinbase 的 Layer 2,基于 Optimism |
工具和提示
1. getPrice
获取 Uniswap 交换的报价。
架构:
chainId
:数字(默认值:1)tokenIn
:字符串(例如"NATIVE"
或代币地址)tokenOut
:字符串(例如"NATIVE"
或代币地址)amountIn
:字符串(可选,"exactIn"
必需)amountOut
:字符串(可选,"exactOut"
必需)tradeType
:"exactIn"
或"exactOut"
(默认值:"exactIn"
)
示例提示:
输出:
2. executeSwap
在 Uniswap 上执行交换。
架构:
chainId
:数字(默认值:1)tokenIn
:字符串tokenOut
:字符串amountIn
:字符串(可选,"exactIn"
必需)amountOut
:字符串(可选,"exactOut"
必需)tradeType
:"exactIn"
或"exactOut"
(默认值:"exactIn"
)slippageTolerance
:数字(默认值:0.5,百分比)deadline
:数字(默认值:20,以分钟为单位)
示例提示:
输出:
执照
MIT 许可证。详情请参阅许可证。
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
一个用于 AI 代理的 MCP 服务器,用于跨多个区块链自动执行 Uniswap DEX 上的代币交换。
Related MCP Servers
- AsecurityAlicenseAqualityAn MCP server implementation that enables access to DexScreener API data, providing real-time information on DEX pairs, token profiles, and market statistics across multiple blockchains.Last updated -717The Unlicense
Armor Crypto MCPofficial
AsecurityAlicenseAqualityAn MCP server providing unified access to blockchain operations, bridging, swapping, and crypto trading strategies for AI agents.Last updated -37188GPL 3.0- -securityFlicense-qualityAn MCP server that enables cross-chain token swapping between different blockchains using 1inch Fusion+ API, along with portfolio management tools for tracking assets across chains.Last updated -1
- AsecurityAlicenseAqualityA Model Context Protocol server that enables AI assistants and applications to interact with decentralized exchanges (DEXs), allowing users to get quotes for token swaps and execute swap transactions.Last updated -321MIT License